From 8c62297ac535d7232528f0a38ff3b605bbd25280 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 8 Aug 2001 10:00:35 +0000 Subject: * security.cc (alloc_sd): Revert to setting inheritance attribute for permissions given to directories. Never set inheritance on NULL ACE. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/security.cc | 18 +----------------- 2 files changed, 6 insertions(+), 17 deletions(-) (limited to 'winsup/cygwin') diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5e8d12e..f0cd3df 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Wed Aug 8 11:46:00 2001 Corinna Vinschen + + * security.cc (alloc_sd): Revert to setting inheritance attribute for + permissions given to directories. Never set inheritance on NULL ACE. + Tue Aug 7 18:11:00 2001 Corinna Vinschen * security.cc (alloc_sd): Don't set FILE_DELETE_CHILD for group diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 5a778e9..9b5a1e3 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -1436,23 +1436,7 @@ alloc_sd (uid_t uid, gid_t gid, const char *logsrv, int attribute, group_deny &= ~(STANDARD_RIGHTS_READ | FILE_READ_ATTRIBUTES | FILE_READ_EA); /* Construct appropriate inherit attribute. */ - /* TODO */ -#if 0 - /* Inheriting of attributes result in some strange behaviour if - a user creates files in directories which are owned by another - user. Even if the creator has all permissions, the default - permissions of created files are set according to the dirs - permission bits which may result in the inability to chmod - the own file. - Even if not inheriting permissions seems to be the correct - behaviour from the POSIX point of view, I'll keep that - stuff in the sources if it turns out that native Windows - processes are failing due to this change. - */ DWORD inherit = (attribute & S_IFDIR) ? INHERIT_ALL : DONT_INHERIT; -#else - DWORD inherit = DONT_INHERIT; -#endif /* Set deny ACE for owner. */ if (owner_deny @@ -1480,7 +1464,7 @@ alloc_sd (uid_t uid, gid_t gid, const char *logsrv, int attribute, /* Set null ACE for special bits. */ if (null_allow && !add_access_allowed_ace (acl, ace_off++, null_allow, - well_known_null_sid, acl_len, inherit)) + well_known_null_sid, acl_len, DONT_INHERIT)) return NULL; /* Get owner and group from current security descriptor. */ -- cgit v1.1