mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
safer killing of connections - it ensures the process is still a valid
smbd when killing (This used to be commit 78675036e81e2cde7209d9e68956d71ef6661137)
This commit is contained in:
parent
d360320618
commit
08a6e255fe
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user