]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/smbd: handling of failed DOS attributes reading
authorRalph Boehme <slow@samba.org>
Thu, 8 Jun 2017 17:05:48 +0000 (19:05 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 14 Aug 2017 08:50:10 +0000 (10:50 +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>
(cherry picked from commit 9de1411d9e7c7ac3da544345d4dea7fd73dff01b)

source3/smbd/dosmode.c

index c80d2405ed6dc7a0e3622504f4b5bb4db462f1c6..65f47eeb1b0faf0d2a74e6d56c2c9065888157ef 100644 (file)
@@ -617,7 +617,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);
+               }
        }
 
        offline = SMB_VFS_IS_OFFLINE(conn, smb_fname, &smb_fname->st);