* newlib/libc/include/sys/unistd.h: Add prototypes for
fchmod, fchown, lchown. * winsup/cygwin/syscalls.cc (chown_worker): Use previous uid/gid if new uid/gid is -1. New static function with chown functionality. (chown): Call chown_worker with SYMLINK_FOLLOW. (fchown): New function. Call chown_worker with SYMLINK_FOLLOW. (lchown): New function. Call chown_worker with SYMLINK_IGNORE. * cygwin.din: Add symbols for fchown, lchown. * path.cc (symlink): Call `set_file_attribute()' and `SetFileAttributeA()' instead of `chmod()' to set uid/gid correct.
This commit is contained in:
@ -2048,7 +2048,10 @@ symlink (const char *topath, const char *frompath)
|
||||
else
|
||||
{
|
||||
CloseHandle (h);
|
||||
chmod (frompath, S_IFLNK | S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
set_file_attribute (win32_path.has_acls (),
|
||||
win32_path.get_win32 (),
|
||||
S_IFLNK | S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
SetFileAttributesA (win32_path.get_win32 (), FILE_ATTRIBUTE_SYSTEM);
|
||||
res = 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user