]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Avoid an "else", we return in the "true" branch
authorVolker Lendecke <vl@samba.org>
Mon, 5 Aug 2024 15:29:46 +0000 (17:29 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 20 Aug 2024 09:34:39 +0000 (09:34 +0000)
Reduce indentation

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libsmb/passchange.c

index c3ab30849ab8634956f553eb378cf61fb456dc6a..998b7cfd9a5d73ab11a90b073173f0e0100c95a1 100644 (file)
@@ -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;
        }
 }