diff options
-rw-r--r-- | source3/web/statuspage.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/source3/web/statuspage.c b/source3/web/statuspage.c index 3a95d99d37..0031adde9f 100644 --- a/source3/web/statuspage.c +++ b/source3/web/statuspage.c @@ -86,16 +86,22 @@ void status_page(void) stop_nmbd(); } - for (i=0;cgi_vnum(i, &v); i++) { - if (strncmp(v, "kill_", 5) != 0) continue; - pid = atoi(v+5); - if (pid > 0) { - printf("killing %d<br>\n", pid); - kill_pid(pid); + f = fopen(fname,"r"); + if (f) { + while (!feof(f)) { + if (fread(&crec,sizeof(crec),1,f) != 1) break; + if (crec.magic == 0x280267 && crec.cnum == -1 && + process_exists(crec.pid)) { + char buf[30]; + sprintf(buf,"kill_%d", crec.pid); + if (cgi_variable(buf)) { + kill_pid(pid); + } + } } + fclose(f); } - printf("<H2>Server Status</H2>\n"); printf("<FORM method=post>\n"); |