How is this BSD Auth error possible?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How is this BSD Auth error possible?

William Ahern-2
From /usr/src/lib/libc/gen/auth_subr.c. When using auth_userokay(3) I keep
getting the message "dup of backchannel: Bad file descriptor". Yet, I'm
puzzled how the condition could even occur (the last line is the only place
this message exists in the entire source tree):

        if (socketpair(PF_LOCAL, SOCK_STREAM, 0, pfd) < 0) {
                syslog(LOG_ERR, "unable to create backchannel %m");
                _warnx("internal resource failure");
                goto fail;
        }

        switch (pid = fork()) {
        case -1:
                syslog(LOG_ERR, "%s: %m", path);
                _warnx("internal resource failure");
                close(pfd[0]);
                close(pfd[1]);
                goto fail;
        case 0:
#define COMM_FD 3
#define AUTH_FD 4
                if (dup2(pfd[1], COMM_FD) < 0)
                        err(1, "dup of backchannel");