pkgsrc-wip/fnord/patches/patch-ab

50 lines
1.2 KiB
Text
Raw Normal View History

$NetBSD: patch-ab,v 1.2 2005/05/29 14:40:35 gschwarz Exp $
2005-04-30 19:13:21 +02:00
--- httpd.c.orig Mon Jan 31 17:10:39 2005
+++ httpd.c Sat May 21 22:04:04 2005
@@ -23,6 +23,9 @@
2005-04-30 19:13:21 +02:00
#include "buffer.h"
#include "byte.h"
#include "scan.h"
+#ifdef NEED_ALLOCA_H
2005-04-30 19:13:21 +02:00
+#include <alloca.h>
+#endif
2005-04-30 19:13:21 +02:00
/* uncomment the following line to enable support for CGI */
// #define CGI
@@ -116,12 +119,16 @@
2005-04-30 19:13:21 +02:00
#undef USE_MMAP
#endif
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *) -1)
+#endif
+
enum { UNKNOWN, GET, HEAD, POST } method;
#ifdef TCP_CORK
static int corked;
#endif
-static long retcode=404; /* used for logging code */
+static unsigned long retcode=404; /* used for logging code */
char *host="?"; /* Host: header */
char *port; /* also Host: header, :80 part */
char *args; /* URL behind ? (for CGIs) */
@@ -1240,14 +1247,14 @@
2005-04-30 19:13:21 +02:00
char *tmp;
if (chdir("/")) goto error500;
if ((tmp=getenv("GID"))) {
- long gid;
+ unsigned long gid;
if (tmp[scan_ulong(tmp,&gid)]==0) {
gid_t gi=gid;
if (setgroups(1,&gi)) goto error500;
} else goto error500;
}
if ((tmp=getenv("UID"))) {
- long uid;
+ unsigned long uid;
if (tmp[scan_ulong(tmp,&uid)]==0) {
if (setuid(uid)) goto error500;
} else goto error500;