summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-06-18 12:38:04 +1000
committerAndrew Bartlett <abartlet@samba.org>2009-06-18 13:49:30 +1000
commit1e6fb7d7306ee64ac649afe235e452ac116de394 (patch)
tree51e4668a33d4aff3fa3529ef477e210bd1d950f3 /source4/setup
parent033e25fdcea93763e1e8fe295fb6d2c3d261bcc4 (diff)
downloadsamba-1e6fb7d7306ee64ac649afe235e452ac116de394.tar.gz
samba-1e6fb7d7306ee64ac649afe235e452ac116de394.tar.bz2
samba-1e6fb7d7306ee64ac649afe235e452ac116de394.zip
s4: Add tests and 'must change password' flags in setpassword and newuser
In particular, ensure that we can acutally change the password under these circumstances. Andrew Bartlett
Diffstat (limited to 'source4/setup')
-rwxr-xr-xsource4/setup/newuser3
-rwxr-xr-xsource4/setup/setpassword2
2 files changed, 3 insertions, 2 deletions
diff --git a/source4/setup/newuser b/source4/setup/newuser
index 281e3849fa..cc89e922a7 100755
--- a/source4/setup/newuser
+++ b/source4/setup/newuser
@@ -36,6 +36,7 @@ credopts = options.CredentialsOptions(parser)
parser.add_option_group(credopts)
parser.add_option("--quiet", help="Be quiet", action="store_true")
parser.add_option("--unixname", help="Unix Username", 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()
@@ -57,4 +58,4 @@ creds = credopts.get_credentials(lp)
samdb = sambaopts.get_hostconfig().get_samdb(session_info=system_session(),
credentials=creds)
-samdb.newuser(username, opts.unixname, password)
+samdb.newuser(username, opts.unixname, password, force_password_change_at_next_login=opts.must_change_at_next_login)
diff --git a/source4/setup/setpassword b/source4/setup/setpassword
index d44f143e63..77d97d8918 100755
--- a/source4/setup/setpassword
+++ b/source4/setup/setpassword
@@ -75,5 +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, must_change_at_next_login=opts.must_change_at_next_login)
+samdb.setpassword(filter, password, force_password_change_at_next_login=opts.must_change_at_next_login)