[uClibc]OpenSSH (static)

Marko Ebert Marko.Ebert at email.si
Wed Apr 10 11:47:54 UTC 2002


Ok... something I found out:
aparently the getopt in uClibc doesn't define optreset (int optreset) 
and since openssh uses optreset it goes and makes it's own getopt.o. 
optreset is (in getopt.c) used in the following fashion:
        if (optreset || !*place) {              /* update scanning 
pointer */
                optreset = 0;
                if (optind >= nargc || *(place = nargv[optind]) != '-') {
                        place = EMSG;
                        return (-1);
                }
                if (place[1] && *++place == '-') {      /* found "--" */
                        ++optind;
                        place = EMSG;
                        return (-1);
                }
        }
and in ssh.c as:
        ac -= optind;
        av += optind;

        if (ac > 0 && !host && **av != '-') {
                if (strchr(*av, '@')) {
                        p = xstrdup(*av);
                        cp = strchr(p, '@');
                        if (cp == NULL || cp == p)
                                usage();
                        options.user = p;
                        *cp = '\0';
                        host = ++cp;
                } else
                        host = *av;
                ac--, av++;
                if (ac > 0) {
                        optind = 0;
                        optreset = 1;
                        goto again;
                }
        }

these are the only occurances of optreset in openssh, but I have no 
idea(yet) what it does. Would it be safe to cut it out of ssh.c? Is it 
maybe in uClibc-0.9.11? btw. I can't seem to log into the cvs (as per 
instructions on the web page)

/M




More information about the uClibc mailing list