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 + + * sec_acl.cc (set_posix_access): Workaround owner/group SIDs being NULL. + 2015-04-15 Corinna Vinschen * 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)