summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-08-13 23:04:34 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-08-14 00:14:15 +0200
commit639c9ccb93e2766d865c769fa8c53a7c3d5f307c (patch)
tree3acbdcf58e5a7b78d1361b3493e8f9265087bf80 /source4/setup
parent44dfb2902e338924736447236989c6ed231f411b (diff)
downloadsamba-639c9ccb93e2766d865c769fa8c53a7c3d5f307c.tar.gz
samba-639c9ccb93e2766d865c769fa8c53a7c3d5f307c.tar.bz2
samba-639c9ccb93e2766d865c769fa8c53a7c3d5f307c.zip
s4: Correct the parameter logic of the "setpassword" script
Either the username or the filter are allowed. If both are given the filter is going to be used due to a higher precedence.
Diffstat (limited to 'source4/setup')
-rwxr-xr-xsource4/setup/setpassword11
1 files changed, 4 insertions, 7 deletions
diff --git a/source4/setup/setpassword b/source4/setup/setpassword
index 3505adfa7e..513730d649 100755
--- a/source4/setup/setpassword
+++ b/source4/setup/setpassword
@@ -52,7 +52,10 @@ def message(text):
if not opts.quiet:
print text
-if len(args) == 0:
+filter = opts.filter
+
+if (len(args) == 0) and (filter is None):
+ print "Either the username or '--filter' must be specified!"
parser.print_usage()
sys.exit(1)
@@ -60,16 +63,10 @@ password = opts.newpassword;
if password is None:
password = getpass("New Password: ")
-filter = opts.filter
-
if filter is None:
username = args[0]
- if username is None:
- print "Either username or --filter must be specified"
-
filter = "(&(objectclass=user)(samAccountName=%s))" % (username)
-
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)