#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,
static stralloc l = STRALLOC_INIT;
len = str_len(addr);
- at = str_chr(addr, '@');
+ at = str_rchr(addr, '@');
if (!addr[at])
return (local(cdb, addr, len, sender, rc));