]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
mdssvc: fix returning file modification date for older Mac releases
authorRalph Boehme <slow@samba.org>
Thu, 18 May 2023 16:12:19 +0000 (18:12 +0200)
committerJule Anger <janger@samba.org>
Mon, 31 Jul 2023 09:11:27 +0000 (09:11 +0000)
Mac 10.10 uses kMDItemContentModificationDate instead of
kMDItemFSContentChangeDate.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15427

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul 26 23:42:44 UTC 2023 on atb-devel-224

(cherry picked from commit c2e83ebe726b7bc42b329198214c784936f19888)

Autobuild-User(v4-17-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-17-test): Mon Jul 31 09:11:27 UTC 2023 on sn-devel-184

source3/rpc_server/mdssvc/mdssvc.c

index 7a8cbcf3588e36cf3376591726b0ecbc97b8a492..a7d5d7afc029a1999afaef8fe1842f653b8b762f 100644 (file)
@@ -188,7 +188,9 @@ static bool add_filemeta(struct mds_ctx *mds_ctx,
                        if (result != 0) {
                                return false;
                        }
-               } else if (strcmp(attribute, "kMDItemFSContentChangeDate") == 0) {
+               } else if (strcmp(attribute, "kMDItemFSContentChangeDate") == 0 ||
+                       strcmp(attribute, "kMDItemContentModificationDate") == 0)
+               {
                        sl_time = convert_timespec_to_timeval(sp->st_ex_mtime);
                        result = dalloc_add_copy(meta, &sl_time, sl_time_t);
                        if (result != 0) {