#include "addrcheck.h"
#include <errno.h>
#include <unistd.h>
+#include <fcntl.h>
/* #define DEBUG */
#ifdef DEBUG
if (pipe(p) || (kid = fork()) == -1)
return (-1);
if (!kid) {
+ close(0); open("/dev/null", O_RDONLY);
dup2(p[1], 1);
- close(p[0]);
- close(p[1]);
+ close(2); open("/dev/null", O_WRONLY);
+ close(p[0]); close(p[1]);
execl("/usr/bin/userv", "/usr/bin/userv",
"-f", "stdin=/dev/null",
u.s, serv.s,
int at, len, dot;
int err = 0;
uint32 dlen;
+ static stralloc l = STRALLOC_INIT;
len = str_len(addr);
at = str_chr(addr, '@');
return (-1);
if (!err) { *rc = 1; return (0); }
if (dlen != 0) { errno = EINVAL; return (-1); }
-
- return (local(cdb, addr, at, sender, rc));
+ l.len = 0;
+ if (!stralloc_catb(&l, addr, at) ||
+ !stralloc_0(&l))
+ return (-1);
+ return (local(cdb, l.s, l.len - 1, sender, rc));
}
#ifdef TEST