summaryrefslogtreecommitdiff
path: root/source4/scripting/python/samba/idmap.py
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-04-14 11:51:02 +0200
committerAndrew Bartlett <abartlet@samba.org>2008-04-14 11:51:02 +0200
commit5a37b3fc5d42beffaf4bdca70b1f0c5f80f92280 (patch)
treed842d75c14dca09ee5818ac6a36aa2d3189029a4 /source4/scripting/python/samba/idmap.py
parent434e625e45a03889596999eb4301bb54128c31a9 (diff)
downloadsamba-5a37b3fc5d42beffaf4bdca70b1f0c5f80f92280.tar.gz
samba-5a37b3fc5d42beffaf4bdca70b1f0c5f80f92280.tar.bz2
samba-5a37b3fc5d42beffaf4bdca70b1f0c5f80f92280.zip
Fix newuser and setpassword scripts, and port to idmap.
The new idmap world does not use the unixUser any more, so we need to set up the entry (if wanted) in the idmap database. Users without a backing unix user will get an allocated uid by idmap later. Andrew Bartlett (This used to be commit 8bd8bc1475ddf22d4702dcd17028a9043a5e629f)
Diffstat (limited to 'source4/scripting/python/samba/idmap.py')
-rw-r--r--source4/scripting/python/samba/idmap.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/idmap.py b/source4/scripting/python/samba/idmap.py
index 355565968a..16efcd0470 100644
--- a/source4/scripting/python/samba/idmap.py
+++ b/source4/scripting/python/samba/idmap.py
@@ -21,6 +21,7 @@
"""Convenience functions for using the idmap database."""
import samba
+import misc
import ldb
class IDmapDB(samba.Ldb):
@@ -37,11 +38,17 @@ class IDmapDB(samba.Ldb):
:param url: URL of the database.
"""
+ self.lp = lp
+
super(IDmapDB, self).__init__(session_info=session_info, credentials=credentials,
modules_dir=modules_dir, lp=lp)
if url:
self.connect(url)
+ else:
+ self.connect(lp.get("idmap database"))
+ def connect(self, url):
+ super(IDmapDB, self).connect(misc.private_path(self.lp, url))
def setup_name_mapping(self, sid, type, unixid):
"""Setup a mapping between a sam name and a unix name.