From 5b3f03171a56c876cfae35163f46bcd406b3ea76 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 (cherry picked from commit 9de1411d9e7c7ac3da544345d4dea7fd73dff01b) --- 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 c80d2405ed6..65f47eeb1b0 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -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); -- 2.47.2