From 9de1411d9e7c7ac3da544345d4dea7fd73dff01b Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 8 Jun 2017 19:05:48 +0200 Subject: [PATCH] s3/smbd: handling of failed DOS attributes reading 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 Reviewed-by: Christof Schmitt --- source3/smbd/dosmode.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 0ee68947851..d53386e357e 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -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) {