Erich E. Hoover : server: Create directories with the specified security attributes.
Alexandre Julliard
julliard at winehq.org
Thu Nov 21 14:07:47 CST 2013
Module: wine
Branch: master
Commit: d2e216f462c2ccc57cac6c8e683aae2abd719916
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d2e216f462c2ccc57cac6c8e683aae2abd719916
Author: Erich E. Hoover <erich.e.hoover at gmail.com>
Date: Fri Nov 8 12:04:56 2013 -0700
server: Create directories with the specified security attributes.
---
dlls/advapi32/tests/security.c | 5 ++---
server/fd.c | 2 +-
server/file.c | 2 ++
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
index 4de623d..fe31b5c 100644
--- a/dlls/advapi32/tests/security.c
+++ b/dlls/advapi32/tests/security.c
@@ -3081,9 +3081,8 @@ static void test_CreateDirectoryA(void)
bret = pGetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation);
ok(bret, "GetAclInformation failed\n");
- todo_wine ok(acl_size.AceCount == 2,
- "GetAclInformation returned unexpected entry count (%d != 2).\n",
- acl_size.AceCount);
+ ok(acl_size.AceCount == 2, "GetAclInformation returned unexpected entry count (%d != 2).\n",
+ acl_size.AceCount);
if (acl_size.AceCount > 0)
{
bret = pGetAce(pDacl, 0, (VOID **)&ace);
diff --git a/server/fd.c b/server/fd.c
index 32b2a29..fa8874c 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -1768,7 +1768,7 @@ struct fd *open_fd( struct fd *root, const char *name, int flags, mode_t *mode,
/* create the directory if needed */
if ((options & FILE_DIRECTORY_FILE) && (flags & O_CREAT))
{
- if (mkdir( name, 0777 ) == -1)
+ if (mkdir( name, *mode ) == -1)
{
if (errno != EEXIST || (flags & O_EXCL))
{
diff --git a/server/file.c b/server/file.c
index 94d3060..cceb8ad 100644
--- a/server/file.c
+++ b/server/file.c
@@ -218,6 +218,8 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si
owner = token_get_user( current->process->token );
mode = sd_to_mode( sd, owner );
}
+ else if (options & FILE_DIRECTORY_FILE)
+ mode = (attrs & FILE_ATTRIBUTE_READONLY) ? 0555 : 0777;
else
mode = (attrs & FILE_ATTRIBUTE_READONLY) ? 0444 : 0666;
More information about the wine-cvs
mailing list