* 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.
This commit is contained in:
Corinna Vinschen 2008-08-19 09:46:31 +00:00
parent 46c6def37f
commit ec8a7e416f
4 changed files with 16 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2008-08-19 Corinna Vinschen <corinna@vinschen.de>
* 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 <me+cygwin@cgf.cx> 2008-08-18 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler.cc (fhandler_base::wait_overlapped): Don't treat * fhandler.cc (fhandler_base::wait_overlapped): Don't treat

View File

@ -1386,7 +1386,6 @@ fhandler_disk_file::mkdir (mode_t mode)
HANDLE dir; HANDLE dir;
OBJECT_ATTRIBUTES attr; OBJECT_ATTRIBUTES attr;
IO_STATUS_BLOCK io; IO_STATUS_BLOCK io;
ULONG fattr = FILE_ATTRIBUTE_DIRECTORY;
PFILE_FULL_EA_INFORMATION p = NULL; PFILE_FULL_EA_INFORMATION p = NULL;
ULONG plen = 0; ULONG plen = 0;
@ -1410,7 +1409,8 @@ fhandler_disk_file::mkdir (mode_t mode)
} }
status = NtCreateFile (&dir, FILE_LIST_DIRECTORY | SYNCHRONIZE, status = NtCreateFile (&dir, FILE_LIST_DIRECTORY | SYNCHRONIZE,
pc.get_object_attr (attr, sa), &io, NULL, 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_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT
| FILE_OPEN_FOR_BACKUP_INTENT, | FILE_OPEN_FOR_BACKUP_INTENT,
p, plen); p, plen);

View File

@ -90,7 +90,7 @@ ipc_mutex_init (HANDLE *pmtx, const char *name)
char buf[MAX_PATH]; char buf[MAX_PATH];
SECURITY_ATTRIBUTES sa = sec_none; 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); sa.lpSecurityDescriptor = everyone_sd (CYG_MUTANT_ACCESS);
*pmtx = CreateMutex (&sa, FALSE, buf); *pmtx = CreateMutex (&sa, FALSE, buf);
if (!*pmtx) if (!*pmtx)
@ -135,7 +135,7 @@ ipc_cond_init (HANDLE *pevt, const char *name)
char buf[MAX_PATH]; char buf[MAX_PATH];
SECURITY_ATTRIBUTES sa = sec_none; 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); sa.lpSecurityDescriptor = everyone_sd (CYG_EVENT_ACCESS);
*pevt = CreateEvent (&sa, TRUE, FALSE, buf); *pevt = CreateEvent (&sa, TRUE, FALSE, buf);
if (!*pevt) if (!*pevt)

View File

@ -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 Don't set FILE_READ/WRITE_ATTRIBUTES unconditionally on Samba, otherwise
it enforces read permissions. Same for other's below. */ it enforces read permissions. Same for other's below. */
DWORD owner_allow = STANDARD_RIGHTS_ALL DWORD owner_allow = STANDARD_RIGHTS_ALL
| pc.fs_is_samba () | (pc.fs_is_samba ()
? 0 : (FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES); ? 0 : (FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES));
if (attribute & S_IRUSR) if (attribute & S_IRUSR)
owner_allow |= FILE_GENERIC_READ; owner_allow |= FILE_GENERIC_READ;
if (attribute & S_IWUSR) if (attribute & S_IWUSR)