Comment 8 for bug 1593657

Revision history for this message
Seth Arnold (seth-arnold) wrote :

I gave misc.c a quick skim before looking into the kernel:

int
unix_listener(const char *path, int backlog, int unlink_first)
{
        struct sockaddr_un sunaddr;
        int saved_errno, sock;

        memset(&sunaddr, 0, sizeof(sunaddr));
        sunaddr.sun_family = AF_UNIX;
        if (strlcpy(sunaddr.sun_path, path, sizeof(sunaddr.sun_path)) >= sizeof(sunaddr.sun_path)) {
                error("%s: \"%s\" too long for Unix domain socket", __func__,
                    path);
                errno = ENAMETOOLONG;
                return -1;
        }

        sock = socket(PF_UNIX, SOCK_STREAM, 0);
        ...
        if (bind(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) < 0) {

They memset 0 the struct, and pass the size of the struct. So I suspect OpenSSH is fine.

Thanks