From: Volker Lendecke Date: Mon, 5 Aug 2024 15:29:46 +0000 (+0200) Subject: libsmb: Avoid an "else", we return in the "true" branch X-Git-Tag: tdb-1.4.13~1372 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=565f20d281d7f304727cc364bcec6c5877dbef65;p=thirdparty%2Fsamba.git libsmb: Avoid an "else", we return in the "true" branch Reduce indentation Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider --- diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c index c3ab30849ab..998b7cfd9a5 100644 --- a/source3/libsmb/passchange.c +++ b/source3/libsmb/passchange.c @@ -310,23 +310,27 @@ NTSTATUS remote_password_change(const char *remote_machine, } cli_shutdown(cli); return NT_STATUS_UNSUCCESSFUL; - } else { - /* Use the old RAP method. */ - if (cli_oem_change_password(cli, user_name, new_passwd, old_passwd)) { - /* SAMR failed, but the old LanMan protocol worked! */ + } - cli_shutdown(cli); - return NT_STATUS_OK; - } + /* Use the old RAP method. */ + if (cli_oem_change_password( + cli, user_name, new_passwd, old_passwd)) { + /* SAMR failed, but the old LanMan protocol worked! */ - result = cli_nt_error(cli); - if (asprintf(err_str, "machine %s rejected the password " - "change: Error was : %s.\n", - remote_machine, nt_errstr(result)) == -1) { - *err_str = NULL; - } cli_shutdown(cli); - return result; + return NT_STATUS_OK; } + + result = cli_nt_error(cli); + if (asprintf(err_str, + "machine %s rejected the password " + "change: Error was : %s.\n", + remote_machine, + nt_errstr(result)) == -1) + { + *err_str = NULL; + } + cli_shutdown(cli); + return result; } }