]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/boa/boa-0.94.13/debian-patch.diff
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / boa / boa-0.94.13 / debian-patch.diff
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
4 @@ -208,10 +208,11 @@
5          struct passwd *passwdbuf;
6          passwdbuf = getpwuid(server_uid);
7          if (passwdbuf == NULL) {
8 -            DIE("getpwuid");
9 -        }
10 +            WARN("getpwuid - will not initgroups");
11 +        } else {
12          if (initgroups(passwdbuf->pw_name, passwdbuf->pw_gid) == -1) {
13 -            DIE("initgroups");
14 +                               WARN("initgroups");
15 +                       }
16          }
17          if (setgid(server_gid) == -1) {
18              DIE("setgid");
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
22 @@ -149,8 +149,9 @@
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
36 @@ -20,7 +20,7 @@
37   *
38   */
39  
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 $ */
42  
43  #include <string.h>
44  #include <stdio.h>
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
48 @@ -117,7 +117,7 @@
49  #endif
50  
51  #ifdef HAVE_TM_GMTOFF
52 -#define TIMEZONE_OFFSET(foo) foo##->tm_gmtoff
53 +#define TIMEZONE_OFFSET(foo) foo->tm_gmtoff
54  #else
55  #define TIMEZONE_OFFSET(foo) timezone
56  #endif
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
60 @@ -43,7 +43,7 @@
61      struct stat statbuf;
62      volatile int bytes;
63  
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 */
67  
68  #ifdef GUNZIP
69 @@ -58,7 +58,7 @@
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);
75          if (data_fd != -1) {
76              close(data_fd);
77  
78 @@ -313,7 +313,7 @@
79             sprintf(pathname_with_index, "%s%s", req->pathname, directory_index);
80           */
81  
82 -        data_fd = open(pathname_with_index, O_RDONLY);
83 +        data_fd = open(pathname_with_index, O_RDONLY | O_LARGEFILE);
84  
85          if (data_fd != -1) {    /* user's index file */
86              strcpy(req->request_uri, directory_index); /* for mimetype */
87 @@ -334,7 +334,7 @@
88           * try index.html.gz
89           */
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 */
94              close(data_fd);
95  
96 @@ -399,9 +399,9 @@
97      time_t real_dir_mtime;
98  
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);
105  
106      if (data_fd != -1) {        /* index cache */
107  
108 @@ -417,7 +417,7 @@
109      if (index_directory(req, pathname_with_index) == -1)
110          return -1;
111  
112 -    data_fd = open(pathname_with_index, O_RDONLY); /* Last chance */
113 +    data_fd = open(pathname_with_index, O_RDONLY | O_LARGEFILE); /* Last chance */
114      if (data_fd != -1) {
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
120 @@ -54,8 +54,8 @@
121      int kacount;                /* keepalive count */
122  
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. */
130  
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 @@
135          printf("<tr>"
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>"
140                 "</tr>\n",
141                 http_filename, html_filename,
142 -               ctime(&statbuf.st_mtime), (long) statbuf.st_size);
143 +               ctime(&statbuf.st_mtime), (long long) statbuf.st_size);
144      }
145  
146      printf
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>"
153                     "</tr>\n",
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);
157          } else {
158  #endif
159              printf("<tr>"
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>"
164                     "</tr>\n",
165                     http_filename, html_filename,
166 -                   ctime(&statbuf.st_mtime), (long) statbuf.st_size);
167 +                   ctime(&statbuf.st_mtime), (long long) statbuf.st_size);
168  #ifdef GUNZIP
169          }
170  #endif
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
174 @@ -142,7 +142,7 @@
175      if (access_log) {
176          if (virtualhost)
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",
180                  req->remote_ip_addr,
181                  get_commonlog_time(),
182                  req->logline,
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
186 @@ -104,7 +104,7 @@
187      int data_fd;
188      struct stat statbuf;
189      struct mmap_entry *e;
190 -    data_fd = open(fname, O_RDONLY);
191 +    data_fd = open(fname, O_RDONLY | O_LARGEFILE);
192      if (data_fd == -1) {
193          perror(fname);
194          return NULL;
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
198 @@ -157,7 +157,7 @@
199                  if (req->content_length) {
200                      int content_length;
201  
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) {
206                          log_error_time();
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
210 @@ -386,7 +386,7 @@
211      memcpy(p, day_tab + t->tm_wday * 4, 4);
212  }
213  
214 -char *simple_itoa(unsigned int i)
215 +char *simple_itoa(long long int i)
216  {
217      /* 21 digits plus null terminator, good for 64-bit or smaller ints
218       * for bigger ints, use a bigger buffer!
219 @@ -427,6 +427,24 @@
220      return retval;
221  }
222  
223 +/* I don't "do" negative conversions
224 + * Therefore, -1 indicates error
225 + */
226 +
227 +long long int boa_atoll(char *s)
228 +{
229 +    long long int retval;
230 +
231 +    if (!isdigit(*s))
232 +        return -1;
233 +
234 +    retval = atoll(s);
235 +    if (retval < 0)
236 +        return -1;
237 +
238 +    return retval;
239 +}
240 +
241  int create_temporary_file(short want_unlink, char *storage, int size)
242  {
243      static char boa_tempfile[MAX_PATH_LENGTH + 1];