summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2019-09-09 08:08:06 +0200
committerStefan Metzmacher <metze@samba.org>2019-09-10 22:29:08 +0000
commitd887047aa0c2489d1d6251ffcb9ce083e86866e1 (patch)
tree41ac3146187420dba32ca84937f900447789c2f3
parentb4aaa612d33caf51b44830d75997d4ad93b7740d (diff)
downloadsamba-d887047aa0c2489d1d6251ffcb9ce083e86866e1.tar.gz
vfs: restore stat fields in vfs_stat_fsp()
This ensures we preserve btime, itime and File-ID. As the Durable Handles code calls vfs_stat_fsp() in the DH disconnect function, previously the btime was lost and NOT stored in the cookie. With this change the cookie will store the correct btime (and iflags), which requires us to call dos_mode() in the reconnect function to ensure we pass vfs_default_durable_reconnect_check_stat(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Sep 10 20:22:21 UTC 2019 on sn-devel-184 (cherry picked from commit 95655fe683d499d93f3844ed72ad332ef64adb96) Autobuild-User(v4-11-test): Stefan Metzmacher <metze@samba.org> Autobuild-Date(v4-11-test): Tue Sep 10 22:29:08 UTC 2019 on sn-devel-184
-rw-r--r--selftest/knownfail.d/samba3.smb2.create1
-rw-r--r--source3/smbd/durable.c2
-rw-r--r--source3/smbd/vfs.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/selftest/knownfail.d/samba3.smb2.create b/selftest/knownfail.d/samba3.smb2.create
deleted file mode 100644
index 89455dacdf0..00000000000
--- a/selftest/knownfail.d/samba3.smb2.create
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.fileid.fileid\(nt4_dc\)
diff --git a/source3/smbd/durable.c b/source3/smbd/durable.c
index 4aa5a2d619e..89c4c1e8d14 100644
--- a/source3/smbd/durable.c
+++ b/source3/smbd/durable.c
@@ -842,6 +842,8 @@ NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn,
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
+ (void)dos_mode(fsp->conn, fsp->fsp_name);
+
ok = vfs_default_durable_reconnect_check_stat(&cookie.stat_info,
&fsp->fsp_name->st,
fsp_str_dbg(fsp));
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 67f7d6356a2..c8437a0c6c9 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -1406,6 +1406,7 @@ int vfs_stat_smb_basename(struct connection_struct *conn,
NTSTATUS vfs_stat_fsp(files_struct *fsp)
{
int ret;
+ struct stat_ex saved_stat = fsp->fsp_name->st;
if(fsp->fh->fd == -1) {
if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {
@@ -1419,6 +1420,7 @@ NTSTATUS vfs_stat_fsp(files_struct *fsp)
if (ret == -1) {
return map_nt_error_from_unix(errno);
}
+ update_stat_ex_from_saved_stat(&fsp->fsp_name->st, &saved_stat);
return NT_STATUS_OK;
}