mirror of
https://github.com/samba-team/samba.git
synced 2025-02-22 05:57:43 +03:00
auth: Make sure error_string is not used uninitialized
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue May 19 13:42:32 CEST 2015 on sn-devel-104
This commit is contained in:
parent
175ae9668c
commit
ffacfc1148
@ -270,7 +270,7 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account_db_ctx(struct cli_credenti
|
||||
{
|
||||
NTSTATUS status;
|
||||
char *filter;
|
||||
char *error_string;
|
||||
char *error_string = NULL;
|
||||
const char *domain;
|
||||
bool secrets_tdb_password_more_recent;
|
||||
time_t secrets_tdb_lct = 0;
|
||||
@ -372,7 +372,8 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account_db_ctx(struct cli_credenti
|
||||
= talloc_asprintf(cred,
|
||||
"Failed to fetch machine account password for %s from both "
|
||||
"secrets.ldb (%s) and from %s",
|
||||
domain, error_string,
|
||||
domain,
|
||||
error_string == NULL ? "error" : error_string,
|
||||
dbwrap_name(db_ctx));
|
||||
} else {
|
||||
char *secrets_tdb_path;
|
||||
@ -387,10 +388,12 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account_db_ctx(struct cli_credenti
|
||||
error_string = talloc_asprintf(cred,
|
||||
"Failed to fetch machine account password from "
|
||||
"secrets.ldb: %s and failed to open %s",
|
||||
error_string, secrets_tdb_path);
|
||||
error_string == NULL ? "error" : error_string,
|
||||
secrets_tdb_path);
|
||||
}
|
||||
DEBUG(1, ("Could not find machine account in secrets database: %s: %s\n",
|
||||
error_string, nt_errstr(status)));
|
||||
DEBUG(1, ("Could not find machine account in secrets database: %s: %s\n",
|
||||
error_string == NULL ? "error" : error_string,
|
||||
nt_errstr(status)));
|
||||
/* set anonymous as the fallback, if the machine account won't work */
|
||||
cli_credentials_set_anonymous(cred);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user