summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-05-09 10:54:19 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-05-09 19:14:46 +0200
commitcde9ec4af673a658777596f56dcba055458a4b35 (patch)
treee1ef202c956b084da0956e6adbb9fb533e435f9a
parent544dc4465c5ade3c5ed8417ddd5f09d4af0c2b31 (diff)
downloadsamba-cde9ec4af673a658777596f56dcba055458a4b35.tar.gz
samba-cde9ec4af673a658777596f56dcba055458a4b35.tar.bz2
samba-cde9ec4af673a658777596f56dcba055458a4b35.zip
s4:samdb python bindings - remove idmap creation stuff from this call
The id mapping should now be handled automatically by the s4 daemon.
-rw-r--r--source4/scripting/python/samba/samdb.py23
1 files changed, 1 insertions, 22 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index dd3824db0c..991c678c7c 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -109,15 +109,11 @@ pwdLastSet: 0
""" % (user_dn)
self.modify_ldif(mod)
- def newuser(self, username, unixname, password,
+ def newuser(self, username, password,
force_password_change_at_next_login_req=False):
"""Adds a new user
- Note: This call adds also the ID mapping for winbind; therefore it works
- *only* on SAMBA 4.
-
:param username: Name of the new user
- :param unixname: Name of the unix user to map to
:param password: Password for the new user
:param force_password_change_at_next_login_req: Force password change
"""
@@ -135,23 +131,6 @@ pwdLastSet: 0
self.setpassword("(dn=" + user_dn + ")", password,
force_password_change_at_next_login_req)
- # Gets the user SID (for the account mapping setup)
- res = self.search(user_dn, scope=ldb.SCOPE_BASE,
- expression="objectclass=*",
- attrs=["objectSid"])
- assert len(res) == 1
- user_sid = self.schema_format_value("objectSid", res[0]["objectSid"][0])
-
- try:
- idmap = IDmapDB(lp=self.lp)
-
- user = pwd.getpwnam(unixname)
-
- # setup ID mapping for this UID
- idmap.setup_name_mapping(user_sid, idmap.TYPE_UID, user[2])
-
- except KeyError:
- pass
except:
self.transaction_cancel()
raise