]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth:creds: Fix cli_credentials_get_password_and_obtained() with callback
authorAndreas Schneider <asn@samba.org>
Wed, 6 Dec 2023 12:06:42 +0000 (13:06 +0100)
committerJule Anger <janger@samba.org>
Tue, 12 Dec 2023 09:02:18 +0000 (09:02 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15532

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 1041dae03f0f7e9e2b6b4a649eb1d298a34ce699)

auth/credentials/credentials.c
selftest/knownfail.d/creds [deleted file]

index 0485cc4e64e51d932eb395f0541c9f56afffd2ea..8cabdd8d1c3fe5beab1eb273195c41619db5a9e8 100644 (file)
@@ -465,11 +465,13 @@ _PUBLIC_ const char *
 cli_credentials_get_password_and_obtained(struct cli_credentials *cred,
                                          enum credentials_obtained *obtained)
 {
+       const char *password = cli_credentials_get_password(cred);
+
        if (obtained != NULL) {
                *obtained = cred->password_obtained;
        }
 
-       return cli_credentials_get_password(cred);
+       return password;
 }
 
 /* Set a password on the credentials context, including an indication
diff --git a/selftest/knownfail.d/creds b/selftest/knownfail.d/creds
deleted file mode 100644 (file)
index 09491f2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba.unittests.credentials.torture_creds_password_callback.none