]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: handle fake file handles in fdos_mode()
authorRalph Boehme <slow@samba.org>
Fri, 4 Jun 2021 13:54:20 +0000 (15:54 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 9 Jun 2021 19:47:34 +0000 (19:47 +0000)
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>
source3/smbd/dosmode.c

index ac6afe77464df034c90080514a32899a6486eee7..bcca7e0a50a2578512695bf6f1798cb4a1f69b55 100644 (file)
@@ -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,
@@ -753,6 +754,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;
        }