diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-05-23 16:24:07 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-05-23 16:24:07 +0200 |
commit | cceac63aaab26a72e2f3fd150dd1e4e83a0e5279 (patch) | |
tree | 6203cca724fc5f17f068e3fd4d0b403fdff3f8f9 /source4/setup/setpassword | |
parent | 7c7880695b02df4cbe0faab959846c63d0cc0536 (diff) | |
parent | 72fce654072b2d7317ff21c95558bd365701d5dd (diff) | |
download | samba-cceac63aaab26a72e2f3fd150dd1e4e83a0e5279.tar.gz samba-cceac63aaab26a72e2f3fd150dd1e4e83a0e5279.tar.bz2 samba-cceac63aaab26a72e2f3fd150dd1e4e83a0e5279.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-wsgi
Conflicts:
source/scripting/python/samba/provision.py
(This used to be commit d27de633656f8a699222df77c4c58326890889a2)
Diffstat (limited to 'source4/setup/setpassword')
-rw-r--r-- | source4/setup/setpassword | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source4/setup/setpassword b/source4/setup/setpassword index 31b2f73a25..65770e1f4d 100644 --- a/source4/setup/setpassword +++ b/source4/setup/setpassword @@ -6,12 +6,17 @@ # Released under the GNU GPL version 3 or later # +import os, sys + +# Find right directory when running from source tree +sys.path.insert(0, "bin/python") + import samba.getopt as options import optparse import pwd import sys from getpass import getpass -from auth import system_session +from samba.auth import system_session from samba.samdb import SamDB parser = optparse.OptionParser("setpassword [username] [options]") @@ -36,7 +41,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 +52,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) |