]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth3: A bit README.Coding in load_auth_module()
authorVolker Lendecke <vl@samba.org>
Wed, 1 Jul 2026 15:08:05 +0000 (17:08 +0200)
committerAnoop C S <anoopcs@samba.org>
Fri, 3 Jul 2026 04:47:29 +0000 (04:47 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/auth/auth.c

index 7d51731d96cdc1ccf3eb59cdd475dfd47437fef2..214fd0f45e74cb83b0c379886413bfa90a202e10 100644 (file)
@@ -421,11 +421,11 @@ static bool load_auth_module(
 {
        static bool initialised_static_modules = False;
 
-       struct auth_init_function_entry *entry;
+       struct auth_init_function_entry *entry = NULL;
        char module_name[strlen(module) + 1];
        char *module_params = NULL;
-       char *p;
-       bool good = False;
+       char *p = NULL;
+       NTSTATUS status;
 
        /* Initialise static modules if not done so yet */
        if(!initialised_static_modules) {
@@ -459,15 +459,16 @@ static bool load_auth_module(
                return false;
        }
 
-       if (!NT_STATUS_IS_OK(entry->init(auth_context, module_params, ret))) {
-               DBG_ERR("auth method %s did not correctly init\n",
-                       module_name);
-       } else {
-               DBG_INFO("auth method %s has a valid init\n", module_name);
-               good = True;
+       status = entry->init(auth_context, module_params, ret);
+       if (!NT_STATUS_IS_OK(status)) {
+               DBG_ERR("auth method %s did not correctly init %s\n",
+                       module_name,
+                       nt_errstr(status));
+               return false;
        }
 
-       return good;
+       DBG_INFO("auth method %s has a valid init\n", module_name);
+       return true;
 }
 
 /***************************************************************************