switch from mtime to ctime which is more reliable if files can be accessed outside...
authorolivier <olivier@virtscano.fakenet>
Wed, 10 Nov 2010 16:48:06 +0000 (17:48 +0100)
committerKarolin Seeger <kseeger@samba.org>
Sat, 5 Mar 2011 13:34:39 +0000 (14:34 +0100)
Fix bug #7789 (change vfs_scannedonly from mtime to ctime).
(cherry picked from commit 2d24c4a056e5c54b5ef4c9112cec076ac7c08d6f)

source3/modules/vfs_scannedonly.c

index 12077f374da0dc49d83a7b27654c67dea73eb205..7b4b42b13b31ecd7a9cf8142f32b6fa408199578 100644 (file)
@@ -426,8 +426,8 @@ static bool scannedonly_allow_access(vfs_handle_struct * handle,
                retval = SMB_VFS_NEXT_STAT(handle, cache_smb_fname);
        }
        if (retval == 0 && VALID_STAT(cache_smb_fname->st)) {
-               if (timespec_is_newer(&smb_fname->st.st_ex_mtime,
-                                     &cache_smb_fname->st.st_ex_mtime)) {
+               if (timespec_is_newer(&smb_fname->st.st_ex_ctime,
+                                     &cache_smb_fname->st.st_ex_ctime)) {
                        talloc_free(cache_smb_fname);
                        return true;
                }
@@ -489,8 +489,8 @@ static bool scannedonly_allow_access(vfs_handle_struct * handle,
        }
        /* still no cachefile, or still too old, return 0 */
        if (retval != 0
-           || !timespec_is_newer(&smb_fname->st.st_ex_mtime,
-                                 &cache_smb_fname->st.st_ex_mtime)) {
+           || !timespec_is_newer(&smb_fname->st.st_ex_ctime,
+                                 &cache_smb_fname->st.st_ex_ctime)) {
                DEBUG(SCANNEDONLY_DEBUG,
                      ("retval=%d, return 0\n",retval));
                return false;