summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-11-07 17:57:52 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-11-07 19:35:05 +0100
commitce8b5d520bafe10fb048f5c61197c840263decb6 (patch)
tree1636f4cd40f3961de122905f10c794fc538d840e
parent1d9ff23f8ea22d0a9b5efc4ed2565bfc0dc6d92e (diff)
downloadsamba-ce8b5d520bafe10fb048f5c61197c840263decb6.tar.gz
samba-ce8b5d520bafe10fb048f5c61197c840263decb6.tar.bz2
samba-ce8b5d520bafe10fb048f5c61197c840263decb6.zip
s4:samba-tool - fix Gémes Géza patch regarding parameter handling
The new "random-password" parameter has not been evaluated correctly. Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Mon Nov 7 19:35:05 CET 2011 on sn-devel-104
-rw-r--r--source4/scripting/python/samba/netcmd/user.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py
index 78e09fd324..0ac4b23742 100644
--- a/source4/scripting/python/samba/netcmd/user.py
+++ b/source4/scripting/python/samba/netcmd/user.py
@@ -100,13 +100,13 @@ Example3 shows how to create a new user in the OrgUnit organizational unit.
takes_args = ["username", "password?"]
def run(self, username, password=None, credopts=None, sambaopts=None,
- versionopts=None, H=None, must_change_at_next_login=None, random_password=False,
+ versionopts=None, H=None, must_change_at_next_login=None, random_password=None,
use_username_as_cn=None, userou=None, surname=None, given_name=None, initials=None,
profile_path=None, script_path=None, home_drive=None, home_directory=None,
job_title=None, department=None, company=None, description=None,
mail_address=None, internet_address=None, telephone_number=None, physical_delivery_office=None):
- if random_password is not False:
+ if random_password is True:
password = generate_random_password(128, 255)
while 1:
@@ -397,14 +397,15 @@ Example3 shows how an administrator would reset TestUser3 user's password to pas
def run(self, username=None, filter=None, credopts=None, sambaopts=None,
versionopts=None, H=None, newpassword=None,
- must_change_at_next_login=None, random_password=False):
+ must_change_at_next_login=None, random_password=None):
if filter is None and username is None:
raise CommandError("Either the username or '--filter' must be specified!")
- if random_password is not False:
+ if random_password is True:
password = generate_random_password(128, 255)
else:
password = newpassword
+
while 1:
if password is not None and password is not '':
break