From a926fc79394922071ae1075ff3a8ad5474df47fb Mon Sep 17 00:00:00 2001 From: jra Date: Thu, 27 Sep 2007 23:28:35 +0000 Subject: [PATCH] Fix bug #4978 : Store DOS Attributes fails when copying folders. Jeremy. git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_3_2@25391 0c0555d6-39d7-0310-84fc-f1cc0bd64818 --- source/smbd/open.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/smbd/open.c b/source/smbd/open.c index 8e1068e70..6c2b5a490 100644 --- a/source/smbd/open.c +++ b/source/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); } -- 2.34.1