updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / qmail / qmail-1.03-autouidgid.patch
blob4350659b209430d87dc75085caef75f99ea62d4f
1 diff -u --new-file qmail-1.03.orig/Makefile qmail-1.03/Makefile
2 --- qmail-1.03.orig/Makefile 2005-07-05 14:52:39.936198616 -0300
3 +++ qmail-1.03/Makefile 2005-07-05 14:53:01.634854054 -0300
4 @@ -29,15 +29,6 @@
5 echo LD=\'`head -1 conf-ld`\' \
6 ) > auto-ccld.sh
8 -auto-gid: \
9 -load auto-gid.o substdio.a error.a str.a fs.a
10 - ./load auto-gid substdio.a error.a str.a fs.a
12 -auto-gid.o: \
13 -compile auto-gid.c subfd.h substdio.h substdio.h readwrite.h exit.h \
14 -scan.h fmt.h
15 - ./compile auto-gid.c
17 auto-int: \
18 load auto-int.o substdio.a error.a str.a fs.a
19 ./load auto-int substdio.a error.a str.a fs.a
20 @@ -62,15 +53,6 @@
21 compile auto-str.c substdio.h readwrite.h exit.h
22 ./compile auto-str.c
24 -auto-uid: \
25 -load auto-uid.o substdio.a error.a str.a fs.a
26 - ./load auto-uid substdio.a error.a str.a fs.a
28 -auto-uid.o: \
29 -compile auto-uid.c subfd.h substdio.h substdio.h readwrite.h exit.h \
30 -scan.h fmt.h
31 - ./compile auto-uid.c
33 auto_break.c: \
34 auto-str conf-break
35 ./auto-str auto_break \
36 @@ -112,22 +94,8 @@
37 compile auto_split.c
38 ./compile auto_split.c
40 -auto_uids.c: \
41 -auto-uid auto-gid conf-users conf-groups
42 - ( ./auto-uid auto_uida `head -1 conf-users` \
43 - &&./auto-uid auto_uidd `head -2 conf-users | tail -1` \
44 - &&./auto-uid auto_uidl `head -3 conf-users | tail -1` \
45 - &&./auto-uid auto_uido `head -4 conf-users | tail -1` \
46 - &&./auto-uid auto_uidp `head -5 conf-users | tail -1` \
47 - &&./auto-uid auto_uidq `head -6 conf-users | tail -1` \
48 - &&./auto-uid auto_uidr `head -7 conf-users | tail -1` \
49 - &&./auto-uid auto_uids `head -8 conf-users | tail -1` \
50 - &&./auto-gid auto_gidq `head -1 conf-groups` \
51 - &&./auto-gid auto_gidn `head -2 conf-groups | tail -1` \
52 - ) > auto_uids.c.tmp && mv auto_uids.c.tmp auto_uids.c
54 auto_uids.o: \
55 -compile auto_uids.c
56 +compile auto_uids.c auto_uids.h
57 ./compile auto_uids.c
59 auto_usera.c: \
60 @@ -742,17 +710,16 @@
61 ./compile idedit.c
63 install: \
64 -load install.o fifo.o hier.o auto_qmail.o auto_split.o auto_uids.o \
65 +load install.o fifo.o hier.o auto_split.o auto_uids.o \
66 strerr.a substdio.a open.a error.a str.a fs.a
67 - ./load install fifo.o hier.o auto_qmail.o auto_split.o \
68 + ./load install fifo.o hier.o auto_split.o \
69 auto_uids.o strerr.a substdio.a open.a error.a str.a fs.a
71 install-big: \
72 -load install-big.o fifo.o install.o auto_qmail.o auto_split.o \
73 -auto_uids.o strerr.a substdio.a open.a error.a str.a fs.a
74 - ./load install-big fifo.o install.o auto_qmail.o \
75 - auto_split.o auto_uids.o strerr.a substdio.a open.a error.a \
76 - str.a fs.a
77 +load install-big.o fifo.o install.o auto_split.o auto_uids.o \
78 +strerr.a substdio.a open.a error.a str.a fs.a
79 + ./load install-big fifo.o install.o auto_split.o auto_uids.o \
80 + strerr.a substdio.a open.a error.a str.a fs.a
82 install-big.o: \
83 compile install-big.c auto_split.h auto_uids.h fmt.h fifo.h
84 @@ -764,9 +731,9 @@
85 ./compile install.c
87 instcheck: \
88 -load instcheck.o fifo.o hier.o auto_qmail.o auto_split.o auto_uids.o \
89 +load instcheck.o fifo.o hier.o auto_split.o auto_uids.o \
90 strerr.a substdio.a error.a str.a fs.a
91 - ./load instcheck fifo.o hier.o auto_qmail.o auto_split.o \
92 + ./load instcheck fifo.o hier.o auto_split.o \
93 auto_uids.o strerr.a substdio.a error.a str.a fs.a
95 instcheck.o: \
96 @@ -806,7 +773,7 @@
97 qmail-pop3d qmail-popup qmail-qmqpc qmail-qmqpd qmail-qmtpd \
98 qmail-smtpd sendmail tcp-env qmail-newmrh config config-fast dnscname \
99 dnsptr dnsip dnsmxip dnsfq hostname ipmeprint qreceipt qsmhook qbiff \
100 -forward preline condredirect bouncesaying except maildirmake \
101 +forward preline condredirect bouncesaying except maildirmake make-owners \
102 maildir2mbox maildirwatch qail elq pinq idedit install-big install \
103 instcheck home home+df proc proc+df binm1 binm1+df binm2 binm2+df \
104 binm3 binm3+df qmail-todo
105 @@ -919,6 +886,15 @@
106 cat auto-ccld.sh make-makelib.sh > make-makelib
107 chmod 755 make-makelib
109 +make-owners: \
110 +make-owners.head conf-users conf-groups
111 + cat make-owners.head >make-owners
112 + for num in a d l o p q r s; do read name; \
113 + echo checkuid $$num $$name; done <conf-users >>make-owners
114 + for num in q n; do read name; \
115 + echo checkgid $$num $$name; done <conf-groups >>make-owners
116 + chmod +x make-owners
118 makelib: \
119 make-makelib warn-auto.sh systype
120 ( cat warn-auto.sh; ./make-makelib "`cat systype`" ) > \
121 @@ -1048,7 +1024,7 @@
122 chmod 755 proc+df
124 prot.o: \
125 -compile prot.c hasshsgr.h prot.h
126 +compile prot.c hasshsgr.h prot.h auto_uids.h
127 ./compile prot.c
129 qail: \
130 @@ -1202,10 +1178,9 @@
131 load qmail-lspawn.o spawn.o prot.o slurpclose.o coe.o sig.a wait.a \
132 case.a cdb.a fd.a open.a stralloc.a alloc.a substdio.a error.a str.a \
133 fs.a auto_qmail.o auto_uids.o auto_spawn.o
134 - ./load qmail-lspawn spawn.o prot.o slurpclose.o coe.o \
135 + ./load qmail-lspawn spawn.o prot.o slurpclose.o coe.o auto_uids.o \
136 sig.a wait.a case.a cdb.a fd.a open.a stralloc.a alloc.a \
137 - substdio.a error.a str.a fs.a auto_qmail.o auto_uids.o \
138 - auto_spawn.o
139 + substdio.a error.a str.a fs.a auto_qmail.o auto_spawn.o
141 qmail-lspawn.0: \
142 qmail-lspawn.8
143 @@ -1423,10 +1398,10 @@
144 load qmail-queue.o triggerpull.o fmtqfn.o now.o date822fmt.o \
145 datetime.a seek.a ndelay.a open.a sig.a alloc.a substdio.a error.a \
146 str.a fs.a auto_qmail.o auto_split.o auto_uids.o
147 - ./load qmail-queue triggerpull.o fmtqfn.o now.o \
148 + ./load qmail-queue triggerpull.o fmtqfn.o now.o auto_uids.o \
149 date822fmt.o datetime.a seek.a ndelay.a open.a sig.a \
150 alloc.a substdio.a error.a str.a fs.a auto_qmail.o \
151 - auto_split.o auto_uids.o
152 + auto_split.o
154 qmail-queue.0: \
155 qmail-queue.8
156 @@ -1465,10 +1440,9 @@
157 load qmail-rspawn.o spawn.o tcpto_clean.o now.o coe.o sig.a open.a \
158 seek.a lock.a wait.a fd.a stralloc.a alloc.a substdio.a error.a str.a \
159 auto_qmail.o auto_uids.o auto_spawn.o
160 - ./load qmail-rspawn spawn.o tcpto_clean.o now.o coe.o \
161 + ./load qmail-rspawn spawn.o tcpto_clean.o now.o coe.o auto_uids.o \
162 sig.a open.a seek.a lock.a wait.a fd.a stralloc.a alloc.a \
163 - substdio.a error.a str.a auto_qmail.o auto_uids.o \
164 - auto_spawn.o
165 + substdio.a error.a str.a auto_qmail.o auto_spawn.o
167 qmail-rspawn.0: \
168 qmail-rspawn.8
169 @@ -1558,8 +1532,10 @@
170 ./compile qmail-smtpd.c
172 qmail-start: \
173 -load qmail-start.o prot.o fd.a auto_uids.o
174 - ./load qmail-start prot.o fd.a auto_uids.o
175 +load qmail-start.o prot.o fd.a auto_uids.o auto_qmail.o \
176 + open_read.o substdio.a error.a
177 + ./load qmail-start prot.o auto_uids.o fd.a \
178 + auto_qmail.o open_read.o substdio.a str.a error.a
180 qmail-start.0: \
181 qmail-start.8
182 @@ -1807,7 +1783,7 @@
183 proc+df.sh binm1.sh binm2.sh binm3.sh binm1+df.sh binm2+df.sh \
184 binm3+df.sh find-systype.sh make-compile.sh make-load.sh \
185 make-makelib.sh trycpp.c warn-auto.sh auto-str.c auto-int.c \
186 -auto-int8.c auto-gid.c auto-uid.c hier.c install.c instcheck.c \
187 +auto-int8.c hier.c install.c instcheck.c \
188 install-big.c alloc.3 alloc.h alloc.c alloc_re.c case.3 case.h \
189 case_diffb.c case_diffs.c case_lowerb.c case_lowers.c case_starts.c \
190 cdb.3 cdb.h cdb_hash.c cdb_seek.c cdb_unpack.c cdbmake.h \
191 diff -u --new-file qmail-1.03.orig/TARGETS qmail-1.03/TARGETS
192 --- qmail-1.03.orig/TARGETS 2005-07-05 14:52:39.920202556 -0300
193 +++ qmail-1.03/TARGETS 2005-07-05 14:53:01.639852822 -0300
194 @@ -150,11 +150,6 @@
195 cdb_unpack.o
196 cdb_seek.o
197 cdb.a
198 -auto-uid.o
199 -auto-uid
200 -auto-gid.o
201 -auto-gid
202 -auto_uids.c
203 auto_uids.o
204 qmail-lspawn
205 qmail-getpw.o
206 @@ -294,6 +289,7 @@
207 except
208 maildirmake.o
209 maildirmake
210 +make-owners
211 maildir2mbox.o
212 maildir2mbox
213 maildirwatch.o
214 diff -u --new-file qmail-1.03.orig/auto_uids.c qmail-1.03/auto_uids.c
215 --- qmail-1.03.orig/auto_uids.c 1969-12-31 21:00:00.000000000 -0300
216 +++ qmail-1.03/auto_uids.c 2005-07-05 14:53:01.642852084 -0300
217 @@ -0,0 +1,108 @@
218 +#include <stdlib.h>
219 +#include <sys/stat.h>
220 +#include "exit.h"
221 +#include "subfd.h"
222 +#include "substdio.h"
223 +#include "auto_qmail.h"
224 +#include "auto_uids.h"
226 +/* These are offsets from the end of either uid_files or gid_files */
228 +int auto_uida = -8;
229 +int auto_uidd = -7;
230 +int auto_uidl = -6;
231 +int auto_uido = -5;
232 +int auto_uidp = -4;
233 +int auto_uidq = -3;
234 +int auto_uidr = -2;
235 +int auto_uids = -1;
237 +int auto_gidn = -2;
238 +int auto_gidq = -1;
240 +#define uid_table_size 8
241 +#define gid_table_size 2
243 +struct file_ref { const char *name; int *var; };
245 +static struct file_ref uid_files[uid_table_size] = {
246 + { "uida", &auto_uida },
247 + { "uidd", &auto_uidd },
248 + { "uidl", &auto_uidl },
249 + { "uido", &auto_uido },
250 + { "uidp", &auto_uidp },
251 + { "uidq", &auto_uidq },
252 + { "uidr", &auto_uidr },
253 + { "uids", &auto_uids }
256 +static struct file_ref gid_files[gid_table_size] = {
257 + { "gidn", &auto_gidn },
258 + { "gidq", &auto_gidq }
261 +static int stat_control_file(name, buf) char* name; struct stat* buf;
263 + int result;
264 + char* file = malloc(strlen(auto_qmail) + strlen(name) + 10);
265 + if(file == 0)
267 + substdio_putsflush(subfderr,"fatal: unable to allocate memory\n");
268 + _exit(111);
270 + strcpy(file, auto_qmail);
271 + strcat(file, "/owners/");
272 + strcat(file, name);
273 + result = stat(file, buf);
274 + free(file);
275 + return result;
278 +static int stat_uid_file(ref) struct file_ref* ref;
280 + struct stat statbuf;
281 + if(stat_control_file(ref->name, &statbuf) == -1)
283 + substdio_puts(subfderr,"fatal: unable to stat uid control file '");
284 + substdio_puts(subfderr,ref->name);
285 + substdio_puts(subfderr,"'\n");
286 + substdio_flush(subfderr);
287 + _exit(111);
289 + return *(ref->var) = statbuf.st_uid;
292 +static int stat_gid_file(ref) struct file_ref* ref;
294 + struct stat statbuf;
295 + if(stat_control_file(ref->name, &statbuf) == -1)
297 + substdio_puts(subfderr,"fatal: unable to stat gid control file '");
298 + substdio_puts(subfderr,ref->name);
299 + substdio_puts(subfderr,"'\n");
300 + substdio_flush(subfderr);
301 + _exit(111);
303 + return *(ref->var) = statbuf.st_gid;
306 +int get_uid(id) int id;
308 + if(id >= 0)
309 + return id;
310 + else if(id < -uid_table_size)
311 + return -1;
312 + else
313 + return stat_uid_file(&uid_files[uid_table_size+id]);
316 +int get_gid(id) int id;
318 + if(id >= 0)
319 + return id;
320 + else if(id < -gid_table_size)
321 + return -1;
322 + else
323 + return stat_gid_file(&gid_files[gid_table_size+id]);
326 diff -u --new-file qmail-1.03.orig/auto_uids.h qmail-1.03/auto_uids.h
327 --- qmail-1.03.orig/auto_uids.h 2005-07-05 14:52:39.929200340 -0300
328 +++ qmail-1.03/auto_uids.h 2005-07-05 14:53:01.645851345 -0300
329 @@ -13,4 +13,7 @@
330 extern int auto_gidn;
331 extern int auto_gidq;
333 +extern int get_uid();
334 +extern int get_gid();
336 #endif
337 diff -u --new-file qmail-1.03.orig/hier.c qmail-1.03/hier.c
338 --- qmail-1.03.orig/hier.c 2005-07-05 14:52:39.975189012 -0300
339 +++ qmail-1.03/hier.c 2005-07-05 14:53:01.654849129 -0300
340 @@ -3,6 +3,15 @@
341 #include "fmt.h"
342 #include "fifo.h"
344 +/* Fool auto_uids.o into pulling the uid/gid files from the subdirectory
345 + * "owners" in the current directory. This requires that the command
346 + * "./make-owners ." be executed in the source directory before running
347 + * qmail-hier. This unfortunately hoses up the standard install process
348 + * (it will install into the current directory instead of /var/qmail),
349 + * and so it requires the install-path patch for proper operation.
350 + */
351 +char auto_qmail[] = ".";
353 char buf[100 + FMT_ULONG];
355 void dsplit(auto_qmail,base,uid,mode)
356 @@ -30,10 +39,23 @@
357 void hier(auto_qmail)
358 char *auto_qmail;
360 + get_uid(auto_uida);
361 + get_uid(auto_uidd);
362 + get_uid(auto_uidl);
363 + get_uid(auto_uido);
364 + get_uid(auto_uidp);
365 + get_uid(auto_uidq);
366 + get_uid(auto_uidr);
367 + get_uid(auto_uids);
369 + get_gid(auto_gidq);
370 + get_gid(auto_gidn);
372 h(auto_qmail,auto_uido,auto_gidq,0755);
374 d(auto_qmail,"control",auto_uido,auto_gidq,0755);
375 d(auto_qmail,"users",auto_uido,auto_gidq,0755);
376 + d(auto_qmail,"owners",auto_uido,auto_gidq,0755);
377 d(auto_qmail,"bin",auto_uido,auto_gidq,0755);
378 d(auto_qmail,"boot",auto_uido,auto_gidq,0755);
379 d(auto_qmail,"doc",auto_uido,auto_gidq,0755);
380 @@ -149,6 +171,7 @@
381 c(auto_qmail,"bin","qail",auto_uido,auto_gidq,0755);
382 c(auto_qmail,"bin","elq",auto_uido,auto_gidq,0755);
383 c(auto_qmail,"bin","pinq",auto_uido,auto_gidq,0755);
384 + c(auto_qmail,"bin","make-owners",auto_uido,auto_gidq,0755);
386 c(auto_qmail,"man/man5","addresses.5",auto_uido,auto_gidq,0644);
387 c(auto_qmail,"man/cat5","addresses.0",auto_uido,auto_gidq,0644);
388 diff -u --new-file qmail-1.03.orig/install-big.c qmail-1.03/install-big.c
389 --- qmail-1.03.orig/install-big.c 2005-07-05 14:52:39.977188520 -0300
390 +++ qmail-1.03/install-big.c 2005-07-05 14:53:01.703837063 -0300
391 @@ -3,6 +3,15 @@
392 #include "fmt.h"
393 #include "fifo.h"
395 +/* Fool auto_uids.o into pulling the uid/gid files from the subdirectory
396 + * "owners" in the current directory. This requires that the command
397 + * "./make-owners ." be executed in the source directory before running
398 + * qmail-hier. This unfortunately hoses up the standard install, and so
399 + * (it will install into the current directory instead of /var/qmail),
400 + * and so it requires the install-path patch for proper operation.
401 + */
402 +char auto_qmail[] = ".";
404 char buf[100 + FMT_ULONG];
406 void dsplit(auto_qmail,base,uid,mode)
407 @@ -30,6 +39,18 @@
408 void hier(auto_qmail)
409 char *auto_qmail;
411 + get_uid(auto_uida);
412 + get_uid(auto_uidd);
413 + get_uid(auto_uidl);
414 + get_uid(auto_uido);
415 + get_uid(auto_uidp);
416 + get_uid(auto_uidq);
417 + get_uid(auto_uidr);
418 + get_uid(auto_uids);
420 + get_gid(auto_gidq);
421 + get_gid(auto_gidn);
423 h(auto_qmail,auto_uido,auto_gidq,0755);
425 d(auto_qmail,"control",auto_uido,auto_gidq,0755);
426 diff -u --new-file qmail-1.03.orig/make-owners.head qmail-1.03/make-owners.head
427 --- qmail-1.03.orig/make-owners.head 1969-12-31 21:00:00.000000000 -0300
428 +++ qmail-1.03/make-owners.head 2005-07-05 14:53:01.707836078 -0300
429 @@ -0,0 +1,34 @@
430 +#!/bin/sh
432 +set -e
433 +dir=$1
434 +if ! [ -d $dir ]
435 +then
436 + echo "usage: make-owners directory"
437 + exit 1
439 +dir=$dir/owners
440 +if ! [ -d $dir ]
441 +then
442 + echo "make-owners: directory '$dir' does not exist, creating."
443 + mkdir $dir
446 +checkuid() {
447 + file=$dir/uid$1
448 + if ! [ -e $file ]; then
449 + echo "make-owners: UID file '$file' does not exist, creating."
450 + touch $file
451 + fi
452 + chown $2 $file
455 +checkgid() {
456 + file=$dir/gid$1
457 + if ! [ -e $file ]; then
458 + echo "make-owners: GID file '$file' does not exist, creating."
459 + touch $file
460 + fi
461 + chgrp $2 $file
464 diff -u --new-file qmail-1.03.orig/prot.c qmail-1.03/prot.c
465 --- qmail-1.03.orig/prot.c 2005-07-05 14:52:39.989185565 -0300
466 +++ qmail-1.03/prot.c 2005-07-05 14:53:01.712834846 -0300
467 @@ -1,10 +1,12 @@
468 #include "hasshsgr.h"
469 #include "prot.h"
470 +#include "auto_uids.h"
472 /* XXX: there are more portability problems here waiting to leap out at me */
474 int prot_gid(gid) int gid;
476 + gid = get_gid(gid);
477 #ifdef HASSHORTSETGROUPS
478 short x[2];
479 x[0] = gid; x[1] = 73; /* catch errors */
480 @@ -17,5 +19,6 @@
482 int prot_uid(uid) int uid;
484 + uid = get_uid(uid);
485 return setuid(uid);
487 diff -u --new-file qmail-1.03.orig/qmail-queue.c qmail-1.03/qmail-queue.c
488 --- qmail-1.03.orig/qmail-queue.c 2005-07-05 14:52:39.902206988 -0300
489 +++ qmail-1.03/qmail-queue.c 2005-07-05 14:53:01.714834354 -0300
490 @@ -73,11 +73,11 @@
491 i = fmt_str(s,"Received: (qmail "); len += i; if (s) s += i;
492 i = fmt_ulong(s,mypid); len += i; if (s) s += i;
493 i = fmt_str(s," invoked "); len += i; if (s) s += i;
494 - if (uid == auto_uida)
495 + if (uid == get_uid(auto_uida))
496 { i = fmt_str(s,"by alias"); len += i; if (s) s += i; }
497 - else if (uid == auto_uidd)
498 + else if (uid == get_uid(auto_uidd))
499 { i = fmt_str(s,"from network"); len += i; if (s) s += i; }
500 - else if (uid == auto_uids)
501 + else if (uid == get_uid(auto_uids))
502 { i = fmt_str(s,"for bounce"); len += i; if (s) s += i; }
503 else
505 Common subdirectories: qmail-1.03.orig/qmail-rhinit and qmail-1.03/qmail-rhinit
506 diff -u --new-file qmail-1.03.orig/qmail-showctl.c qmail-1.03/qmail-showctl.c
507 --- qmail-1.03.orig/qmail-showctl.c 2005-07-05 14:52:39.907205757 -0300
508 +++ qmail-1.03/qmail-showctl.c 2005-07-05 14:53:01.719833123 -0300
509 @@ -164,27 +164,27 @@
510 substdio_puts(subfdout,".\n");
512 substdio_puts(subfdout,"user ids: ");
513 - substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) auto_uida));
514 + substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) get_uid(auto_uida)));
515 substdio_puts(subfdout,", ");
516 - substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) auto_uidd));
517 + substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) get_uid(auto_uidd)));
518 substdio_puts(subfdout,", ");
519 - substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) auto_uidl));
520 + substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) get_uid(auto_uidl)));
521 substdio_puts(subfdout,", ");
522 - substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) auto_uido));
523 + substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) get_uid(auto_uido)));
524 substdio_puts(subfdout,", ");
525 - substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) auto_uidp));
526 + substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) get_uid(auto_uidp)));
527 substdio_puts(subfdout,", ");
528 - substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) auto_uidq));
529 + substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) get_uid(auto_uidq)));
530 substdio_puts(subfdout,", ");
531 - substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) auto_uidr));
532 + substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) get_uid(auto_uidr)));
533 substdio_puts(subfdout,", ");
534 - substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) auto_uids));
535 + substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) get_uid(auto_uids)));
536 substdio_puts(subfdout,".\n");
538 substdio_puts(subfdout,"group ids: ");
539 - substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) auto_gidn));
540 + substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) get_gid(auto_gidn)));
541 substdio_puts(subfdout,", ");
542 - substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) auto_gidq));
543 + substdio_put(subfdout,num,fmt_ulong(num,(unsigned long) get_gid(auto_gidq)));
544 substdio_puts(subfdout,".\n");
546 if (chdir(auto_qmail) == -1) {
547 diff -u --new-file qmail-1.03.orig/spawn.c qmail-1.03/spawn.c
548 --- qmail-1.03.orig/spawn.c 2005-07-05 14:52:39.956193691 -0300
549 +++ qmail-1.03/spawn.c 2005-07-05 14:53:01.722832384 -0300
550 @@ -110,7 +110,7 @@
551 { close(fdmess); err("Zqmail-spawn unable to fstat message. (#4.3.0)\n"); return; }
552 if ((st.st_mode & S_IFMT) != S_IFREG)
553 { close(fdmess); err("ZSorry, message has wrong type. (#4.3.5)\n"); return; }
554 - if (st.st_uid != auto_uidq) /* aaack! qmailq has to be trusted! */
555 + if (st.st_uid != get_uid(auto_uidq)) /* aaack! qmailq has to be trusted! */
556 /* your security is already toast at this point. damage control... */
557 { close(fdmess); err("ZSorry, message has wrong owner. (#4.3.5)\n"); return; }