1 diff -urN boa-0.94.13.orig/src/boa.c boa-0.94.13/src/boa.c
2 --- boa-0.94.13.orig/src/boa.c 2002-07-23 17:50:29.000000000 +0200
3 +++ boa-0.94.13/src/boa.c 2004-09-01 20:00:36.000000000 +0200
5 struct passwd *passwdbuf;
6 passwdbuf = getpwuid(server_uid);
7 if (passwdbuf == NULL) {
10 + WARN("getpwuid - will not initgroups");
12 if (initgroups(passwdbuf->pw_name, passwdbuf->pw_gid) == -1) {
17 if (setgid(server_gid) == -1) {
19 diff -urN boa-0.94.13.orig/src/boa.h boa-0.94.13/src/boa.h
20 --- boa-0.94.13.orig/src/boa.h 2002-07-26 05:03:44.000000000 +0200
21 +++ boa-0.94.13/src/boa.h 2004-09-01 20:00:36.000000000 +0200
23 void clean_pathname(char *pathname);
24 char *get_commonlog_time(void);
25 void rfc822_time_buf(char *buf, time_t s);
26 -char *simple_itoa(unsigned int i);
27 +char *simple_itoa(long long int i);
28 int boa_atoi(char *s);
29 +long long int boa_atoll(char *s);
30 char *escape_string(char *inp, char *buf);
31 int month2int(char *month);
32 int modified_since(time_t * mtime, char *if_modified_since);
33 diff -urN boa-0.94.13.orig/src/boa_grammar.y boa-0.94.13/src/boa_grammar.y
34 --- boa-0.94.13.orig/src/boa_grammar.y 1999-10-12 16:49:07.000000000 +0200
35 +++ boa-0.94.13/src/boa_grammar.y 2004-09-01 20:00:36.000000000 +0200
40 -/* $Id: boa_grammar.y,v 1.14 1999/10/12 14:49:07 jon Exp $*/
41 +/* $Id: boa_grammar.y,v 1.14 1999/10/12 14:49:07 jon Exp $ */
45 diff -urN boa-0.94.13.orig/src/compat.h boa-0.94.13/src/compat.h
46 --- boa-0.94.13.orig/src/compat.h 2002-06-06 07:02:28.000000000 +0200
47 +++ boa-0.94.13/src/compat.h 2004-09-01 20:00:36.000000000 +0200
52 -#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff
53 +#define TIMEZONE_OFFSET(foo) foo->tm_gmtoff
55 #define TIMEZONE_OFFSET(foo) timezone
57 diff -urN boa-0.94.13.orig/src/get.c boa-0.94.13/src/get.c
58 --- boa-0.94.13.orig/src/get.c 2002-07-26 05:05:59.000000000 +0200
59 +++ boa-0.94.13/src/get.c 2004-09-01 20:00:36.000000000 +0200
64 - data_fd = open(req->pathname, O_RDONLY);
65 + data_fd = open(req->pathname, O_RDONLY | O_LARGEFILE);
66 saved_errno = errno; /* might not get used */
70 memcpy(gzip_pathname, req->pathname, len);
71 memcpy(gzip_pathname + len, ".gz", 3);
72 gzip_pathname[len + 3] = '\0';
73 - data_fd = open(gzip_pathname, O_RDONLY);
74 + data_fd = open(gzip_pathname, O_RDONLY | O_LARGEFILE);
79 sprintf(pathname_with_index, "%s%s", req->pathname, directory_index);
82 - data_fd = open(pathname_with_index, O_RDONLY);
83 + data_fd = open(pathname_with_index, O_RDONLY | O_LARGEFILE);
85 if (data_fd != -1) { /* user's index file */
86 strcpy(req->request_uri, directory_index); /* for mimetype */
90 strcat(pathname_with_index, ".gz");
91 - data_fd = open(pathname_with_index, O_RDONLY);
92 + data_fd = open(pathname_with_index, O_RDONLY | O_LARGEFILE);
93 if (data_fd != -1) { /* user's index file */
97 time_t real_dir_mtime;
99 real_dir_mtime = statbuf->st_mtime;
100 - sprintf(pathname_with_index, "%s/dir.%d.%ld",
101 + sprintf(pathname_with_index, "%s/dir.%d.%lld",
102 cachedir, (int) statbuf->st_dev, statbuf->st_ino);
103 - data_fd = open(pathname_with_index, O_RDONLY);
104 + data_fd = open(pathname_with_index, O_RDONLY | O_LARGEFILE);
106 if (data_fd != -1) { /* index cache */
109 if (index_directory(req, pathname_with_index) == -1)
112 - data_fd = open(pathname_with_index, O_RDONLY); /* Last chance */
113 + data_fd = open(pathname_with_index, O_RDONLY | O_LARGEFILE); /* Last chance */
115 strcpy(req->request_uri, directory_index); /* for mimetype */
116 fstat(data_fd, statbuf);
117 diff -urN boa-0.94.13.orig/src/globals.h boa-0.94.13/src/globals.h
118 --- boa-0.94.13.orig/src/globals.h 2002-07-24 05:03:59.000000000 +0200
119 +++ boa-0.94.13/src/globals.h 2004-09-01 20:00:36.000000000 +0200
121 int kacount; /* keepalive count */
123 int data_fd; /* fd of data */
124 - unsigned long filesize; /* filesize */
125 - unsigned long filepos; /* position in file */
126 + unsigned long long filesize; /* filesize */
127 + unsigned long long filepos; /* position in file */
128 char *data_mem; /* mmapped/malloced char array */
129 int method; /* M_GET, M_POST, etc. */
131 diff -urN boa-0.94.13.orig/src/index_dir.c boa-0.94.13/src/index_dir.c
132 --- boa-0.94.13.orig/src/index_dir.c 2002-01-30 04:41:45.000000000 +0100
133 +++ boa-0.94.13/src/index_dir.c 2004-09-01 20:00:36.000000000 +0200
134 @@ -240,10 +240,10 @@
136 "<td width=\"40%%\"><a href=\"%s/\">%s/</a></td>"
137 "<td align=right>%s</td>"
138 - "<td align=right>%ld bytes</td>"
139 + "<td align=right>%lld bytes</td>"
141 http_filename, html_filename,
142 - ctime(&statbuf.st_mtime), (long) statbuf.st_size);
143 + ctime(&statbuf.st_mtime), (long long) statbuf.st_size);
147 @@ -281,19 +281,19 @@
148 "<td width=\"40%%\"><a href=\"%s\">%s</a> "
149 "<a href=\"%s.gz\">(.gz)</a></td>"
150 "<td align=right>%s</td>"
151 - "<td align=right>%ld bytes</td>"
152 + "<td align=right>%lld bytes</td>"
154 http_filename, html_filename, http_filename,
155 - ctime(&statbuf.st_mtime), (long) statbuf.st_size);
156 + ctime(&statbuf.st_mtime), (long long) statbuf.st_size);
160 "<td width=\"40%%\"><a href=\"%s\">%s</a></td>"
161 "<td align=right>%s</td>"
162 - "<td align=right>%ld bytes</td>"
163 + "<td align=right>%lld bytes</td>"
165 http_filename, html_filename,
166 - ctime(&statbuf.st_mtime), (long) statbuf.st_size);
167 + ctime(&statbuf.st_mtime), (long long) statbuf.st_size);
171 diff -urN boa-0.94.13.orig/src/log.c boa-0.94.13/src/log.c
172 --- boa-0.94.13.orig/src/log.c 2002-07-26 05:04:48.000000000 +0200
173 +++ boa-0.94.13/src/log.c 2004-09-01 20:00:36.000000000 +0200
177 fprintf(access_log, "%s ", req->local_ip_addr);
178 - fprintf(access_log, "%s - - %s\"%s\" %d %ld \"%s\" \"%s\"\n",
179 + fprintf(access_log, "%s - - %s\"%s\" %d %lld \"%s\" \"%s\"\n",
181 get_commonlog_time(),
183 diff -urN boa-0.94.13.orig/src/mmap_cache.c boa-0.94.13/src/mmap_cache.c
184 --- boa-0.94.13.orig/src/mmap_cache.c 2002-03-24 23:35:34.000000000 +0100
185 +++ boa-0.94.13/src/mmap_cache.c 2004-09-01 20:00:36.000000000 +0200
189 struct mmap_entry *e;
190 - data_fd = open(fname, O_RDONLY);
191 + data_fd = open(fname, O_RDONLY | O_LARGEFILE);
195 diff -urN boa-0.94.13.orig/src/read.c boa-0.94.13/src/read.c
196 --- boa-0.94.13.orig/src/read.c 2002-03-18 02:53:48.000000000 +0100
197 +++ boa-0.94.13/src/read.c 2004-09-01 20:00:36.000000000 +0200
199 if (req->content_length) {
202 - content_length = boa_atoi(req->content_length);
203 + content_length = boa_atoll(req->content_length);
204 /* Is a content-length of 0 legal? */
205 if (content_length <= 0) {
207 diff -urN boa-0.94.13.orig/src/util.c boa-0.94.13/src/util.c
208 --- boa-0.94.13.orig/src/util.c 2002-07-08 01:22:18.000000000 +0200
209 +++ boa-0.94.13/src/util.c 2004-09-01 20:00:36.000000000 +0200
211 memcpy(p, day_tab + t->tm_wday * 4, 4);
214 -char *simple_itoa(unsigned int i)
215 +char *simple_itoa(long long int i)
217 /* 21 digits plus null terminator, good for 64-bit or smaller ints
218 * for bigger ints, use a bigger buffer!
223 +/* I don't "do" negative conversions
224 + * Therefore, -1 indicates error
227 +long long int boa_atoll(char *s)
229 + long long int retval;
241 int create_temporary_file(short want_unlink, char *storage, int size)
243 static char boa_tempfile[MAX_PATH_LENGTH + 1];