]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
exit the server when the radmin interface hits EOF
authorAlan T. DeKok <aland@freeradius.org>
Wed, 31 Dec 2025 17:34:37 +0000 (12:34 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 31 Dec 2025 17:34:37 +0000 (12:34 -0500)
src/bin/radmin.c

index 4c31a9f15e49c34bb59117df542c785bb7b77aa6..74075645a6df1b1553b1f686947bccc67d83d626 100644 (file)
@@ -267,8 +267,17 @@ static void *fr_radmin(UNUSED void *input_ctx)
                line = readline(prompt);
                if (stop) break;
 
-               if (!line) continue;
+               /*
+                *      NULL means "read hit EOF"
+                */
+               if (!line) {
+                       main_loop_signal_raise(RADIUS_SIGNAL_SELF_EXIT);
+                       break;
+               }
 
+               /*
+                *      non-NULL, but empty line means "no input"
+                */
                if (!*line) {
                        radmin_free(line);
                        continue;