]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
passdb: Introduce helper variables in make_pdb_method_name()
authorVolker Lendecke <vl@samba.org>
Sat, 9 Apr 2022 06:59:43 +0000 (08:59 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 26 Apr 2022 21:41:29 +0000 (21:41 +0000)
Easier debugging

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/passdb/pdb_interface.c

index 008c48cc5d0ef1693c76fd31d35968089e9e62b1..118a5d769265bc7934b48eb1e3ed7c51965bcb38 100644 (file)
@@ -199,20 +199,22 @@ NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected
 static struct pdb_methods *pdb_get_methods_reload( bool reload ) 
 {
        static struct pdb_methods *pdb = NULL;
+       const char *backend = lp_passdb_backend();
+       NTSTATUS status = NT_STATUS_OK;
 
        if ( pdb && reload ) {
                if (pdb->free_private_data != NULL) {
                        pdb->free_private_data( &(pdb->private_data) );
                }
-               if ( !NT_STATUS_IS_OK( make_pdb_method_name( &pdb, lp_passdb_backend() ) ) ) {
-                       return NULL;
-               }
+               status = make_pdb_method_name(&pdb, backend);
        }
 
        if ( !pdb ) {
-               if ( !NT_STATUS_IS_OK( make_pdb_method_name( &pdb, lp_passdb_backend() ) ) ) {
-                       return NULL;
-               }
+               status = make_pdb_method_name(&pdb, backend);
+       }
+
+       if (!NT_STATUS_IS_OK(status)) {
+               return NULL;
        }
 
        return pdb;