mirror of
https://github.com/samba-team/samba.git
synced 2025-03-05 20:58:40 +03:00
samba-tool user getpassword: Clarify success wording
It may be the case that there was no password, or read access to the password was not permitted. The structure of the code and the pattern in LDIF that missing information is simply returned as missing attributes makes it hard to detect and communicate a clear error here, particularly as an error may not be wanted if (say) pwdLastSet is queried on a gMSA that we can not read. So we just make the string to indicate, as I think it was meant, that the tool ran to compleation. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Feb 29 05:07:45 UTC 2024 on atb-devel-224
This commit is contained in:
parent
00daa520ce
commit
0c1ac19776
@ -207,4 +207,4 @@ samba-tool user getpassword --filter=samaccountname=TestUser3 --attributes=msDS-
|
||||
|
||||
ldif = samdb.write_ldif(obj, ldb.CHANGETYPE_NONE)
|
||||
self.outf.write("%s" % ldif)
|
||||
self.errf.write("Got password OK\n")
|
||||
self.errf.write("Any available password returned OK\n")
|
||||
|
@ -346,7 +346,7 @@ class UserCmdTestCase(SambaToolCmdTest):
|
||||
"--attributes=%s" % attributes,
|
||||
"--decrypt-samba-gpg")
|
||||
self.assertCmdSuccess(result, out, err, "Ensure getpassword runs")
|
||||
self.assertEqual(err, "Got password OK\n", "getpassword without url")
|
||||
self.assertEqual(err, "Any available password returned OK\n", "getpassword without url")
|
||||
self.assertMatch(out, "sAMAccountName: %s" % (user["name"]),
|
||||
"getpassword: 'sAMAccountName': %s out[%s]" % (user["name"], out))
|
||||
if expect_nt_hash or "virtualSambaGPG:: " in out:
|
||||
|
@ -73,7 +73,7 @@ class UserCmdCryptShaTestCase(SambaToolCmdTest):
|
||||
out,
|
||||
err,
|
||||
"Ensure getpassword runs")
|
||||
self.assertEqual(err, "Got password OK\n", "getpassword")
|
||||
self.assertEqual(err, "Any available password returned OK\n", "getpassword")
|
||||
return out
|
||||
|
||||
# Change the just the NT password hash, as would happen if the password
|
||||
|
@ -79,7 +79,7 @@ class UserCmdCryptShaTestCase(SambaToolCmdTest):
|
||||
out,
|
||||
err,
|
||||
"Ensure getpassword runs")
|
||||
self.assertEqual(err, "Got password OK\n", "getpassword")
|
||||
self.assertEqual(err, "Any available password returned OK\n", "getpassword")
|
||||
return out
|
||||
|
||||
# Change the just the NT password hash, as would happen if the password
|
||||
|
@ -89,7 +89,7 @@ class UserCmdWdigestTestCase(SambaToolCmdTest):
|
||||
out,
|
||||
err,
|
||||
"Ensure getpassword runs")
|
||||
self.assertEqual(err, "Got password OK\n", "getpassword")
|
||||
self.assertEqual(err, "Any available password returned OK\n", "getpassword")
|
||||
|
||||
if missing:
|
||||
self.assertTrue(attribute not in out)
|
||||
|
Loading…
x
Reference in New Issue
Block a user