From 427805b87a0781a4b39594f4efdf4b9d023d2324 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Jul 2011 15:14:03 +1000 Subject: samba-tool: ensure prompting of passwords is in the right order 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 Pair-Programmed-With: Andrew Bartlett Autobuild-User: Andrew Tridgell Autobuild-Date: Thu Jul 28 08:35:45 CEST 2011 on sn-devel-104 --- source4/scripting/python/samba/netcmd/user.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/scripting/python/samba/netcmd/user.py b/source4/scripting/python/samba/netcmd/user.py index b13bc0d606..96a198a523 100644 --- a/source4/scripting/python/samba/netcmd/user.py +++ b/source4/scripting/python/samba/netcmd/user.py @@ -209,7 +209,9 @@ class cmd_user_password(Command): 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 -- cgit