Hi, the following patches are in the NetBSD packages collection to get OpenSSH 1.2.2 going. Changes: * /dev/urandom may be there but not in the kernel - make sure * Pull in some more headers needed by configure * Add proper ld-flags for ELF platforms * Some code cleanup * Install example files always to a different dir, and use out build system to DTRT WRT getting them to /etc. Regards, Hubert -- NetBSD - Better for your uptime than Viagra! ---------- Forwarded message ---------- Date: Thu, 27 Jan 2000 18:21:20 +0100 (MET) From: Hubert Feyrer <feyrer at smaug.fh-regensburg.de> To: feyrer at smaug.fh-regensburg.de $NetBSD: patch-aa,v 1.3 2000/01/27 17:12:03 hubertf Exp $ --- configure.orig Thu Jan 27 04:17:06 2000 +++ configure Thu Jan 27 17:02:44 2000 @@ -1271,7 +1271,7 @@ if test "$ssldir" != "/usr"; then CFLAGS="$CFLAGS -I$ssldir/include" - LDFLAGS="$LDFLAGS -L$ssldir/lib" + LDFLAGS="$LDFLAGS -L$ssldir/lib -R$ssldir/lib" fi echo "$ac_t""$ssldir" 1>&6 @@ -2321,7 +2321,9 @@ cat > conftest.$ac_ext <<EOF #line 2323 "configure" #include "confdefs.h" +#include <sys/types.h> #include <netinet/in.h> +#include <netinet/in6.h> int main() { struct sockaddr_in6 s; s.sin6_family = 0; ; return 0; } @@ -2349,7 +2351,9 @@ cat > conftest.$ac_ext <<EOF #line 2351 "configure" #include "confdefs.h" +#include <sys/types.h> #include <netinet/in.h> +#include <netinet/in6.h> int main() { struct in6_addr s; s.s6_addr[0] = 0; ; return 0; } @@ -2545,7 +2549,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: Cannot check for file existence when cross compiling" 1>&2; exit 1; } else - if test -r "/dev/urandom"; then + if test -r "/dev/urandom" && dd if=/dev/urandom of=/dev/null bs=1 count=1; then eval "ac_cv_file_$ac_safe=yes" else eval "ac_cv_file_$ac_safe=no" $NetBSD: patch-ab,v 1.1 2000/01/17 05:34:34 christos Exp $ --- fake-getaddrinfo.c.orig Sun Jan 16 23:45:39 2000 +++ fake-getaddrinfo.c Sun Jan 16 23:47:45 2000 @@ -41,7 +41,7 @@ do { next = ai->ai_next; free(ai); - } while (ai = next); + } while ((ai = next) != NULL); } #endif /* !HAVE_FREEADDRINFO */ @@ -53,8 +53,8 @@ { struct addrinfo *ai; - if (ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + - sizeof(struct sockaddr_in))) { + if ((ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + + sizeof(struct sockaddr_in))) != NULL) { memset(ai, 0, sizeof(struct addrinfo) + sizeof(struct sockaddr_in)); ai->ai_addr = (struct sockaddr *)(ai + 1); /* XXX -- ssh doesn't use sa_len */ @@ -83,25 +83,27 @@ else port = 0; if (hints && hints->ai_flags & AI_PASSIVE) - if (*res = malloc_ai(port, htonl(0x00000000))) + if ((*res = malloc_ai(port, htonl(0x00000000))) != NULL) return 0; else return EAI_MEMORY; - if (!hostname) - if (*res = malloc_ai(port, htonl(0x7f000001))) + if (!hostname) { + if ((*res = malloc_ai(port, htonl(0x7f000001))) != NULL) return 0; else return EAI_MEMORY; - if (inet_addr(hostname) != -1) - if (*res = malloc_ai(port, inet_addr(hostname))) + } + if (inet_addr(hostname) != -1) { + if ((*res = malloc_ai(port, inet_addr(hostname))) != NULL) return 0; else return EAI_MEMORY; + } if ((hp = gethostbyname(hostname)) && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) { for (i = 0; hp->h_addr_list[i]; i++) - if (cur = malloc_ai(port, - ((struct in_addr *)hp->h_addr_list[i])->s_addr)) { + if ((cur = malloc_ai(port, + ((struct in_addr *)hp->h_addr_list[i])->s_addr)) != NULL) { if (prev) prev->ai_next = cur; else $NetBSD: patch-ad,v 1.1 2000/01/17 05:34:34 christos Exp $ --- fake-getnameinfo.c.orig Sun Jan 16 23:45:45 2000 +++ fake-getnameinfo.c Sun Jan 16 23:48:01 2000 @@ -37,25 +37,27 @@ else strcpy(serv, tmpserv); } - if (host) - if (flags & NI_NUMERICHOST) + if (host) { + if (flags & NI_NUMERICHOST) { if (strlen(inet_ntoa(sin->sin_addr)) > hostlen) return EAI_MEMORY; else { strcpy(host, inet_ntoa(sin->sin_addr)); return 0; } - else - if (hp = gethostbyaddr((char *)&sin->sin_addr, sizeof(struct in_addr), - AF_INET)) + } else { + if ((hp = gethostbyaddr((char *)&sin->sin_addr, sizeof(struct in_addr), + AF_INET)) != NULL) { if (strlen(hp->h_name) > hostlen) return EAI_MEMORY; else { strcpy(host, hp->h_name); return 0; } - else + } else return EAI_NODATA; + } + } return 0; } #endif /* !HAVE_GETNAMEINFO */ $NetBSD: patch-ag,v 1.2 2000/01/27 17:12:05 hubertf Exp $ --- uidswap.c.orig Thu Jan 20 14:18:16 2000 +++ uidswap.c Thu Jan 27 17:04:38 2000 @@ -26,8 +26,10 @@ is not part of the posix specification. */ #define SAVED_IDS_WORK_WITH_SETEUID +#ifdef SAVED_IDS_WORK_WITH_SETEUID /* Saved effective uid. */ static uid_t saved_euid = 0; +#endif #endif /* _POSIX_SAVED_IDS */ $NetBSD: patch-ah,v 1.2 2000/01/27 17:12:05 hubertf Exp $ --- Makefile.in.orig Thu Jan 27 04:15:48 2000 +++ Makefile.in Thu Jan 27 17:07:34 2000 @@ -6,6 +6,7 @@ mandir=@mandir@ mansubdir=@mansubdir@ sysconfdir=@sysconfdir@ +examplesdir=@prefix@/share/examples/ssh piddir=@piddir@ srcdir=@srcdir@ top_srcdir=@top_srcdir@ @@ -130,16 +131,16 @@ $(INSTALL) -s @GNOME_ASKPASS@ $(DESTDIR)${ASKPASS_LOCATION} ; \ fi - if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config -a ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \ - $(INSTALL) -d $(DESTDIR)$(sysconfdir); \ - $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \ - $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \ + if [ ! -f $(DESTDIR)$(examplesdir)/ssh_config -a ! -f $(DESTDIR)$(examplesdir)/sshd_config ]; then \ + $(INSTALL) -d $(DESTDIR)$(examplesdir); \ + $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(examplesdir)/ssh_config; \ + $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(examplesdir)/sshd_config; \ fi uninstallall: uninstall - -rm -f $(DESTDIR)$(sysconfdir)/ssh_config - -rm -f $(DESTDIR)$(sysconfdir)/sshd_config - -rmdir $(DESTDIR)$(sysconfdir) + -rm -f $(DESTDIR)$(examplesdir)/ssh_config + -rm -f $(DESTDIR)$(examplesdir)/sshd_config + -rmdir $(DESTDIR)$(examplesdir) -rmdir $(DESTDIR)$(bindir) -rmdir $(DESTDIR)$(sbindir) -rmdir $(DESTDIR)$(mandir)/$(mansubdir)1