From ec8a7e416f570407fe5360959272418a2b4c79f8 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 19 Aug 2008 09:46:31 +0000 Subject: [PATCH] * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Drop fattr variable and use FILE_ATTRIBUTE_DIRECTORY directly in call to NtCreateFile. * posix_ipc.cc (ipc_mutex_init): Fix format string when creating IPC object name. (ipc_cond_init): Ditto. * security.cc (alloc_sd): Add parentheses to fix setting initial owner_allow value. --- winsup/cygwin/ChangeLog | 10 ++++++++++ winsup/cygwin/fhandler_disk_file.cc | 4 ++-- winsup/cygwin/posix_ipc.cc | 4 ++-- winsup/cygwin/security.cc | 4 ++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ae21fe5d6..42e57fb92 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,13 @@ +2008-08-19 Corinna Vinschen + + * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Drop fattr variable + and use FILE_ATTRIBUTE_DIRECTORY directly in call to NtCreateFile. + * posix_ipc.cc (ipc_mutex_init): Fix format string when creating IPC + object name. + (ipc_cond_init): Ditto. + * security.cc (alloc_sd): Add parentheses to fix setting initial + owner_allow value. + 2008-08-18 Christopher Faylor * fhandler.cc (fhandler_base::wait_overlapped): Don't treat diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 5ec3e34f1..cbfa36a48 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -1386,7 +1386,6 @@ fhandler_disk_file::mkdir (mode_t mode) HANDLE dir; OBJECT_ATTRIBUTES attr; IO_STATUS_BLOCK io; - ULONG fattr = FILE_ATTRIBUTE_DIRECTORY; PFILE_FULL_EA_INFORMATION p = NULL; ULONG plen = 0; @@ -1410,7 +1409,8 @@ fhandler_disk_file::mkdir (mode_t mode) } status = NtCreateFile (&dir, FILE_LIST_DIRECTORY | SYNCHRONIZE, pc.get_object_attr (attr, sa), &io, NULL, - fattr, FILE_SHARE_VALID_FLAGS, FILE_CREATE, + FILE_ATTRIBUTE_DIRECTORY, FILE_SHARE_VALID_FLAGS, + FILE_CREATE, FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT, p, plen); diff --git a/winsup/cygwin/posix_ipc.cc b/winsup/cygwin/posix_ipc.cc index 102691ecb..53b887493 100644 --- a/winsup/cygwin/posix_ipc.cc +++ b/winsup/cygwin/posix_ipc.cc @@ -90,7 +90,7 @@ ipc_mutex_init (HANDLE *pmtx, const char *name) char buf[MAX_PATH]; SECURITY_ATTRIBUTES sa = sec_none; - __small_sprintf (buf, "mqueue/mtx_%W", name); + __small_sprintf (buf, "mqueue/mtx_%s", name); sa.lpSecurityDescriptor = everyone_sd (CYG_MUTANT_ACCESS); *pmtx = CreateMutex (&sa, FALSE, buf); if (!*pmtx) @@ -135,7 +135,7 @@ ipc_cond_init (HANDLE *pevt, const char *name) char buf[MAX_PATH]; SECURITY_ATTRIBUTES sa = sec_none; - __small_sprintf (buf, "mqueue/evt_%W", name); + __small_sprintf (buf, "mqueue/evt_%s", name); sa.lpSecurityDescriptor = everyone_sd (CYG_EVENT_ACCESS); *pevt = CreateEvent (&sa, TRUE, FALSE, buf); if (!*pevt) diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 5d9846abc..58c740e21 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -466,8 +466,8 @@ alloc_sd (path_conv &pc, __uid32_t uid, __gid32_t gid, int attribute, Don't set FILE_READ/WRITE_ATTRIBUTES unconditionally on Samba, otherwise it enforces read permissions. Same for other's below. */ DWORD owner_allow = STANDARD_RIGHTS_ALL - | pc.fs_is_samba () - ? 0 : (FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES); + | (pc.fs_is_samba () + ? 0 : (FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES)); if (attribute & S_IRUSR) owner_allow |= FILE_GENERIC_READ; if (attribute & S_IWUSR)