| Summary: | getaddrinfo() in libopenbsd-compat.a breaks heimdal-linked pam_krb5 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Buck Huppmann <buckh> | ||||
| Component: | Miscellaneous | Assignee: | OpenSSH Bugzilla mailing list <openssh-bugs> | ||||
| Status: | CLOSED FIXED | ||||||
| Severity: | normal | CC: | djm | ||||
| Priority: | P2 | ||||||
| Version: | -current | ||||||
| Hardware: | SPARC | ||||||
| OS: | Solaris | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 793 | ||||||
| Attachments: |
|
||||||
Does rebuilding after: LIBS='-lbroken' ./configure help? perhaps. i'll try modifying configure.ac and acconfig.h to get <roken.h> included also, if configure can find em, and let you know if it works. for my purposes, i was content to just rename getaddrinfo in fake-getaddrinfo.c and kludge up fake-getaddrinfo.h: #ifndef HAVE_GETADDRINFO #define getaddrinfo fake_getaddrinfo int fake_getaddrinfo( . . . ) #endif don't know how many other libroken functions i'll pick up if i configure it in and if some of them might be less unbroken than libopenbsd-compat versions. maybe i should just see if i can port GNU libc . . . thanks for the help Should this bug be closed? Created attachment 535 [details]
Add macros for fake getaddrinfo -> ssh_getaddrinfo
Builds stand-alone on Solaris 2.5.1, nm confirms that the functions are
exported as ssh_[function]
Comment on attachment 535 [details]
Add macros for fake getaddrinfo -> ssh_getaddrinfo
I hate doing this sort of thing, but I can't think of a better way.
Applied, thanks. I note that snprintf is in the same boat on Solaris 2.5.1, should we do the same thing with it (ie: is this an actual problem for anyone)? Mass change of RESOLVED bugs to CLOSED |
i realize that fake-getaddrinfo.c says, ``Don't use it for another purpose,'' but if getaddrinfo can't be renamed then stuff like this is inevitable, and i think it might not just be me so i wanted to point it out: heimdal uses the getaddrinfo()-returned ai_protocol, ai_socktype and ai_protocol in its socket() call in send_to_kdc(), after passing in the desired ai_socktype in hints->ai_socktype. on Solaris 2.6, there's no getaddrinfo(), so heimdal builds this into it's libroken and ssh builds this into libopenbsd-compat. when sshd goes to use pam_krb5 for keyboard-interactive, the pam_krb5 calls to heimdal's libkrb5 result in libopenbsd-compat's getaddrinfo() getting called, which always returns a struct addrinfo with ai_socktype == ai_protocol == 0, and socket() buys an EPROTOTYPE: send_to_kdc.c: ret = krb5_krbhst_get_addrinfo(context, hi, &ai); if (ret) continue; for (a = ai; a != NULL; a = a->ai_next) { fd = socket (a->ai_family, a->ai_socktype, a->ai_protocol); if (fd < 0) continue; truss says: so_socket(2, 0, 0, 0x00000000, 1) Err#98 EPROTOTYPE 0x00000000: "" (i have to admit i have absolutely no idea where it's getting ai_family from, if that's what that first parameter is) it would be nice if maybe libopenbsd-compat's getaddrinfo copied ai_family, ai_socktype and ai_protocol to the returned struct addrinfo's. yes, i admit, we need to upgrade