diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-09-18 20:22:03 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-09-18 20:27:30 +0200 |
commit | 1f38aa0995f7ffa82f670fe5d36046dd6b8f44ac (patch) | |
tree | 0aa9f9120bd718a9238a311e43bf7dbeaf3953ce /source4/setup/setpassword | |
parent | bc2a05f0010f5dece89fda13fd525a1a7ca536a0 (diff) | |
download | samba-1f38aa0995f7ffa82f670fe5d36046dd6b8f44ac.tar.gz samba-1f38aa0995f7ffa82f670fe5d36046dd6b8f44ac.tar.bz2 samba-1f38aa0995f7ffa82f670fe5d36046dd6b8f44ac.zip |
s4:various scripts under "setup" - Unification
- This unified the shape of those four scripts (comments, command sequence, call
of SamDB)
- To consider the samdb.py changes regarding the filter: there is now always the
possibility either to specify the username or the search filter
Diffstat (limited to 'source4/setup/setpassword')
-rwxr-xr-x | source4/setup/setpassword | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/source4/setup/setpassword b/source4/setup/setpassword index 513730d649..5fbba03c2b 100755 --- a/source4/setup/setpassword +++ b/source4/setup/setpassword @@ -20,15 +20,13 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -import os, sys +import 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 samba.auth import system_session from samba.samdb import SamDB @@ -45,13 +43,6 @@ parser.add_option("--must-change-at-next-login", help="Force password to be chan opts, args = parser.parse_args() -# -# print a message if quiet is not set -# -def message(text): - if not opts.quiet: - print text - filter = opts.filter if (len(args) == 0) and (filter is None): @@ -65,7 +56,7 @@ if password is None: if filter is None: username = args[0] - filter = "(&(objectclass=user)(samAccountName=%s))" % (username) + filter = "(&(objectClass=user)(sAMAccountName=%s))" % (username) lp = sambaopts.get_loadparm() creds = credopts.get_credentials(lp) |