summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/netcmd/delegation.py
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/python/samba/netcmd/delegation.py')
-rw-r--r--source4/scripting/python/samba/netcmd/delegation.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/source4/scripting/python/samba/netcmd/delegation.py b/source4/scripting/python/samba/netcmd/delegation.py
index 72966248790..25ae2028c4a 100644
--- a/source4/scripting/python/samba/netcmd/delegation.py
+++ b/source4/scripting/python/samba/netcmd/delegation.py
@@ -55,7 +55,7 @@ class cmd_delegation_show(Command):
# TODO once I understand how, use the domain info to naildown
# to the correct domain
(cleanedaccount, realm, domain) = _get_user_realm_domain(accountname)
-
+
res = sam.search(expression="sAMAccountName=%s" %
ldb.binary_encode(cleanedaccount),
scope=ldb.SCOPE_SUBTREE,
@@ -63,7 +63,7 @@ class cmd_delegation_show(Command):
if len(res) == 0:
raise CommandError("Unable to find account name '%s'" % accountname)
assert(len(res) == 1)
-
+
uac = int(res[0].get("userAccountControl")[0])
allowed = res[0].get("msDS-AllowedToDelegateTo")
@@ -91,7 +91,8 @@ class cmd_delegation_for_any_service(Command):
takes_args = ["accountname", "onoff"]
- def run(self, accountname, onoff, credopts=None, sambaopts=None, versionopts=None):
+ def run(self, accountname, onoff, credopts=None, sambaopts=None,
+ versionopts=None):
on = False
if onoff == "on":
@@ -133,7 +134,8 @@ class cmd_delegation_for_any_protocol(Command):
takes_args = ["accountname", "onoff"]
- def run(self, accountname, onoff, credopts=None, sambaopts=None, versionopts=None):
+ def run(self, accountname, onoff, credopts=None, sambaopts=None,
+ versionopts=None):
on = False
if onoff == "on":
@@ -175,7 +177,8 @@ class cmd_delegation_add_service(Command):
takes_args = ["accountname", "principal"]
- def run(self, accountname, principal, credopts=None, sambaopts=None, versionopts=None):
+ def run(self, accountname, principal, credopts=None, sambaopts=None,
+ versionopts=None):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
@@ -192,7 +195,7 @@ class cmd_delegation_add_service(Command):
attrs=["msDS-AllowedToDelegateTo"])
if len(res) == 0:
raise CommandError("Unable to find account name '%s'" % accountname)
- assert(len(res) == 1)
+ assert(len(res) == 1)
msg = ldb.Message()
msg.dn = res[0].dn
@@ -218,7 +221,8 @@ class cmd_delegation_del_service(Command):
takes_args = ["accountname", "principal"]
- def run(self, accountname, principal, credopts=None, sambaopts=None, versionopts=None):
+ def run(self, accountname, principal, credopts=None, sambaopts=None,
+ versionopts=None):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
@@ -235,7 +239,7 @@ class cmd_delegation_del_service(Command):
attrs=["msDS-AllowedToDelegateTo"])
if len(res) == 0:
raise CommandError("Unable to find account name '%s'" % accountname)
- assert(len(res) == 1)
+ assert(len(res) == 1)
msg = ldb.Message()
msg.dn = res[0].dn