]> jfr.im git - solanum.git/blobdiff - authd/authd.c
Merge branch 'master' into authd-framework-2
[solanum.git] / authd / authd.c
index 335f55f51f15fe7b8466b23f28e9f05727ef1122..acd5bc1e21d9af68ea3557be26985f3741629ce2 100644 (file)
@@ -31,7 +31,7 @@ rb_helper *authd_helper = NULL;
 authd_cmd_handler authd_cmd_handlers[256] = {
        ['C'] = handle_new_connection,
        ['D'] = resolve_dns,
-       ['H'] = handle_reload,
+       ['R'] = handle_reload,
        ['S'] = handle_stat,
 };
 
@@ -49,8 +49,10 @@ handle_stat(int parc, char *parv[])
        authd_stat_handler handler;
 
        if(parc < 3)
-                /* XXX Should log this somehow */
+       {
+               warn_opers(L_CRIT, "BUG: handle_stat received too few parameters (at least 3 expected, got %d)", parc);
                return;
+       }
 
        if (!(handler = authd_stat_handlers[(unsigned char)parv[2][0]]))
                return;
@@ -64,8 +66,16 @@ handle_reload(int parc, char *parv[])
        authd_reload_handler handler;
 
        if(parc < 2)
-                /* XXX Should log this somehow */
+       {
+               /* Reload all handlers */
+               for(size_t i = 0; i < sizeof(authd_reload_handlers); i++)
+               {
+                       if ((handler = authd_reload_handlers[(unsigned char) i]) != NULL)
+                               handler(parv[1][0]);
+               }
+
                return;
+       }
 
        if (!(handler = authd_reload_handlers[(unsigned char)parv[1][0]]))
                return;