When dropping privileges, gpupdate errored:
gpclass.py:1167: KeyError: "getpwnam(): name not found: <HOSTNAME>
apply_gp was incorrectly passing the hostname
instead of the username.
Signed-off-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun 10 10:46:28 UTC 2023 on atb-devel-224
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))