1
0
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:
Giampaolo Lauria
2011-10-21 12:05:07 -04:00
committed by Jelmer Vernooij
parent 967ac70a35
commit 16437edf48
2 changed files with 12 additions and 6 deletions

View File

@ -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)