EGD socket problem ...

Marc G. Fournier marc.fournier at acadiau.ca
Sat Nov 20 05:55:43 EST 1999


Just tried out ssh in pre13, and still get the EGD problem? :(

new-relay:/usr/slocal/src/openssh-1.2pre13> ./ssh -l marc atelier
The authenticity of host 'atelier.acadiau.ca' can't be established.
Key fingerprint is 1024 ef:36:b5:f8:a3:bb:14:4d:a9:4b:f2:90:9a:bd:bb:00.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'atelier.acadiau.ca,131.162.138.223' to the list of known hosts.
Couldn't connect to EGD socket "/var/run/random": Socket operation on non-socket

This is under Solaris 7/x86, with HAVE_EGD defined...not good with sockets
without my bible in front of me, so can't play with this until at least
Sunday :(  The problem appears to be, in here, with the error generated by
the 'fatal:' result when connect() is tested:

        char egd_message[2] = { 0x02, 0x00 };
        struct sockaddr_un addr;
        int addr_len;

        memset(&addr, '\0', sizeof(addr));
        addr.sun_family = AF_UNIX;

        /* FIXME: compile time check? */
        if (sizeof(RANDOM_POOL) > sizeof(addr.sun_path))
                fatal("Random pool path is too long");

        strncpy(addr.sun_path, RANDOM_POOL, sizeof(addr.sun_path - 1));
        addr.sun_path[sizeof(addr.sun_path - 1)] = '\0';

        addr_len = offsetof(struct sockaddr_un, sun_path) + sizeof(RANDOM_POOL);

        random_pool = socket(AF_UNIX, SOCK_STREAM, 0);

        if (random_pool == -1)
                fatal("Couldn't create AF_UNIX socket: %s", strerror(errno));

        if (connect(random_pool, (struct sockaddr*)&addr, addr_len) == -1)
                fatal("Couldn't connect to EGD socket \"%s\": %s", RANDOM_POOL, strerror(errno));

        if (len > 255)
                fatal("Too many bytes to read from EGD");

        /* Send blocking read request to EGD */
        egd_message[1] = len;
        c = write(random_pool, egd_message, sizeof(egd_message));
        if (c == -1)
                fatal("Couldn't write to EGD socket \"%s\": %s", RANDOM_POOL, strerror(errno));



Marc G. Fournier                                 marc.fournier at acadiau.ca
Senior Systems Administrator                            Acadia University

  "These are my opinions, which are not necessarily shared by my employer"






More information about the openssh-unix-dev mailing list