From 3dbafd873eb4fbc587a37c06fa4e101ab4350b8e Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 4 Feb 2003 19:26:01 +0000 Subject: [PATCH] * path.cc (symlink): Create security attributes so that only the user can modify the symlink. * security.cc (set_security_attribute): Remove symlink special handling. --- winsup/cygwin/ChangeLog | 7 +++++++ winsup/cygwin/path.cc | 2 +- winsup/cygwin/security.cc | 4 ---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5c6251763..429000e51 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,10 @@ +2003-02-04 Corinna Vinschen + + * path.cc (symlink): Create security attributes so that only the + user can modify the symlink. + * security.cc (set_security_attribute): Remove symlink special + handling. + 2003-02-04 Pierre Humblet * grp.cc (internal_getgroups): Do not return without closing diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 1d754be33..fe6d25586 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2643,7 +2643,7 @@ symlink (const char *topath, const char *frompath) } if (allow_ntsec && win32_path.has_acls ()) - set_security_attribute (S_IFLNK | S_IRWXU | S_IRWXG | S_IRWXO, + set_security_attribute (S_IFLNK | STD_RBITS | STD_WBITS, &sa, alloca (4096), 4096); h = CreateFile (win32_path, GENERIC_WRITE, 0, &sa, diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 224eff438..f72b89672 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -1853,10 +1853,6 @@ void set_security_attribute (int attribute, PSECURITY_ATTRIBUTES psa, void *sd_buf, DWORD sd_buf_size) { - /* symlinks are anything for everyone! */ - if ((attribute & S_IFLNK) == S_IFLNK) - attribute |= S_IRWXU | S_IRWXG | S_IRWXO; - psa->lpSecurityDescriptor = sd_buf; InitializeSecurityDescriptor ((PSECURITY_DESCRIPTOR) sd_buf, SECURITY_DESCRIPTOR_REVISION);