aboutsummaryrefslogtreecommitdiffstats
path: root/local.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:24:02 +0000
committerTatsuya Kinoshita <tats@vega.ocn.ne.jp>2011-05-04 07:24:02 +0000
commitd6d37ee0c991ead2b1613c0af242d2e603313d87 (patch)
treef54ef4313b0db75941e44bf480c5b9edfa16e208 /local.c
parentReleasing debian version 0.5.1-5.1 (diff)
downloadw3m-d6d37ee0c991ead2b1613c0af242d2e603313d87.tar.gz
w3m-d6d37ee0c991ead2b1613c0af242d2e603313d87.zip
Releasing debian version 0.5.2-1debian/0.5.2-1
Diffstat (limited to '')
-rw-r--r--local.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/local.c b/local.c
index 8da1fc7..f5a73a2 100644
--- a/local.c
+++ b/local.c
@@ -1,4 +1,4 @@
-/* $Id: local.c,v 1.33 2006/04/07 13:21:11 inu Exp $ */
+/* $Id: local.c,v 1.35 2007/05/23 15:06:05 inu Exp $ */
#include "fm.h"
#include <string.h>
#include <stdio.h>
@@ -16,6 +16,10 @@
#include "local.h"
#include "hash.h"
+#ifdef __MINGW32_VERSION
+#include <winsock.h>
+#endif
+
#define CGIFN_NORMAL 0
#define CGIFN_LIBDIR 1
#define CGIFN_CGIBIN 2
@@ -85,7 +89,8 @@ loadLocalDir(char *dname)
Strcat_char(dirname, '/');
qdir = html_quote(Str_conv_from_system(dirname)->ptr);
/* FIXME: gettextize? */
- tmp = Strnew_m_charp("<HTML>\n<HEAD>\n<BASE HREF=\"file://", qdir,
+ tmp = Strnew_m_charp("<HTML>\n<HEAD>\n<BASE HREF=\"file://",
+ html_quote(file_quote(dirname->ptr)),
"\">\n<TITLE>Directory list of ", qdir,
"</TITLE>\n</HEAD>\n<BODY>\n<H1>Directory list of ",
qdir, "</H1>\n", NULL);
@@ -193,8 +198,10 @@ check_local_cgi(char *file, int status)
return -1;
if (S_ISDIR(st.st_mode))
return -1;
+#ifndef __MINGW32_VERSION
if ((st.st_uid == geteuid() && (st.st_mode & S_IXUSR)) || (st.st_gid == getegid() && (st.st_mode & S_IXGRP)) || (st.st_mode & S_IXOTH)) /* executable */
return 0;
+#endif
return -1;
}
@@ -353,6 +360,9 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
pid_t pid;
char *file = uri, *name = uri, *path_info = NULL, *tmpf = NULL;
+#ifdef __MINGW32_VERSION
+ return NULL;
+#else
status = cgi_filename(uri, &file, &name, &path_info);
if (check_local_cgi(file, status) < 0)
return NULL;
@@ -412,4 +422,5 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
file, mybasename(file), strerror(errno));
exit(1);
return NULL;
+#endif
}