samba-tool: ensure prompting of passwords is in the right order
authorAndrew Tridgell <tridge@samba.org>
Thu, 28 Jul 2011 05:14:03 +0000 (15:14 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 28 Jul 2011 06:35:45 +0000 (08:35 +0200)
ask the creds object for the password before prompting for the new
password in the user password change code, to ensure the user is asked
for the old password first

Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Jul 28 08:35:45 CEST 2011 on sn-devel-104

source4/scripting/python/samba/netcmd/user.py

index b13bc0d6066cb7aca879c0e600f64c1ac545c3a4..96a198a5235c77d468b41b582fce7b91226a5894 100644 (file)
@@ -209,7 +209,9 @@ class cmd_user_password(Command):
         lp = sambaopts.get_loadparm()
         creds = credopts.get_credentials(lp)
 
         lp = sambaopts.get_loadparm()
         creds = credopts.get_credentials(lp)
 
-        # FIXME: How to ensure user is authenticated before prompting for new password?
+        # get old password now, to get the password prompts in the right order
+        old_password = creds.get_password()
+
         net = Net(creds, lp, server=credopts.ipaddress)
 
         password = newpassword
         net = Net(creds, lp, server=credopts.ipaddress)
 
         password = newpassword