From: Andreas Schneider Date: Tue, 22 Jun 2021 07:37:13 +0000 (+0200) Subject: s4:dsdsb: Check return code of cli_credentials_guess() X-Git-Tag: tevent-0.11.0~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=feaf0d1ab7128230181c071c8da9cd2cc67bd41c;p=thirdparty%2Fsamba.git s4:dsdsb: Check return code of cli_credentials_guess() Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/proxy.c b/source4/dsdb/samdb/ldb_modules/proxy.c index c3f12bae3a1..e3635340ceb 100644 --- a/source4/dsdb/samdb/ldb_modules/proxy.c +++ b/source4/dsdb/samdb/ldb_modules/proxy.c @@ -65,6 +65,7 @@ static int load_proxy_info(struct ldb_module *module) int ret; const char *olddn, *newdn, *url, *username, *password, *oldstr, *newstr; struct cli_credentials *creds; + bool ok; /* see if we have already loaded it */ if (proxy->upstream != NULL) { @@ -131,7 +132,12 @@ static int load_proxy_info(struct ldb_module *module) ldb_oom(ldb); goto failed; } - cli_credentials_guess(creds, ldb_get_opaque(ldb, "loadparm")); + ok = cli_credentials_guess(creds, ldb_get_opaque(ldb, "loadparm")); + if (!ok) { + ldb_oom(ldb); + goto failed; + } + cli_credentials_set_username(creds, username, CRED_SPECIFIED); cli_credentials_set_password(creds, password, CRED_SPECIFIED);