summaryrefslogtreecommitdiff
path: root/source/web
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-03-15 03:06:50 +0000
committerAndrew Tridgell <tridge@samba.org>1998-03-15 03:06:50 +0000
commitc634b799874795d42dae28fb4440ea452dc89b1b (patch)
treebc7c3a322979e3a062e580f8cfa7c771e137ba6e /source/web
parent78675036e81e2cde7209d9e68956d71ef6661137 (diff)
downloadsamba-c634b799874795d42dae28fb4440ea452dc89b1b.tar.gz
- claim the null connection after the session request to mak sure we
have the netbios name - fix another kill connection bug
Diffstat (limited to 'source/web')
-rw-r--r--source/web/statuspage.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source/web/statuspage.c b/source/web/statuspage.c
index 0031adde9f0..25a45928f2f 100644
--- a/source/web/statuspage.c
+++ b/source/web/statuspage.c
@@ -67,8 +67,6 @@ void status_page(void)
struct connect_record crec;
pstring fname;
FILE *f;
- int i, pid;
- char *v;
if (cgi_variable("smbd_start")) {
start_smbd();
@@ -86,6 +84,12 @@ void status_page(void)
stop_nmbd();
}
+ pstrcpy(fname,lp_lockdir());
+ standard_sub_basic(fname);
+ trim_string(fname,"","/");
+ strcat(fname,"/STATUS..LCK");
+
+
f = fopen(fname,"r");
if (f) {
while (!feof(f)) {
@@ -95,7 +99,7 @@ void status_page(void)
char buf[30];
sprintf(buf,"kill_%d", crec.pid);
if (cgi_variable(buf)) {
- kill_pid(pid);
+ kill_pid(crec.pid);
}
}
}
@@ -106,11 +110,6 @@ void status_page(void)
printf("<FORM method=post>\n");
- pstrcpy(fname,lp_lockdir());
- standard_sub_basic(fname);
- trim_string(fname,"","/");
- strcat(fname,"/STATUS..LCK");
-
f = fopen(fname,"r");
if (!f) {
printf("Couldn't open status file %s\n",fname);
@@ -152,7 +151,9 @@ void status_page(void)
while (!feof(f)) {
if (fread(&crec,sizeof(crec),1,f) != 1)
break;
- if (crec.magic == 0x280267 && process_exists(crec.pid)) {
+ if (crec.magic == 0x280267 &&
+ crec.cnum == -1 &&
+ process_exists(crec.pid)) {
printf("<tr><td>%d</td><td>%s</td><td>%s</td><td>%s</td><td><input type=submit value=\"X\" name=\"kill_%d\"></td></tr>\n",
crec.pid,
crec.machine,crec.addr,