From 1041dae03f0f7e9e2b6b4a649eb1d298a34ce699 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 6 Dec 2023 13:06:42 +0100 Subject: [PATCH] auth:creds: Fix cli_credentials_get_password_and_obtained() with callback BUG: https://bugzilla.samba.org/show_bug.cgi?id=15532 Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- auth/credentials/credentials.c | 4 +++- selftest/knownfail.d/creds | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 selftest/knownfail.d/creds diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c index ab5efd90f26..b9da77c6b84 100644 --- a/auth/credentials/credentials.c +++ b/auth/credentials/credentials.c @@ -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 index 09491f22c65..00000000000 --- a/selftest/knownfail.d/creds +++ /dev/null @@ -1 +0,0 @@ -^samba.unittests.credentials.torture_creds_password_callback.none