samba-tool user: Consistently return a tuple
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Sun, 10 Apr 2022 23:50:53 +0000 (11:50 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 5 May 2022 00:27:33 +0000 (00:27 +0000)
We would get an error when get_userPassword_hash() returned None, as
get_virtual_crypt_value() would try to unpack the result as a 2-element
tuple.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/user.py

index 7956d1298610ed0574606672b9f76183cb075237..70be85c406a3d8d5bead91209d8fa8c13c75c090 100644 (file)
@@ -1478,7 +1478,7 @@ class GetPasswordCommand(Command):
             # the user password hashes. This indicates that password has been
             # changed without updating the supplemental credentials.
             if unicodePwd != bytearray(up.current_nt_hash.hash):
-                return None
+                return None, None
 
             scheme_prefix = "$%d$" % algorithm
             prefix = scheme_prefix