summaryrefslogtreecommitdiff
path: root/source4/setup/setpassword
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/setup/setpassword
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/setup/setpassword')
-rw-r--r--source4/setup/setpassword8
1 files changed, 4 insertions, 4 deletions
diff --git a/source4/setup/setpassword b/source4/setup/setpassword
index 31b2f73a25..977a6a5ee8 100644
--- a/source4/setup/setpassword
+++ b/source4/setup/setpassword
@@ -36,7 +36,7 @@ if len(args) == 0:
parser.print_usage()
sys.exit(1)
-password = opts.password;
+password = opts.newpassword;
if password is None:
password = getpass("New Password: ")
@@ -47,12 +47,12 @@ if filter is None:
if username is None:
print "Either username or --filter must be specified"
- filter = "(&(objectclass=user)(samAccountName=" + username + "))"
+ filter = "(&(objectclass=user)(samAccountName=%s))" % (username)
-creds = credopts.get_credentials()
-
lp = sambaopts.get_loadparm()
+creds = credopts.get_credentials(lp)
+
samdb = SamDB(url=lp.get("sam database"), session_info=system_session(),
credentials=creds, lp=lp)
samdb.setpassword(filter, password)