]> sourceware.org Git - newlib-cygwin.git/commitdiff
* security.h (DONT_INHERIT): Eliminate definition.
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 2 Jul 2002 08:11:15 +0000 (08:11 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 2 Jul 2002 08:11:15 +0000 (08:11 +0000)
(INHERIT_ALL): Ditto.
(INHERIT_ONLY): Ditto.
* sec_acl.cc: Use appropriate defines from accctrl.h instead of the
above throughout.
* security.cc: Ditto.

winsup/cygwin/ChangeLog
winsup/cygwin/sec_acl.cc
winsup/cygwin/security.cc
winsup/cygwin/security.h

index dadcec0e335bd1e7cdfb54cf31d8189dc2d8d3a0..c5d358ec6d5c038ec3e700338414758543361e41 100644 (file)
@@ -1,3 +1,12 @@
+2002-07-02  Corinna Vinschen  <corinna@vinschen.de>
+
+       * security.h (DONT_INHERIT): Eliminate definition.
+       (INHERIT_ALL): Ditto.
+       (INHERIT_ONLY): Ditto.
+       * sec_acl.cc: Use appropriate defines from accctrl.h instead of the
+       above throughout.
+       * security.cc: Ditto.
+
 2002-07-01  Pierre Humblet  <pierre.humblet@ieee.org>
 
        * syscalls.c (seteuid32): Return immediately if the program is not
index e93073794a87794645940084da68e1c337cea192..26ab878c1a43027b920d66a708f726f99d07976a 100644 (file)
@@ -128,7 +128,8 @@ setacl (const char *file, int nentries, __aclent16_t *aclbufp)
        allow |= FILE_DELETE_CHILD;
       /* Set inherit property. */
       DWORD inheritance = (aclbufp[i].a_type & ACL_DEFAULT)
-                         ? INHERIT_ONLY : DONT_INHERIT;
+                         ? (SUB_CONTAINERS_AND_OBJECTS_INHERIT | INHERIT_ONLY)
+                         : NO_INHERITANCE;
       /*
        * If a specific acl contains a corresponding default entry with
        * identical permissions, only one Windows ACE with proper
@@ -142,7 +143,7 @@ setacl (const char *file, int nentries, __aclent16_t *aclbufp)
          && pos < nentries
          && aclbufp[i].a_perm == aclbufp[pos].a_perm)
        {
-         inheritance = INHERIT_ALL;
+         inheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT;
          /* This eliminates the corresponding default entry. */
          aclbufp[pos].a_type = 0;
        }
@@ -344,12 +345,12 @@ getacl (const char *file, DWORD attr, int nentries, __aclent16_t *aclbufp)
        }
       if (!type)
        continue;
-      if (!(ace->Header.AceFlags & INHERIT_ONLY_ACE))
+      if (!(ace->Header.AceFlags & INHERIT_ONLY))
        {
          if ((pos = searchace (lacl, MAX_ACL_ENTRIES, type, id)) >= 0)
            getace (lacl[pos], type, id, ace->Mask, ace->Header.AceType);
        }
-      if ((ace->Header.AceFlags & INHERIT_ALL)
+      if ((ace->Header.AceFlags & SUB_CONTAINERS_AND_OBJECTS_INHERIT)
          && (attr & FILE_ATTRIBUTE_DIRECTORY))
        {
          type |= ACL_DEFAULT;
index c7dfbbefafb2d8443b01be3c91eb99d57dbd5af8..6c239af1fae513f9df38e8b68e7970725599dfed 100644 (file)
@@ -1187,7 +1187,7 @@ get_nt_attribute (const char *file, int *attribute,
     {
       if (!GetAce (acl, i, (PVOID *) &ace))
        continue;
-      if (ace->Header.AceFlags & INHERIT_ONLY_ACE)
+      if (ace->Header.AceFlags & INHERIT_ONLY)
        continue;
       switch (ace->Header.AceType)
        {
@@ -1363,7 +1363,7 @@ get_nt_object_attribute (HANDLE handle, SE_OBJECT_TYPE object_type, int *attribu
     {
       if (!GetAce (acl, i, (PVOID *) &ace))
        continue;
-      if (ace->Header.AceFlags & INHERIT_ONLY_ACE)
+      if (ace->Header.AceFlags & INHERIT_ONLY)
        continue;
       switch (ace->Header.AceType)
        {
@@ -1664,7 +1664,8 @@ alloc_sd (__uid32_t uid, __gid32_t gid, int attribute,
   group_deny &= ~(STANDARD_RIGHTS_READ | FILE_READ_ATTRIBUTES | FILE_READ_EA);
 
   /* Construct appropriate inherit attribute. */
-  DWORD inherit = (attribute & S_IFDIR) ? INHERIT_ALL : DONT_INHERIT;
+  DWORD inherit = (attribute & S_IFDIR) ? SUB_CONTAINERS_AND_OBJECTS_INHERIT
+                                       : NO_INHERITANCE;
 
   /* Set deny ACE for owner. */
   if (owner_deny
@@ -1692,7 +1693,7 @@ alloc_sd (__uid32_t uid, __gid32_t gid, 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, DONT_INHERIT))
+                                 well_known_null_sid, acl_len, NO_INHERITANCE))
     return NULL;
 
   /* Get owner and group from current security descriptor. */
index 36ae57705f2c68df5b580affad973f52c8f1f109..1edcc57fd124c4405019538a1986aaabb793ea1d 100644 (file)
@@ -9,9 +9,6 @@ Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
 #include <accctrl.h>
-#define DONT_INHERIT (0)
-#define INHERIT_ALL  (CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE)
-#define INHERIT_ONLY (INHERIT_ONLY_ACE|CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE)
 
 #define DEFAULT_UID DOMAIN_USER_RID_ADMIN
 #define DEFAULT_GID DOMAIN_ALIAS_RID_ADMINS
This page took 0.038195 seconds and 5 git commands to generate.