* autoload.cc (NtSetSecurityObject): Add.
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Only request READ_CONTROL rights when opening the file. * ntdll.h (NtSetSecurityObject): Add declaration. * security.cc (write_sd): Call NtSetSecurityObject instead of BackupWrite. (get_nt_object_security): Don't free security descriptor here. * syscalls.cc (ttyname): Use buffer of length TTY_NAME_MAX + 1. * sysconf.cc (sysconf): Handle _SC_TTY_NAME_MAX request. * include/limits.h: Define TTY_NAME_MAX and _POSIX_TTY_NAME_MAX.
This commit is contained in:
@@ -377,7 +377,8 @@ fhandler_disk_file::fchmod (mode_t mode)
|
||||
if (pc.is_fs_special ())
|
||||
return chmod_device (pc, mode);
|
||||
|
||||
if (!get_io_handle () && !(oret = open_fs (O_RDONLY | O_BINARY, 0)))
|
||||
query_open (query_read_control);
|
||||
if (!get_io_handle () && !(oret = open_fs (O_BINARY, 0)))
|
||||
return -1;
|
||||
|
||||
SetFileAttributes (get_win32_name (), (DWORD) pc & ~FILE_ATTRIBUTE_READONLY);
|
||||
|
Reference in New Issue
Block a user