* security.cc (alloc_sd): Don't set FILE_DELETE_CHILD for group

if S_ISVTX attribute is given.
        * dir.cc (mkdir): Allow immediate setting of S_ISUID, S_ISGID and
        S_ISVTX attribute.
        * syscalls.cc (_open): Ditto.
This commit is contained in:
Corinna Vinschen 2001-08-07 16:14:59 +00:00
parent 86fb039324
commit c0ae23dc47
4 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,11 @@
Tue Aug 7 18:11:00 2001 Corinna Vinschen <corinna@vinschen.de>
* security.cc (alloc_sd): Don't set FILE_DELETE_CHILD for group
if S_ISVTX attribute is given.
* dir.cc (mkdir): Allow immediate setting of S_ISUID, S_ISGID and
S_ISVTX attribute.
* syscalls.cc (_open): Ditto.
Tue Aug 7 16:24:00 2001 Corinna Vinschen <corinna@vinschen.de>
* dir.cc (mkdir): Set security attributes correctly for

View File

@ -320,14 +320,14 @@ mkdir (const char *dir, mode_t mode)
goto done;
if (allow_ntsec && real_dir.has_acls ())
set_security_attribute (S_IFDIR | ((mode & 0777) & ~cygheap->umask),
set_security_attribute (S_IFDIR | ((mode & 07777) & ~cygheap->umask),
&sa, alloca (256), 256);
if (CreateDirectoryA (real_dir.get_win32 (), &sa))
{
if (!allow_ntsec && allow_ntea)
set_file_attribute (real_dir.has_acls (), real_dir.get_win32 (),
S_IFDIR | ((mode & 0777) & ~cygheap->umask));
S_IFDIR | ((mode & 07777) & ~cygheap->umask));
res = 0;
}
else

View File

@ -1393,7 +1393,8 @@ alloc_sd (uid_t uid, gid_t gid, const char *logsrv, int attribute,
if (attribute & S_IXGRP)
group_allow |= FILE_GENERIC_EXECUTE;
if ((attribute & (S_IFDIR | S_IWGRP | S_IXGRP))
== (S_IFDIR | S_IWGRP | S_IXGRP))
== (S_IFDIR | S_IWGRP | S_IXGRP)
&& !(attribute & S_ISVTX))
group_allow |= FILE_DELETE_CHILD;
/* Construct allow attribute for everyone. */

View File

@ -466,7 +466,7 @@ _open (const char *unix_path, int flags, ...)
set_errno (ENMFILE);
else if ((fh = cygheap->fdtab.build_fhandler (fd, unix_path, NULL)) == NULL)
res = -1; // errno already set
else if (!fh->open (unix_path, flags, (mode & 0777) & ~cygheap->umask))
else if (!fh->open (unix_path, flags, (mode & 07777) & ~cygheap->umask))
{
cygheap->fdtab.release (fd);
res = -1;