Patch to use Dante socks library
David Rankin
drankin at bohemians.lexington.ky.us
Thu Dec 30 03:32:40 EST 1999
Since I use the Dante SOCKS library (instead of the NEC libraries), I
decided to hack support for them into OpenSSH. Here is the results.
Thanks,
David
$NetBSD$
--- configure.in.orig Wed Dec 29 08:37:01 1999
+++ configure.in Wed Dec 29 08:37:25 1999
@@ -334,6 +341,20 @@
AC_MSG_WARN([*** Disabling lastlog support *** ])
AC_DEFINE(DISABLE_LASTLOG)
fi
+
+dnl Compile with dante SOCKS library
+AC_ARG_WITH(dante,
+ [ --with-dante=DIR Use Dante SOCKS lib (default is system library path)],
+ [
+ AC_DEFINE(HAVE_DANTE)
+ if test "x$withval" != "xno" ; then
+ if test -n $withval ; then
+ LIBS="$LIBS -L$withval"
+ fi
+ LIBS="$LIBS -lsocks"
+ fi
+ ]
+)
AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX))
AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC))
$NetBSD$
--- acconfig.h.orig Mon Dec 27 23:09:36 1999
+++ acconfig.h Wed Dec 29 08:57:46 1999
@@ -24,6 +24,9 @@
/* Are we using the Entropy gathering daemon */
#undef HAVE_EGD
+/* Define if using the Dante SOCKS library. */
+#undef HAVE_DANTE
+
/* Define if your ssl headers are included with #include <ssl/header.h> */
#undef HAVE_SSL
--- ssh.h.orig Tue Dec 21 08:12:39 1999
+++ ssh.h Wed Dec 29 10:12:31 1999
@@ -267,6 +267,53 @@
#define SSH_CMSG_HAVE_KERBEROS_TGT 44 /* credentials (s) */
#define SSH_CMSG_HAVE_AFS_TOKEN 65 /* token (s) */
+/*
+ * The following defines map the normal socket operations to SOCKSified
+ * versions coming from the Dante package.
+ */
+
+#ifdef HAVE_DANTE
+#define accept Raccept
+#define bind Rbind
+#define bindresvport Rbindresvport
+#define connect Rconnect
+#define gethostbyname Rgethostbyname
+#define gethostbyname2 Rgethostbyname2
+#define getpeername Rgetpeername
+#define getsockname Rgetsockname
+#define read Rread
+#define readv Rreadv
+#define recv Rrecv
+#define recvmsg Rrecvmsg
+#define recvfrom Rrecvfrom
+#define rresvport Rrresvport
+#define send Rsend
+#define sendmsg Rsendmsg
+#define sendto Rsendto
+#define write Rwrite
+#define writev Rwritev
+int Raccept (int, struct sockaddr *, socklen_t *);
+int Rbind (int, const struct sockaddr *, socklen_t);
+int Rbindresvport(int , struct sockaddr_in *);
+int Rconnect (int, const struct sockaddr *, socklen_t);
+struct hostent *Rgethostbyname(const char *);
+struct hostent *Rgethostbyname2(const char *, int);
+int Rgetpeername (int, struct sockaddr *, socklen_t *);
+int Rgetsockname (int, struct sockaddr *, socklen_t *);
+ssize_t Rread(int , void *, size_t );
+ssize_t Rreadv(int d, const struct iovec *iov, int iovcnt);
+ssize_t Rrecv (int, void *, size_t, int);
+ssize_t Rrecvfrom (int, void *, size_t, int, struct sockaddr *,
+ socklen_t *);
+ssize_t Rsend (int, const void *, size_t, int);
+ssize_t Rsendmsg (int, const struct msghdr *, int);
+ssize_t Rsendto (int, const void *,
+ size_t, int, const struct sockaddr *, socklen_t);
+ssize_t Rwrite(int , const void *, size_t );
+ssize_t Rwritev(int , const struct iovec *, int );
+iovcnt
+#endif /* HAVE_DANTE */
+
/*------------ definitions for login.c -------------*/
/*
--- INSTALL.orig Wed Dec 29 10:38:23 1999
+++ INSTALL Wed Dec 29 10:53:51 1999
@@ -15,6 +15,12 @@
PAM:
http://www.kernel.org/pub/linux/libs/pam/
+Dante:
+http://www.inet.no/dante
+
+OpenSSH can also use the Dante SOCKS libraries, version 1.1.1pre1 or higher,
+if you have them installed on your system.
+
If you wish to build the GNOME passphrase requester, you will need the GNOME
libraries and headers.
@@ -104,6 +110,10 @@
--with-md5-passwords will enable the use of MD5 passwords. Enable this
if your operating system uses MD5 passwords without using PAM.
+
+--with-dante[=DIR] will enable Dante SOCKS library support. If the Dante
+libsocks library isn't installed in a library searched by the compiler,
+add the directory name as the option.
If you need to pass special options to the compiler or linker, you
can specify these as enviornment variables before running ./configure.
--- README.orig Wed Dec 29 10:33:29 1999
+++ README Wed Dec 29 10:56:27 1999
@@ -14,7 +14,9 @@
for OpenBSD library functions that are (regrettably) absent from
other unices. This port has been best tested on Linux, Solaris and
HPUX, though support for AIX and Irix is underway. This version
-actively tracks changes in the OpenBSD CVS repository.
+actively tracks changes in the OpenBSD CVS repository. This port
+also has optional support for using the Dante SOCKS library[6],
+version 1.1.1pre1 or later.
The PAM support is now more functional than the popular packages of
commercial ssh-1.2.x. It checks "account" and "session" modules for
@@ -25,11 +27,11 @@
bsd-*.[ch] is from the OpenBSD project and has its own license (again,
see the source files for details).
-OpenSSH depends on Zlib[2], OpenSSL[3] and optionally PAM[4]. To build
-the GNOME[5] pass-phrase requester (--with-gnome-askpass), you will
-need the GNOME libraries installed. If you are building OpenSSH on a
-Unix which lacks a kernel random number pool (/dev/random), you will
-need to install EGD[1].
+OpenSSH depends on Zlib[2], OpenSSL[3] and optionally PAM[4] and
+Dante[6]. To build the GNOME[5] pass-phrase requester
+(--with-gnome-askpass), you will need the GNOME libraries installed.
+If you are building OpenSSH on a Unix which lacks a kernel random
+number pool (/dev/random), you will need to install EGD[1].
There is now a mailing list for this port of OpenSSH. To
subscribe, send a message consisting of the word 'SUBSCRIBE' to
@@ -71,4 +73,5 @@
[3] http://www.openssl.org/
[4] http://www.kernel.org/pub/linux/libs/pam/ (PAM is standard on Solaris)
[5] http://www.gnome.org/
+[6] http://www.inet.no/dante
More information about the openssh-unix-dev
mailing list