pkgsrc-wip/fnord/patches/patch-ab

50 lines
1.3 KiB
Text
Raw Normal View History

2005-11-05 18:30:54 +01:00
$NetBSD: patch-ab,v 1.3 2005/11/05 17:30:54 gschwarz Exp $
2005-04-30 19:13:21 +02:00
2005-11-05 18:30:54 +01:00
--- httpd.c.orig 2005-08-03 13:32:50.000000000 +0200
+++ httpd.c 2005-10-15 15:15:03.000000000 +0200
@@ -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) */
2005-11-05 18:30:54 +01:00
@@ -1247,14 +1254,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;