diff options
Diffstat (limited to 'source4/scripting/python')
-rw-r--r-- | source4/scripting/python/samba/provision.py | 3 | ||||
-rw-r--r-- | source4/scripting/python/samba/samdb.py | 27 | ||||
-rw-r--r-- | source4/scripting/python/samba/tests/dcerpc/rpcecho.py | 2 |
3 files changed, 17 insertions, 15 deletions
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index 0aa84ec6db..d96857661e 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -1136,7 +1136,8 @@ def provision(setup_dir, message, session_info, message("NetBIOS Domain: %s" % names.domain) message("DNS Domain: %s" % names.dnsdomain) message("DOMAIN SID: %s" % str(domainsid)) - message("Admin password: %s" % adminpass) + if samdb_fill == FILL_FULL: + message("Admin password: %s" % adminpass) result = ProvisionResult() result.domaindn = domaindn diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py index 614970d3ec..b92a91e2ef 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) @@ -229,13 +230,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: diff --git a/source4/scripting/python/samba/tests/dcerpc/rpcecho.py b/source4/scripting/python/samba/tests/dcerpc/rpcecho.py index 12638e2397..62268005c2 100644 --- a/source4/scripting/python/samba/tests/dcerpc/rpcecho.py +++ b/source4/scripting/python/samba/tests/dcerpc/rpcecho.py @@ -49,7 +49,7 @@ class RpcEchoTests(RpcInterfaceTestCase): surrounding_struct.x = 4 surrounding_struct.surrounding = [1,2,3,4] y = self.conn.TestSurrounding(surrounding_struct) - self.assertEquals(8 * [0], y.surrounding) + self.assertEquals(4 * [0], y.surrounding) def test_manual_request(self): self.assertEquals("\x01\x00\x00\x00", self.conn.request(0, chr(0) * 4)) |