summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-03-20 13:22:08 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-03-20 13:22:08 +1100
commit27c6eca04c4c1bb40ff36f3a08748e2f45770aa8 (patch)
treef87d3e6ca4958e9b9102ca8ee5fb3e5f0917570e /source4/scripting/python
parent1f25b71d199a072f5ee1bdd8786e5c1c157f5888 (diff)
parent5fe2b28f45289dc5578cdd536600f0d30a14d820 (diff)
downloadsamba-27c6eca04c4c1bb40ff36f3a08748e2f45770aa8.tar.gz
samba-27c6eca04c4c1bb40ff36f3a08748e2f45770aa8.tar.bz2
samba-27c6eca04c4c1bb40ff36f3a08748e2f45770aa8.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into wspp-schema
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/samdb.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index 881f5912fb..17b5450a3e 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -28,6 +28,7 @@ import ldb
from samba.idmap import IDmapDB
import pwd
import time
+import base64
__docformat__ = "restructuredText"
@@ -59,7 +60,7 @@ dn: CN=%s,CN=ForeignSecurityPrincipals,%s
objectClass: top
objectClass: foreignSecurityPrincipal
description: %s
- """ % (sid, domaindn, desc)
+""" % (sid, domaindn, desc)
# deliberately ignore errors from this, as the records may
# already exist
for msg in self.parse_ldif(add):
@@ -175,11 +176,11 @@ userAccountControl: %u
user_dn = res[0].dn
setpw = """
- dn: %s
- changetype: modify
- replace: userPassword
- userPassword: %s
- """ % (user_dn, password)
+dn: %s
+changetype: modify
+replace: userPassword
+userPassword:: %s
+""" % (user_dn, base64.b64encode(password))
self.modify_ldif(setpw)
@@ -232,13 +233,13 @@ userAccountControl: %u
accountExpires = glue.unix2nttime(expiry_seconds + int(time.time()))
mod = """
- dn: %s
- changetype: modify
- replace: userAccountControl
- userAccountControl: %u
- replace: accountExpires
- accountExpires: %u
- """ % (res[0].dn, userAccountControl, accountExpires)
+dn: %s
+changetype: modify
+replace: userAccountControl
+userAccountControl: %u
+replace: accountExpires
+accountExpires: %u
+""" % (res[0].dn, userAccountControl, accountExpires)
# now change the database
self.modify_ldif(mod)
except: