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)
committerJeremy Allison <jra@samba.org>
Wed, 26 Jul 2023 23:42:44 +0000 (23:42 +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

source3/rpc_server/mdssvc/mdssvc.c

index 4f1bbdfd9d6ea49ee38464aa4528ccd7396324ff..abeaac8263c20e4b1ba2940675ea907af0f1c738 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) {