summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/open.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 8e1068e708..6c2b5a4907 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1983,6 +1983,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
char *parent_dir;
const char *dirname;
NTSTATUS status;
+ bool posix_open = false;
if(!CAN_WRITE(conn)) {
DEBUG(5,("mkdir_internal: failing create on read-only share "
@@ -2001,6 +2002,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
}
if (file_attributes & FILE_FLAG_POSIX_SEMANTICS) {
+ posix_open = true;
mode = (mode_t)(file_attributes & ~FILE_FLAG_POSIX_SEMANTICS);
} else {
mode = unix_mode(conn, aDIR, name, parent_dir);
@@ -2025,6 +2027,14 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
return NT_STATUS_ACCESS_DENIED;
}
+ if (lp_store_dos_attributes(SNUM(conn))) {
+ if (!posix_open) {
+ file_set_dosmode(conn, name,
+ file_attributes | aDIR, NULL,
+ parent_dir);
+ }
+ }
+
if (lp_inherit_perms(SNUM(conn))) {
inherit_access_acl(conn, parent_dir, name, mode);
}