diff --git a/ChangeLog b/ChangeLog index 7ac2bf354..d50091bc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -20000131 +20010131 - (djm) OpenBSD CVS Sync: - djm@cvs.openbsd.org 2001/01/30 15:48:53 [sshconnect.c] @@ -8,8 +8,11 @@ respectively. - (djm) Don't log SSH2 PAM KbdInt responses to debug, they may contain passwords. + - (bal) Reorder. Move all bsd-*, fake-*, next-*, and cygwin* stuff to + openbsd-compat/. And resolve all ./configure and Makefile.in issues + assocated. -20000130 +20010130 - (djm) OpenBSD CVS Sync: - markus@cvs.openbsd.org 2001/01/29 09:55:37 [channels.c channels.h clientloop.c serverloop.c] @@ -26,7 +29,7 @@ Allow invocation of sybsystem by commandline (-s); ok markus@ - (stevesk) configure.in: remove duplicate PROG_LS -20000129 +20010129 - (stevesk) sftp-server.c: use %lld vs. %qd 20010128 diff --git a/Makefile.in b/Makefile.in index 58d67a5d5..063fa5c70 100644 --- a/Makefile.in +++ b/Makefile.in @@ -19,7 +19,7 @@ CC=@CC@ LD=@LD@ PATHS=-DETCDIR=\"$(sysconfdir)\" -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" -D_PATH_SSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" CFLAGS=@CFLAGS@ -CPPFLAGS=@CPPFLAGS@ -I. -I$(srcdir) $(PATHS) @DEFS@ +CPPFLAGS=@CPPFLAGS@ -I. -Iopenbsd-compat/ -I$(srcdir) $(PATHS) @DEFS@ LIBS=@LIBS@ AR=@AR@ RANLIB=@RANLIB@ @@ -27,7 +27,7 @@ INSTALL=@INSTALL@ PERL=@PERL@ ENT=@ENT@ XAUTH_PATH=@XAUTH_PATH@ -LDFLAGS=-L. @LDFLAGS@ +LDFLAGS=-L. -Lopenbsd-compat/ @LDFLAGS@ EXEEXT=@EXEEXT@ SSH_MODE= @SSHMODE@ @@ -37,9 +37,7 @@ INSTALL_SSH_PRNG_CMDS=@INSTALL_SSH_PRNG_CMDS@ TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-agent$(EXEEXT) scp$(EXEEXT) $(SFTP-SERVER) -LIBSSH_OBJS=atomicio.o authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o cipher.o cli.o compat.o compress.o crc32.o cygwin_util.o deattack.o dispatch.o hmac.o hostfile.o key.o kex.o log.o match.o misc.o mpaux.o nchan.o packet.o radix.o rijndael.o entropy.o readpass.o rsa.o ssh-dss.o ssh-rsa.o tildexpand.o ttymodes.o uidswap.o uuencode.o xmalloc.o - -LIBOPENBSD_COMPAT_OBJS=bsd-arc4random.o bsd-base64.o bsd-bindresvport.o bsd-daemon.o bsd-getcwd.o bsd-getgrouplist.o bsd-inet_aton.o bsd-inet_ntoa.o bsd-misc.o bsd-mktemp.o bsd-realpath.o bsd-rresvport.o bsd-setenv.o bsd-sigaction.o bsd-snprintf.o bsd-strlcat.o bsd-strlcpy.o bsd-strmode.o bsd-strsep.o bsd-strtok.o bsd-vis.o bsd-setproctitle.o bsd-waitpid.o fake-getaddrinfo.o fake-getnameinfo.o next-posix.o +LIBSSH_OBJS=atomicio.o authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o cipher.o cli.o compat.o compress.o crc32.o deattack.o dispatch.o hmac.o hostfile.o key.o kex.o log.o match.o misc.o mpaux.o nchan.o packet.o radix.o rijndael.o entropy.o readpass.o rsa.o ssh-dss.o ssh-rsa.o tildexpand.o ttymodes.o uidswap.o uuencode.o xmalloc.o SSHOBJS= ssh.o sshconnect.o sshconnect1.o sshconnect2.o log-client.o readconf.o clientloop.o @@ -79,9 +77,8 @@ $(LIBOPENBSD_COMPAT_OBJS): config.h .c.o: $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -libopenbsd-compat.a: $(LIBOPENBSD_COMPAT_OBJS) - $(AR) rv $@ $(LIBOPENBSD_COMPAT_OBJS) - $(RANLIB) $@ +libopenbsd-compat.a: + (cd openbsd-compat; make) libssh.a: $(LIBSSH_OBJS) $(AR) rv $@ $(LIBSSH_OBJS) @@ -119,10 +116,12 @@ $(MANPAGES) $(CONFIGFILES):: $(FIXPATHSCMD) $(srcdir)/$@ clean: + (cd openbsd-compat; make clean) rm -f *.o *.a $(TARGETS) logintest config.cache config.log rm -f *.out core distclean: clean + (cd openbsd-compat; make distclean) rm -f Makefile config.h config.status ssh_prng_cmds *~ mrproper: distclean diff --git a/configure.in b/configure.in index d9f59a315..9913442ac 100644 --- a/configure.in +++ b/configure.in @@ -1641,7 +1641,7 @@ fi AC_EXEEXT -AC_OUTPUT(Makefile ssh_prng_cmds) +AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds) # Print summary of options diff --git a/includes.h b/includes.h index 18693c7f0..ac83a12f0 100644 --- a/includes.h +++ b/includes.h @@ -21,7 +21,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #include "config.h" -#include "next-posix.h" +#include "bsd-nextstep.h" #include #include @@ -95,7 +95,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } #endif #include "version.h" #include "openbsd-compat.h" -#include "cygwin_util.h" +#include "bsd-cygwin_util.h" #include "entropy.h" #endif /* INCLUDES_H */ diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in new file mode 100644 index 000000000..1c745fb8c --- /dev/null +++ b/openbsd-compat/Makefile.in @@ -0,0 +1,33 @@ +sysconfdir=@sysconfdir@ +piddir=@piddir@ +srcdir=@srcdir@ +top_srcdir=@top_srcdir@ + +CC=@CC@ +LD=@LD@ +CFLAGS=@CFLAGS@ +CPPFLAGS=@CPPFLAGS@ -I. -I.. -I$(srcdir) @DEFS@ +LIBS=@LIBS@ +AR=@AR@ +RANLIB=@RANLIB@ +INSTALL=@INSTALL@ +LDFLAGS=-L. @LDFLAGS@ + +OPENBSD=base64.o bindresvport.o daemon.o getcwd.o getgrouplist.o inet_aton.o inet_ntoa.o mktemp.o realpath.o rresvport.o setenv.o setproctitle.o sigaction.o strlcat.o strlcpy.o strmode.o strsep.o strtok.o vis.o + +COMPAT=bsd-arc4random.o bsd-cygwin_util.o bsd-misc.o bsd-nextstep.o bsd-snprintf.o bsd-waitpid.o fake-getaddrinfo.o fake-getnameinfo.o + + +all: libopenbsd-compat.a + +$(BSDCOMPAT): ../config.h + +libopenbsd-compat.a: $(COMPAT) $(OPENBSD) + $(AR) rv $@ $(COMPAT) $(OPENBSD) + $(RANLIB) $@ + +clean: + rm -f *.o *.a core + +distclean: clean + rm -f Makefile *~ diff --git a/bsd-base64.c b/openbsd-compat/base64.c similarity index 99% rename from bsd-base64.c rename to openbsd-compat/base64.c index 8cbf8eeef..d12b993b7 100644 --- a/bsd-base64.c +++ b/openbsd-compat/base64.c @@ -58,7 +58,7 @@ #include #include -#include "bsd-base64.h" +#include "base64.h" #define Assert(Cond) if (!(Cond)) abort() diff --git a/bsd-base64.h b/openbsd-compat/base64.h similarity index 100% rename from bsd-base64.h rename to openbsd-compat/base64.h diff --git a/bsd-bindresvport.c b/openbsd-compat/bindresvport.c similarity index 100% rename from bsd-bindresvport.c rename to openbsd-compat/bindresvport.c diff --git a/bsd-bindresvport.h b/openbsd-compat/bindresvport.h similarity index 100% rename from bsd-bindresvport.h rename to openbsd-compat/bindresvport.h diff --git a/bsd-arc4random.c b/openbsd-compat/bsd-arc4random.c similarity index 100% rename from bsd-arc4random.c rename to openbsd-compat/bsd-arc4random.c diff --git a/bsd-arc4random.h b/openbsd-compat/bsd-arc4random.h similarity index 100% rename from bsd-arc4random.h rename to openbsd-compat/bsd-arc4random.h diff --git a/cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c similarity index 100% rename from cygwin_util.c rename to openbsd-compat/bsd-cygwin_util.c diff --git a/cygwin_util.h b/openbsd-compat/bsd-cygwin_util.h similarity index 100% rename from cygwin_util.h rename to openbsd-compat/bsd-cygwin_util.h diff --git a/bsd-misc.c b/openbsd-compat/bsd-misc.c similarity index 100% rename from bsd-misc.c rename to openbsd-compat/bsd-misc.c diff --git a/bsd-misc.h b/openbsd-compat/bsd-misc.h similarity index 100% rename from bsd-misc.h rename to openbsd-compat/bsd-misc.h diff --git a/next-posix.c b/openbsd-compat/bsd-nextstep.c similarity index 100% rename from next-posix.c rename to openbsd-compat/bsd-nextstep.c diff --git a/next-posix.h b/openbsd-compat/bsd-nextstep.h similarity index 100% rename from next-posix.h rename to openbsd-compat/bsd-nextstep.h diff --git a/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c similarity index 100% rename from bsd-snprintf.c rename to openbsd-compat/bsd-snprintf.c diff --git a/bsd-snprintf.h b/openbsd-compat/bsd-snprintf.h similarity index 100% rename from bsd-snprintf.h rename to openbsd-compat/bsd-snprintf.h diff --git a/bsd-waitpid.c b/openbsd-compat/bsd-waitpid.c similarity index 100% rename from bsd-waitpid.c rename to openbsd-compat/bsd-waitpid.c diff --git a/bsd-waitpid.h b/openbsd-compat/bsd-waitpid.h similarity index 100% rename from bsd-waitpid.h rename to openbsd-compat/bsd-waitpid.h diff --git a/bsd-daemon.c b/openbsd-compat/daemon.c similarity index 100% rename from bsd-daemon.c rename to openbsd-compat/daemon.c diff --git a/bsd-daemon.h b/openbsd-compat/daemon.h similarity index 100% rename from bsd-daemon.h rename to openbsd-compat/daemon.h diff --git a/fake-gai-errnos.h b/openbsd-compat/fake-gai-errnos.h similarity index 100% rename from fake-gai-errnos.h rename to openbsd-compat/fake-gai-errnos.h diff --git a/fake-getaddrinfo.c b/openbsd-compat/fake-getaddrinfo.c similarity index 100% rename from fake-getaddrinfo.c rename to openbsd-compat/fake-getaddrinfo.c diff --git a/fake-getaddrinfo.h b/openbsd-compat/fake-getaddrinfo.h similarity index 100% rename from fake-getaddrinfo.h rename to openbsd-compat/fake-getaddrinfo.h diff --git a/fake-getnameinfo.c b/openbsd-compat/fake-getnameinfo.c similarity index 100% rename from fake-getnameinfo.c rename to openbsd-compat/fake-getnameinfo.c diff --git a/fake-getnameinfo.h b/openbsd-compat/fake-getnameinfo.h similarity index 100% rename from fake-getnameinfo.h rename to openbsd-compat/fake-getnameinfo.h diff --git a/fake-regex.h b/openbsd-compat/fake-regex.h similarity index 100% rename from fake-regex.h rename to openbsd-compat/fake-regex.h diff --git a/fake-socket.h b/openbsd-compat/fake-socket.h similarity index 100% rename from fake-socket.h rename to openbsd-compat/fake-socket.h diff --git a/bsd-getcwd.c b/openbsd-compat/getcwd.c similarity index 100% rename from bsd-getcwd.c rename to openbsd-compat/getcwd.c diff --git a/bsd-getcwd.h b/openbsd-compat/getcwd.h similarity index 100% rename from bsd-getcwd.h rename to openbsd-compat/getcwd.h diff --git a/bsd-getgrouplist.c b/openbsd-compat/getgrouplist.c similarity index 100% rename from bsd-getgrouplist.c rename to openbsd-compat/getgrouplist.c diff --git a/bsd-getgrouplist.h b/openbsd-compat/getgrouplist.h similarity index 100% rename from bsd-getgrouplist.h rename to openbsd-compat/getgrouplist.h diff --git a/bsd-inet_aton.c b/openbsd-compat/inet_aton.c similarity index 100% rename from bsd-inet_aton.c rename to openbsd-compat/inet_aton.c diff --git a/bsd-inet_aton.h b/openbsd-compat/inet_aton.h similarity index 100% rename from bsd-inet_aton.h rename to openbsd-compat/inet_aton.h diff --git a/bsd-inet_ntoa.c b/openbsd-compat/inet_ntoa.c similarity index 100% rename from bsd-inet_ntoa.c rename to openbsd-compat/inet_ntoa.c diff --git a/bsd-inet_ntoa.h b/openbsd-compat/inet_ntoa.h similarity index 100% rename from bsd-inet_ntoa.h rename to openbsd-compat/inet_ntoa.h diff --git a/bsd-mktemp.c b/openbsd-compat/mktemp.c similarity index 100% rename from bsd-mktemp.c rename to openbsd-compat/mktemp.c diff --git a/bsd-mktemp.h b/openbsd-compat/mktemp.h similarity index 100% rename from bsd-mktemp.h rename to openbsd-compat/mktemp.h diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h new file mode 100644 index 000000000..4758a9c59 --- /dev/null +++ b/openbsd-compat/openbsd-compat.h @@ -0,0 +1,37 @@ +#ifndef _OPENBSD_H +#define _OPENBSD_H + +#include "config.h" + +/* OpenBSD function replacements */ +#include "bindresvport.h" +#include "getcwd.h" +#include "realpath.h" +#include "rresvport.h" +#include "strlcpy.h" +#include "strlcat.h" +#include "strmode.h" +#include "mktemp.h" +#include "daemon.h" +#include "base64.h" +#include "sigaction.h" +#include "inet_aton.h" +#include "inet_ntoa.h" +#include "strsep.h" +#include "strtok.h" +#include "vis.h" +#include "setproctitle.h" +#include "getgrouplist.h" + +/* Home grown routines */ +#include "bsd-arc4random.h" +#include "bsd-misc.h" +#include "bsd-snprintf.h" +#include "bsd-waitpid.h" + +/* rfc2553 socket API replacements */ +#include "fake-getaddrinfo.h" +#include "fake-getnameinfo.h" +#include "fake-socket.h" + +#endif /* _OPENBSD_H */ diff --git a/bsd-queue.h b/openbsd-compat/queue.h similarity index 100% rename from bsd-queue.h rename to openbsd-compat/queue.h diff --git a/bsd-realpath.c b/openbsd-compat/realpath.c similarity index 100% rename from bsd-realpath.c rename to openbsd-compat/realpath.c diff --git a/bsd-realpath.h b/openbsd-compat/realpath.h similarity index 100% rename from bsd-realpath.h rename to openbsd-compat/realpath.h diff --git a/bsd-rresvport.c b/openbsd-compat/rresvport.c similarity index 100% rename from bsd-rresvport.c rename to openbsd-compat/rresvport.c diff --git a/bsd-rresvport.h b/openbsd-compat/rresvport.h similarity index 100% rename from bsd-rresvport.h rename to openbsd-compat/rresvport.h diff --git a/bsd-setenv.c b/openbsd-compat/setenv.c similarity index 100% rename from bsd-setenv.c rename to openbsd-compat/setenv.c diff --git a/bsd-setenv.h b/openbsd-compat/setenv.h similarity index 100% rename from bsd-setenv.h rename to openbsd-compat/setenv.h diff --git a/bsd-setproctitle.c b/openbsd-compat/setproctitle.c similarity index 100% rename from bsd-setproctitle.c rename to openbsd-compat/setproctitle.c diff --git a/bsd-setproctitle.h b/openbsd-compat/setproctitle.h similarity index 100% rename from bsd-setproctitle.h rename to openbsd-compat/setproctitle.h diff --git a/bsd-sigaction.c b/openbsd-compat/sigaction.c similarity index 99% rename from bsd-sigaction.c rename to openbsd-compat/sigaction.c index d6966d4fd..47d853fe4 100644 --- a/bsd-sigaction.c +++ b/openbsd-compat/sigaction.c @@ -35,7 +35,7 @@ #include #include "config.h" -#include "bsd-sigaction.h" +#include "sigaction.h" /* This file provides sigaction() emulation using sigvec() */ /* Use only if this is non POSIX system */ diff --git a/bsd-sigaction.h b/openbsd-compat/sigaction.h similarity index 100% rename from bsd-sigaction.h rename to openbsd-compat/sigaction.h diff --git a/bsd-strlcat.c b/openbsd-compat/strlcat.c similarity index 100% rename from bsd-strlcat.c rename to openbsd-compat/strlcat.c diff --git a/bsd-strlcat.h b/openbsd-compat/strlcat.h similarity index 100% rename from bsd-strlcat.h rename to openbsd-compat/strlcat.h diff --git a/bsd-strlcpy.c b/openbsd-compat/strlcpy.c similarity index 100% rename from bsd-strlcpy.c rename to openbsd-compat/strlcpy.c diff --git a/bsd-strlcpy.h b/openbsd-compat/strlcpy.h similarity index 100% rename from bsd-strlcpy.h rename to openbsd-compat/strlcpy.h diff --git a/bsd-strmode.c b/openbsd-compat/strmode.c similarity index 100% rename from bsd-strmode.c rename to openbsd-compat/strmode.c diff --git a/bsd-strmode.h b/openbsd-compat/strmode.h similarity index 100% rename from bsd-strmode.h rename to openbsd-compat/strmode.h diff --git a/bsd-strsep.c b/openbsd-compat/strsep.c similarity index 100% rename from bsd-strsep.c rename to openbsd-compat/strsep.c diff --git a/bsd-strsep.h b/openbsd-compat/strsep.h similarity index 100% rename from bsd-strsep.h rename to openbsd-compat/strsep.h diff --git a/bsd-strtok.c b/openbsd-compat/strtok.c similarity index 100% rename from bsd-strtok.c rename to openbsd-compat/strtok.c diff --git a/bsd-strtok.h b/openbsd-compat/strtok.h similarity index 100% rename from bsd-strtok.h rename to openbsd-compat/strtok.h diff --git a/bsd-vis.c b/openbsd-compat/vis.c similarity index 100% rename from bsd-vis.c rename to openbsd-compat/vis.c diff --git a/bsd-vis.h b/openbsd-compat/vis.h similarity index 100% rename from bsd-vis.h rename to openbsd-compat/vis.h