* 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:
Corinna Vinschen
2000-04-02 20:42:42 +00:00
parent c90d7012d3
commit 796e3b20bc
6 changed files with 96 additions and 18 deletions

View File

@ -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;
}
}