mirror of
https://github.com/samba-team/samba.git
synced 2025-02-15 05:57:49 +03:00
s3:passdb: handle dom_sid=NULL in create_builtin_{users,administrators}()
We should not crash if we're called with NULL. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13328 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit efdc617c76d9043286e33b961f45ad4564232102)
This commit is contained in:
parent
253f0d1841
commit
03b4684e9a
@ -130,8 +130,9 @@ NTSTATUS create_builtin_users(const struct dom_sid *dom_sid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* add domain users */
|
/* add domain users */
|
||||||
if ((IS_DC || (lp_server_role() == ROLE_DOMAIN_MEMBER))
|
if ((IS_DC || (lp_server_role() == ROLE_DOMAIN_MEMBER)) &&
|
||||||
&& sid_compose(&dom_users, dom_sid, DOMAIN_RID_USERS))
|
(dom_sid != NULL) &&
|
||||||
|
sid_compose(&dom_users, dom_sid, DOMAIN_RID_USERS))
|
||||||
{
|
{
|
||||||
status = add_sid_to_builtin(&global_sid_Builtin_Users,
|
status = add_sid_to_builtin(&global_sid_Builtin_Users,
|
||||||
&dom_users);
|
&dom_users);
|
||||||
@ -159,8 +160,9 @@ NTSTATUS create_builtin_administrators(const struct dom_sid *dom_sid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* add domain admins */
|
/* add domain admins */
|
||||||
if ((IS_DC || (lp_server_role() == ROLE_DOMAIN_MEMBER))
|
if ((IS_DC || (lp_server_role() == ROLE_DOMAIN_MEMBER)) &&
|
||||||
&& sid_compose(&dom_admins, dom_sid, DOMAIN_RID_ADMINS))
|
(dom_sid != NULL) &&
|
||||||
|
sid_compose(&dom_admins, dom_sid, DOMAIN_RID_ADMINS))
|
||||||
{
|
{
|
||||||
status = add_sid_to_builtin(&global_sid_Builtin_Administrators,
|
status = add_sid_to_builtin(&global_sid_Builtin_Administrators,
|
||||||
&dom_admins);
|
&dom_admins);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user