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)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 10 Dec 2023 21:24:38 +0000 (21:24 +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>
auth/credentials/credentials.c
selftest/knownfail.d/creds [deleted file]

index ab5efd90f26646c0abfff42829a7d5f38d89ffbb..b9da77c6b84f94e3a1b17f7ba90431d819be8bf2 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