From: David Mulder Date: Wed, 7 Jun 2023 14:29:31 +0000 (-0600) Subject: gp: Fix user apply failure when droping privs X-Git-Tag: talloc-2.4.1~465 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e40c86e970e3e8e76d16d12dcdb334b347d7b438;p=thirdparty%2Fsamba.git gp: Fix user apply failure when droping privs When dropping privileges, gpupdate errored: gpclass.py:1167: KeyError: "getpwnam(): name not found: apply_gp was incorrectly passing the hostname instead of the username. Signed-off-by: David Mulder Reviewed-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Sat Jun 10 10:46:28 UTC 2023 on atb-devel-224 --- diff --git a/python/samba/gp/gpclass.py b/python/samba/gp/gpclass.py index 6083a0f8029..11275f3f117 100644 --- a/python/samba/gp/gpclass.py +++ b/python/samba/gp/gpclass.py @@ -982,7 +982,7 @@ def apply_gp(lp, creds, store, gp_extensions, username, target, force=False): if target == 'Computer': ext.process_group_policy(del_gpos, changed_gpos) else: - drop_privileges(creds.get_principal(), ext.process_group_policy, + drop_privileges(username, ext.process_group_policy, del_gpos, changed_gpos) except Exception as e: log.error('Failed to apply extension %s' % str(ext))