From c16c53a380f7fe9ffbf99a97a6cdf24cc7934849 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Mon, 7 Nov 2016 17:29:58 +0100 Subject: [PATCH] s3/smbd: fix the last resort check that sets the file type attribute SMB_VFS_GET_DOS_ATTRIBUTES() may return eg FILE_ATTRIBUTE_HIDDEN for a directory, so result is not 0 and if the VFS module doesn't set the directory attribute itself, we fail to set it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12436 Signed-off-by: Ralph Boehme --- source3/smbd/dosmode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index dab47c0..04e71ae 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -636,7 +636,7 @@ uint32_t dos_mode(connection_struct *conn, struct smb_filename *smb_fname) result |= dos_mode_from_name(conn, smb_fname, result); - if (result == 0) { + if ((result & (FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_DIRECTORY)) == 0) { if (S_ISDIR(smb_fname->st.st_ex_mode)) { result = FILE_ATTRIBUTE_DIRECTORY; } else { -- 2.7.4