s3/smbd: handling of failed DOS attributes reading
authorRalph Boehme <slow@samba.org>
Thu, 8 Jun 2017 17:05:48 +0000 (19:05 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 8 Aug 2017 19:23:10 +0000 (21:23 +0200)
Only fall back to using UNIX modes if we get NOT_IMPLEMENTED. This is
exactly what we already do when setting DOS attributes.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12944

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
source3/smbd/dosmode.c

index 0ee6894785169a8ba72dca77eb475a36066ae0ad..d53386e357e72d2c4ded54ea14c0fc9fe9eb2432 100644 (file)
@@ -622,7 +622,12 @@ uint32_t dos_mode(connection_struct *conn, struct smb_filename *smb_fname)
        /* Get the DOS attributes via the VFS if we can */
        status = SMB_VFS_GET_DOS_ATTRIBUTES(conn, smb_fname, &result);
        if (!NT_STATUS_IS_OK(status)) {
-               result |= dos_mode_from_sbuf(conn, smb_fname);
+               /*
+                * Only fall back to using UNIX modes if we get NOT_IMPLEMENTED.
+                */
+               if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) {
+                       result |= dos_mode_from_sbuf(conn, smb_fname);
+               }
        }
 
        if (conn->fs_capabilities & FILE_FILE_COMPRESSION) {