summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2021-06-04 15:54:20 +0200
committerKarolin Seeger <kseeger@samba.org>2021-08-17 09:08:36 +0000
commitb53968656eee6c57e281ee32bff1d4643b4292f0 (patch)
tree680bc8a34731bbd53cde198270a7b5262561df5b
parent7e1d4a4b1385b9bc75ce61531c8df77584bb9ead (diff)
downloadsamba-b53968656eee6c57e281ee32bff1d4643b4292f0.tar.gz
smbd: handle fake file handles in fdos_mode()
This ensures SMB requests on the quote fake file "$Extend/$Quota" don't hit the VFS, where specifically in vfs_gpfs we log an error message if we fail to read the DOS attributes for a file with vfs_gpfs_get_dos_attributes: Getting winattrs failed for $Extend/$Quota BUG: https://bugzilla.samba.org/show_bug.cgi?id=14731 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit e093eaed1046638193d973c39fa9df74e41148d3)
-rw-r--r--source3/smbd/dosmode.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 844f5efe389..79158007654 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -28,6 +28,7 @@
#include "lib/param/loadparm.h"
#include "lib/util/tevent_ntstatus.h"
#include "lib/util/string_wrappers.h"
+#include "fake_file.h"
static NTSTATUS get_file_handle_for_metadata(connection_struct *conn,
const struct smb_filename *smb_fname,
@@ -751,6 +752,10 @@ uint32_t fdos_mode(struct files_struct *fsp)
DBG_DEBUG("%s\n", fsp_str_dbg(fsp));
+ if (fsp->fake_file_handle != NULL) {
+ return dosmode_from_fake_filehandle(fsp->fake_file_handle);
+ }
+
if (!VALID_STAT(fsp->fsp_name->st)) {
return 0;
}