29void report(buffer *log,
int wstat,
char *s,
int len)
32 if (wait_crashed(wstat)) { buffer_putsflush(log,
"Zqmail-lspawn: qmail-local crashed.\n");
return; }
34 switch (wait_exitcode(wstat)) {
36 buffer_putsflush(log,
"Zqmail-lspawn: Trouble reading users/assign.cdb.\n");
return;
38 buffer_putsflush(log,
"Zqmail-lspawn: Out of memory.\n");
return;
40 buffer_putsflush(log,
"Zqmail-lspawn: Temporary failure.\n");
return;
42 buffer_putsflush(log,
"Zqmail-lspawn: Unable to find alias user!\n");
return;
44 buffer_putsflush(log,
"Zqmail-lspawn: Not allowed to perform deliveries as root.\n");
return;
46 buffer_putsflush(log,
"Zqmail-lspawn: Internal bug.\n");
return;
48 buffer_putsflush(log,
"Zqmail-lspawn: NFS failure in qmail-local.\n");
return;
50 buffer_putsflush(log,
"Dqmail-lspawn: Unable to run qmail-local.\n");
return;
52 buffer_putsflush(log,
"Zqmail-lspawn: Unable to run qmail-local.\n");
return;
54 buffer_putsflush(log,
"Zqmail-lspawn: Unable to run qmail-getpw.\n");
return;
55 case 111:
case 71:
case 74:
case 75:
56 buffer_put(log,
"Z",1);
break;
58 buffer_put(log,
"K",1);
break;
61 buffer_put(log,
"D",1);
break;
64 for (i = 0; i < len; ++i)
76static void nughde_get(
char *
local)
93 fd = open_read(
"users/assign.cdb");
102 r = cdb_find(&c,
"",0);
114 r = cdb_find(&c,
lower.s,i);
118 nughde.len = cdb_datalen(&c);
136 args[0] =
"bin/qmail-getpw";
139 switch (gpwpid = fork()) {
154 if (wait_pid(&gpwstat,gpwpid) != -1) {
156 if (wait_exitcode(gpwstat) != 0)
_exit(wait_exitcode(gpwstat));
160int spawn(
int fdmess,
int fdout,
const char *s,
char *r,
const int at)
183 args[0] =
"bin/qmail-local";
186 n = byte_chr(x,xlen,0);
193 n = byte_chr(x,xlen,0);
200 n = byte_chr(x,xlen,0);
206 n = byte_chr(x,xlen,0);
213 n = byte_chr(x,xlen,0);
219 n = byte_chr(x,xlen,0);
224 args[7] = r + at + 1;
int stralloc_copys(stralloc *, char const *)
int spawn(int fdmess, int fdout, const char *s, char *r, const int at)
void report(buffer *log, int wstat, char *s, int len)
void initialize(int argc, char **argv)