Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-04-16 19:29:16 +0300
committerCorinna Vinschen <corinna@vinschen.de>2015-04-16 19:29:16 +0300
commitde67909ac180f15531e1a1bf4b5c54f17caae5d5 (patch)
tree634bfe284ee7755dbf15ff9ef6f155a3138f16dd /winsup
parentbaacff7c79d9837d59e1b1c2060eea054e534e5c (diff)
Workaround owner/group SIDs being NULL
* sec_acl.cc (set_posix_access): Workaround owner/group SIDs being NULL. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/sec_acl.cc7
2 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 9adade060..f645031a0 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2015-04-16 Corinna Vinschen <corinna@vinschen.de>
+
+ * sec_acl.cc (set_posix_access): Workaround owner/group SIDs being NULL.
+
2015-04-15 Corinna Vinschen <corinna@vinschen.de>
* sec_acl.cc (set_posix_access): Handle files with owner == group.
diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc
index a8ffbf038..6c96977b7 100644
--- a/winsup/cygwin/sec_acl.cc
+++ b/winsup/cygwin/sec_acl.cc
@@ -141,7 +141,7 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid,
mode_t class_obj = 0, other_obj, group_obj, deny;
DWORD access;
int idx, start_idx, class_idx, tmp_idx;
- bool owner_eq_group;
+ bool owner_eq_group = false;
bool dev_saw_admins = false;
/* Initialize local security descriptor. */
@@ -166,7 +166,10 @@ set_posix_access (mode_t attr, uid_t uid, gid_t gid,
__seterrno_from_nt_status (status);
return NULL;
}
- owner_eq_group = RtlEqualSid (owner, group);
+ /* If the account DBs are broken, we might end up without SIDs. Better
+ check them here. */
+ if (owner && group)
+ owner_eq_group = RtlEqualSid (owner, group);
/* No POSIX ACL? Use attr to generate one from scratch. */
if (!aclbufp)