mirror of
https://github.com/samba-team/samba.git
synced 2025-07-27 07:42:04 +03:00
samba-tool: Improve "delegation" command error handling
Change samdb toggle_userAccountFlags fcn to display more meaningful error messages Add flags string param to toggle_userAccountFlags Change call to toggle_userAccountFlags in delegation command to pass the flag name to be displayed in case of errors
This commit is contained in:
committed by
Jelmer Vernooij
parent
967ac70a35
commit
16437edf48
@ -104,7 +104,9 @@ class cmd_delegation_for_any_service(Command):
|
||||
search_filter = "sAMAccountName=%s" % ldb.binary_encode(cleanedaccount)
|
||||
flag = dsdb.UF_TRUSTED_FOR_DELEGATION
|
||||
try:
|
||||
sam.toggle_userAccountFlags(search_filter, flag, on=on, strict=True)
|
||||
sam.toggle_userAccountFlags(search_filter, flag,
|
||||
flags_str="Trusted-for-Delegation",
|
||||
on=on, strict=True)
|
||||
except Exception, err:
|
||||
raise CommandError(err)
|
||||
|
||||
@ -138,7 +140,9 @@ class cmd_delegation_for_any_protocol(Command):
|
||||
search_filter = "sAMAccountName=%s" % ldb.binary_encode(cleanedaccount)
|
||||
flag = dsdb.UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION
|
||||
try:
|
||||
sam.toggle_userAccountFlags(search_filter, flag, on=on, strict=True)
|
||||
sam.toggle_userAccountFlags(search_filter, flag,
|
||||
flags_str="Trusted-to-Authenticate-for-Delegation",
|
||||
on=on, strict=True)
|
||||
except Exception, err:
|
||||
raise CommandError(err)
|
||||
|
||||
|
Reference in New Issue
Block a user