summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-09-27 23:28:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:31:01 -0500
commit152a1f4a7d462ca118169cb99a407c245f5c2504 (patch)
tree53d4a3626a6be705327a6008ebfd28ea39bd84a2 /source3/smbd
parent7fc3a0663c022a8dc86e166a5037620c01148392 (diff)
downloadsamba-152a1f4a7d462ca118169cb99a407c245f5c2504.tar.gz
samba-152a1f4a7d462ca118169cb99a407c245f5c2504.tar.bz2
samba-152a1f4a7d462ca118169cb99a407c245f5c2504.zip
r25391: Fix bug #4978 : Store DOS Attributes fails when copying folders.
Jeremy. (This used to be commit 713277391ae7f81f8545723c919865ff8c07ed86)
Diffstat (limited to 'source3/smbd')
-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);
}