diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-06-17 09:14:17 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-06-18 13:49:30 +1000 |
commit | 2afc6df9b49a246129acdd7c8c24448c8cf3b6ef (patch) | |
tree | 2b570668e29057987d12c040ccd496e61c66a9ad /source4/setup | |
parent | 0ac46b00abf045c6dcd48ed9a96f948fc8416138 (diff) | |
download | samba-2afc6df9b49a246129acdd7c8c24448c8cf3b6ef.tar.gz samba-2afc6df9b49a246129acdd7c8c24448c8cf3b6ef.tar.bz2 samba-2afc6df9b49a246129acdd7c8c24448c8cf3b6ef.zip |
s4:setup Add an option to 'setpassword' to force password change at next login
Diffstat (limited to 'source4/setup')
-rwxr-xr-x | source4/setup/setpassword | 4 | ||||
-rwxr-xr-x | source4/setup/tests/blackbox_setpassword.sh | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/source4/setup/setpassword b/source4/setup/setpassword index 90a217fb6f..d44f143e63 100755 --- a/source4/setup/setpassword +++ b/source4/setup/setpassword @@ -41,6 +41,7 @@ credopts = options.CredentialsOptions(parser) parser.add_option_group(credopts) parser.add_option("--filter", help="LDAP Filter to set password on", type=str) parser.add_option("--newpassword", help="Set password", type=str) +parser.add_option("--must-change-at-next-login", help="Force password to be changed on next login", action="store_true") opts, args = parser.parse_args() @@ -74,4 +75,5 @@ creds = credopts.get_credentials(lp) samdb = SamDB(url=lp.get("sam database"), session_info=system_session(), credentials=creds, lp=lp) -samdb.setpassword(filter, password) +samdb.setpassword(filter, password, must_change_at_next_login=opts.must_change_at_next_login) + diff --git a/source4/setup/tests/blackbox_setpassword.sh b/source4/setup/tests/blackbox_setpassword.sh index 89f1aa5858..70061f6ae7 100755 --- a/source4/setup/tests/blackbox_setpassword.sh +++ b/source4/setup/tests/blackbox_setpassword.sh @@ -18,4 +18,6 @@ testit "newuser" $PYTHON ./setup/newuser --configfile=$PREFIX/simple-dc/etc/smb. testit "setpassword" $PYTHON ./setup/setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testpass +testit "setpassword" $PYTHON ./setup/setpassword --configfile=$PREFIX/simple-dc/etc/smb.conf testuser --newpassword=testpass --must-change-at-next-login + exit $failed |