summaryrefslogtreecommitdiff
path: root/source3/web/cgi.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-03-08 14:14:49 +0000
committerAndrew Tridgell <tridge@samba.org>1998-03-08 14:14:49 +0000
commit35d67dd80aa3ba72b75683cb1f35c81066e21223 (patch)
tree946248a3dfaf9710586856ba20e82a0a661b2a61 /source3/web/cgi.c
parentf3eeb2f1fa528b0d952d2519f719d30f4a2489fa (diff)
downloadsamba-35d67dd80aa3ba72b75683cb1f35c81066e21223.tar.gz
samba-35d67dd80aa3ba72b75683cb1f35c81066e21223.tar.bz2
samba-35d67dd80aa3ba72b75683cb1f35c81066e21223.zip
Jeremy is going to hate me ...
These are some hacks on SWAT. Maybe users will actually be able to work out how to use it now. Unfortunately these changes required some editing in loadparm.c and smb.h which will make Jeremys merge job harder. Sorry! (This used to be commit 674c88a6bf4c8009769a482c53f105efdc54bbc8)
Diffstat (limited to 'source3/web/cgi.c')
-rw-r--r--source3/web/cgi.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index ae60d72b7b..7c84f47ada 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -43,6 +43,7 @@ static int content_length;
static int request_post;
static int request_get;
static char *query_string;
+static char *baseurl;
static void unescape(char *buf)
{
@@ -610,12 +611,20 @@ void cgi_setup(char *rootdir)
*p = 0;
}
- if (strcmp(url,"/")) {
+ if (strstr(url+1,"..")==0 && file_exist(url+1)) {
cgi_download(url+1);
}
printf("HTTP/1.1 200 OK\r\nConnection: close\r\n");
-
+
+ baseurl = url+1;
}
+/***************************************************************************
+return the current pages URL
+ ***************************************************************************/
+char *cgi_baseurl(void)
+{
+ return baseurl;
+}