1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

token_util.c: prefer capabilities over become_root

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
This commit is contained in:
Björn Jacke 2022-06-17 07:22:57 +02:00 committed by Bjoern Jacke
parent c1e2fbb1b9
commit 944cb51506

View File

@ -699,7 +699,7 @@ NTSTATUS finalize_local_nt_token(struct security_token *result,
/* Add in BUILTIN sids */
become_root();
set_effective_capability(DAC_OVERRIDE_CAPABILITY);
ok = secrets_fetch_domain_sid(lp_workgroup(), &_dom_sid);
if (ok) {
domain_sid = &_dom_sid;
@ -707,7 +707,7 @@ NTSTATUS finalize_local_nt_token(struct security_token *result,
DEBUG(3, ("Failed to fetch domain sid for %s\n",
lp_workgroup()));
}
unbecome_root();
drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
info = talloc_zero(talloc_tos(), struct acct_info);
if (info == NULL) {