diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-11-26 18:03:18 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-11-26 18:03:18 +0000 |
commit | 77e0acc0d3401860baa8663d6fe555528b492d72 (patch) | |
tree | 398341a82a16f3023e6c7f888b8a588dd4b42430 /w3mhelperpanel.c | |
parent | fix indent (diff) | |
download | w3m-77e0acc0d3401860baa8663d6fe555528b492d72.tar.gz w3m-77e0acc0d3401860baa8663d6fe555528b492d72.zip |
use local_cookie for support local-cgi commands
* file.c (loadGeneralFile): pass Local_cookie to DirBufferCommand
* fm.h (Local_cookie): Str
* local.c (setLocalCookie): Str, set_environ()
(set_cgi_environ): remove LOCAL_COOKIE
* main.c (ldhelp): pass Local_cookie
(adBmark): ditto
* rc.c (optionpanel_src1): cookie
(load_option_panel): pass Local_cookie
* w3mbookmark.c (main): check Local_cookie
* w3mhelperpanel (main): ditto
* scripts/dirlist.cgi.in: ditto
* scripts/w3mhelp.cgi.in: ditto
* scripts/multipart/multipart.cgi.in: ditto
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r-- | w3mhelperpanel.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/w3mhelperpanel.c b/w3mhelperpanel.c index dd7b7f7..b66c47c 100644 --- a/w3mhelperpanel.c +++ b/w3mhelperpanel.c @@ -1,4 +1,4 @@ -/* $Id: w3mhelperpanel.c,v 1.9 2002/11/12 12:41:58 ukai Exp $ */ +/* $Id: w3mhelperpanel.c,v 1.10 2002/11/26 18:03:29 ukai Exp $ */ #include <errno.h> #include <stdlib.h> #include <stdio.h> @@ -168,11 +168,18 @@ main(int argc, char *argv[], char **envp) exit(1); cgiarg = cgistr2tagarg(qs); - mode = tag_get_value(cgiarg, "mode"); + local_cookie = getenv("LOCAL_COOKIE"); + sent_cookie = tag_get_value(cgiarg, "cookie"); + if (local_cookie == NULL || sent_cookie == NULL || + strcmp(local_cookie, sent_cookie) != 0) { + /* Local cookie doesn't match */ + bye("Local cookie doesn't match: It may be an illegal execution", ""); + } + + mode = tag_get_value(cgiarg, "mode"); mailcapfile = Strnew_charp(expandPath(RC_DIR)); Strcat_charp(mailcapfile, "/mailcap"); - if (mode && !strcmp(mode, "edit")) { char *referer; /* check if I can edit my mailcap */ @@ -183,13 +190,6 @@ main(int argc, char *argv[], char **envp) bye("It may be an illegal execution\n referer=", referer); } } - sent_cookie = tag_get_value(cgiarg, "cookie"); - if (local_cookie == NULL || sent_cookie == NULL || - strcmp(local_cookie, sent_cookie) != 0) { - /* Local cookie doesn't match */ - bye("Local cookie doesn't match: It may be an illegal execution", - ""); - } /* edit mailcap */ editMailcap(mailcapfile->ptr, cgiarg); } |