diff options
Diffstat (limited to 'source/n/telnet')
-rw-r--r-- | source/n/telnet/netkit-telnet-0.17-ayt.patch | 41 | ||||
-rw-r--r-- | source/n/telnet/netkit-telnet-0.17.diff | 10 | ||||
-rw-r--r-- | source/n/telnet/slack-desc | 19 | ||||
-rw-r--r-- | source/n/telnet/telnet-OpenBSD-014_telnet.diff | 322 | ||||
-rw-r--r-- | source/n/telnet/telnet-OpenBSD-20020321.diff | 70 | ||||
-rwxr-xr-x | source/n/telnet/telnet.SlackBuild | 78 |
6 files changed, 540 insertions, 0 deletions
diff --git a/source/n/telnet/netkit-telnet-0.17-ayt.patch b/source/n/telnet/netkit-telnet-0.17-ayt.patch new file mode 100644 index 00000000..943380f7 --- /dev/null +++ b/source/n/telnet/netkit-telnet-0.17-ayt.patch @@ -0,0 +1,41 @@ +--- netkit-telnet-0.17/telnetd/utility.c.ayt Wed Aug 8 16:33:01 2001
++++ netkit-telnet-0.17/telnetd/utility.c Wed Aug 8 17:20:39 2001
+@@ -56,18 +56,25 @@
+ void
+ netoprintf(const char *fmt, ...)
+ {
+- int len, maxsize;
++ int len = 0, maxsize;
+ va_list ap;
+ int done=0;
+
+ while (!done) {
+ maxsize = sizeof(netobuf) - (nfrontp - netobuf);
++ if (maxsize < 0) {
++ /* no way this is gonna fit - try to flush some */
++ netflush();
++ maxsize = sizeof(netobuf) - (nfrontp - netobuf);
++ if (maxsize < 0)
++ break;
++ }
+
+ va_start(ap, fmt);
+ len = vsnprintf(nfrontp, maxsize, fmt, ap);
+ va_end(ap);
+
+- if (len<0 || len==maxsize) {
++ if (len<=0 || len==maxsize) {
+ /* didn't fit */
+ netflush();
+ }
+--- netkit-telnet-0.17/telnetd/telnetd.c.ayt Wed Aug 8 16:33:01 2001
++++ netkit-telnet-0.17/telnetd/telnetd.c Wed Aug 8 17:21:44 2001
+@@ -1277,7 +1277,7 @@
+ return;
+ }
+ #endif
+- netoprintf("\r\n[%s : yes]\r\n", host_name);
++ netoprintf("\r\n[Yes]\r\n");
+ }
+
+ void doeof(void) {
diff --git a/source/n/telnet/netkit-telnet-0.17.diff b/source/n/telnet/netkit-telnet-0.17.diff new file mode 100644 index 00000000..ecd2ba35 --- /dev/null +++ b/source/n/telnet/netkit-telnet-0.17.diff @@ -0,0 +1,10 @@ +--- ./telnetd/utility.c.orig Sun Feb 25 18:20:41 2001 ++++ ./telnetd/utility.c Sun Feb 25 18:20:59 2001 +@@ -41,6 +41,7 @@ + + #include <stdarg.h> + #include <sys/utsname.h> ++#include <time.h> + + #ifdef AUTHENTICATE + #include <libtelnet/auth.h> diff --git a/source/n/telnet/slack-desc b/source/n/telnet/slack-desc new file mode 100644 index 00000000..89ba84c3 --- /dev/null +++ b/source/n/telnet/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +telnet: telnet (the telnet client and daemon) +telnet: +telnet: telnet supports the original DARPA telnet interactive communication +telnet: protocol. As connecting to a telnetd server transmits your password +telnet: over the network in cleartext, telnet's use as a login protocol has +telnet: been mostly superceded by the use of ssh and sshd. However, the +telnet: telnet client is still a very handy tool, and telnetd may still have +telnet: some uses on networks that are known to be secure. +telnet: +telnet: telnet and telnetd were ported from BSD. +telnet: diff --git a/source/n/telnet/telnet-OpenBSD-014_telnet.diff b/source/n/telnet/telnet-OpenBSD-014_telnet.diff new file mode 100644 index 00000000..dee7245d --- /dev/null +++ b/source/n/telnet/telnet-OpenBSD-014_telnet.diff @@ -0,0 +1,322 @@ +Apply by doing: + cd /usr/src + patch -p0 < 014_telnet.patch + +Then rebuild and install telnet: + cd usr.bin/telnet + make obj + make depend + make + make install + +Index: usr.bin/telnet/authenc.c +=================================================================== +RCS file: /cvs/src/usr.bin/telnet/authenc.c,v +retrieving revision 1.6 +retrieving revision 1.6.6.1 +diff -u -p -r1.6 -r1.6.6.1 +--- usr.bin/telnet/authenc.c 3 Jun 2003 02:56:18 -0000 1.6 ++++ usr.bin/telnet/authenc.c 29 Mar 2005 19:49:10 -0000 1.6.6.1 +@@ -80,7 +80,7 @@ telnet_spin() + telnet_getenv(val) + const char *val; + { +- return((char *)env_getvalue((unsigned char *)val)); ++ return((char *)env_getvalue((unsigned char *)val, 0)); + } + + char * +Index: usr.bin/telnet/commands.c +=================================================================== +RCS file: /cvs/src/usr.bin/telnet/commands.c,v +retrieving revision 1.46 +retrieving revision 1.46.4.1 +diff -u -p -r1.46 -r1.46.4.1 +--- usr.bin/telnet/commands.c 28 Dec 2003 21:53:01 -0000 1.46 ++++ usr.bin/telnet/commands.c 29 Mar 2005 19:49:10 -0000 1.46.4.1 +@@ -1821,12 +1821,13 @@ env_default(init, welldefined) + } + + unsigned char * +-env_getvalue(var) ++env_getvalue(var, exported_only) + unsigned char *var; ++ int exported_only; + { + struct env_lst *ep; + +- if ((ep = env_find(var))) ++ if ((ep = env_find(var)) && (!exported_only || ep->export)) + return(ep->value); + return(NULL); + } +Index: usr.bin/telnet/externs.h +=================================================================== +RCS file: /cvs/src/usr.bin/telnet/externs.h,v +retrieving revision 1.13 +retrieving revision 1.13.4.1 +diff -u -p -r1.13 -r1.13.4.1 +--- usr.bin/telnet/externs.h 3 Jan 2004 23:36:14 -0000 1.13 ++++ usr.bin/telnet/externs.h 29 Mar 2005 19:49:10 -0000 1.13.4.1 +@@ -204,7 +204,7 @@ void env_unexport (unsigned char *); + void env_send (unsigned char *); + void env_list (void); + unsigned char * env_default(int init, int welldefined); +-unsigned char * env_getvalue(unsigned char *var); ++unsigned char * env_getvalue(unsigned char *var, int exported_only); + + void set_escape_char(char *s); + unsigned long sourceroute(char *arg, char **cpp, int *lenp); +@@ -336,7 +336,7 @@ void env_opt_add (unsigned char *); + void env_opt_end (int); + + unsigned char *env_default (int, int); +-unsigned char *env_getvalue (unsigned char *); ++unsigned char *env_getvalue (unsigned char *, int); + + int get_status (void); + int dosynch (void); +Index: usr.bin/telnet/telnet.c +=================================================================== +RCS file: /cvs/src/usr.bin/telnet/telnet.c,v +retrieving revision 1.18 +retrieving revision 1.18.4.1 +diff -u -p -r1.18 -r1.18.4.1 +--- usr.bin/telnet/telnet.c 8 Nov 2003 19:17:29 -0000 1.18 ++++ usr.bin/telnet/telnet.c 29 Mar 2005 19:49:10 -0000 1.18.4.1 +@@ -446,7 +446,7 @@ dooption(option) + #endif + + case TELOPT_XDISPLOC: /* X Display location */ +- if (env_getvalue((unsigned char *)"DISPLAY")) ++ if (env_getvalue((unsigned char *)"DISPLAY", 0)) + new_state_ok = 1; + break; + +@@ -682,7 +682,7 @@ gettermname() + resettermname = 0; + if (tnamep && tnamep != unknown) + free(tnamep); +- if ((tname = (char *)env_getvalue((unsigned char *)"TERM")) && ++ if ((tname = (char *)env_getvalue((unsigned char *)"TERM", 0)) && + (setupterm(tname, 1, &errret) == OK)) { + tnamep = mklist(ttytype, tname); + } else { +@@ -859,7 +859,7 @@ suboption() + unsigned char temp[50], *dp; + int len; + +- if ((dp = env_getvalue((unsigned char *)"DISPLAY")) == NULL) { ++ if ((dp = env_getvalue((unsigned char *)"DISPLAY", 0)) == NULL) { + /* + * Something happened, we no longer have a DISPLAY + * variable. So, turn off the option. +@@ -1331,17 +1331,25 @@ slc_check() + } + + +-unsigned char slc_reply[128]; +-unsigned char *slc_replyp; ++static unsigned char slc_reply[2 * SUBBUFSIZE]; ++static unsigned char *slc_replyp; ++ ++ unsigned char ++slc_add(unsigned char ch) ++{ ++ if (slc_replyp == slc_reply + sizeof(slc_reply)) ++ return ch; ++ return *slc_replyp++ = ch; ++} + + void + slc_start_reply() + { + slc_replyp = slc_reply; +- *slc_replyp++ = IAC; +- *slc_replyp++ = SB; +- *slc_replyp++ = TELOPT_LINEMODE; +- *slc_replyp++ = LM_SLC; ++ slc_add(IAC); ++ slc_add(SB); ++ slc_add(TELOPT_LINEMODE); ++ slc_add(LM_SLC); + } + + void +@@ -1350,12 +1358,16 @@ slc_add_reply(func, flags, value) + unsigned char flags; + cc_t value; + { +- if ((*slc_replyp++ = func) == IAC) +- *slc_replyp++ = IAC; +- if ((*slc_replyp++ = flags) == IAC) +- *slc_replyp++ = IAC; +- if ((*slc_replyp++ = (unsigned char)value) == IAC) +- *slc_replyp++ = IAC; ++ if (slc_replyp + 6 >= slc_reply + sizeof(slc_reply)) { ++ printf("slc_add_reply: not enough room\n"); ++ return; ++ } ++ if (slc_add(func) == IAC) ++ slc_add(IAC); ++ if (slc_add(flags) == IAC) ++ slc_add(IAC); ++ if (slc_add((unsigned char)value) == IAC) ++ slc_add(IAC); + } + + void +@@ -1363,8 +1375,13 @@ slc_end_reply() + { + int len; + +- *slc_replyp++ = IAC; +- *slc_replyp++ = SE; ++ if (slc_replyp + 2 >= slc_reply + sizeof(slc_reply)) { ++ printf("slc_end_reply: not enough room\n"); ++ return; ++ } ++ ++ slc_add(IAC); ++ slc_add(SE); + len = slc_replyp - slc_reply; + if (len <= 6) + return; +@@ -1482,12 +1499,19 @@ env_opt(buf, len) + } + } + +-#define OPT_REPLY_SIZE 256 +-unsigned char *opt_reply; +-unsigned char *opt_replyp; +-unsigned char *opt_replyend; ++#define OPT_REPLY_SIZE (2 * SUBBUFSIZE) ++static unsigned char *opt_reply; ++static unsigned char *opt_replyp; ++static unsigned char *opt_replyend; + + void ++opt_add(unsigned char ch) ++{ ++ if (opt_replyp == opt_replyend) ++ return; ++ *opt_replyp++ = ch; ++} ++ void + env_opt_start() + { + unsigned char *p; +@@ -1506,10 +1530,10 @@ env_opt_start() + } + opt_replyp = opt_reply; + opt_replyend = opt_reply + OPT_REPLY_SIZE; +- *opt_replyp++ = IAC; +- *opt_replyp++ = SB; +- *opt_replyp++ = telopt_environ; +- *opt_replyp++ = TELQUAL_IS; ++ opt_add(IAC); ++ opt_add(SB); ++ opt_add(telopt_environ); ++ opt_add(TELQUAL_IS); + } + + void +@@ -1541,57 +1565,60 @@ env_opt_add(ep) + env_opt_add(ep); + return; + } +- vp = env_getvalue(ep); +- if (opt_replyp + (vp ? strlen((char *)vp) : 0) + +- strlen((char *)ep) + 6 > opt_replyend) ++ vp = env_getvalue(ep, 1); ++ if (opt_replyp + 2 * (vp ? strlen((char *)vp) : 0) + ++ 2 * strlen((char *)ep) + 6 > opt_replyend) + { +- int len; ++ size_t len; + unsigned char *p; +- opt_replyend += OPT_REPLY_SIZE; ++ + len = opt_replyend - opt_reply; ++ len += OPT_REPLY_SIZE + 2 * strlen(ep); ++ if (vp) ++ len += 2 * strlen(vp); + p = (unsigned char *)realloc(opt_reply, len); +- if (p == NULL) ++ if (p == NULL) { + free(opt_reply); +- opt_reply = p; +- if (opt_reply == NULL) { + /*@*/ printf("env_opt_add: realloc() failed!!!\n"); + opt_reply = opt_replyp = opt_replyend = NULL; + return; + } +- opt_replyp = opt_reply + len - (opt_replyend - opt_replyp); +- opt_replyend = opt_reply + len; ++ opt_replyp = p + (opt_replyp - opt_reply); ++ opt_replyend = p + len; ++ opt_reply = p; + } + if (opt_welldefined((char *)ep)) + #ifdef OLD_ENVIRON + if (telopt_environ == TELOPT_OLD_ENVIRON) +- *opt_replyp++ = old_env_var; ++ opt_add(old_env_var); + else + #endif +- *opt_replyp++ = NEW_ENV_VAR; ++ opt_add(NEW_ENV_VAR); + else +- *opt_replyp++ = ENV_USERVAR; ++ opt_add(ENV_USERVAR); ++ + for (;;) { + while ((c = *ep++)) { + switch(c&0xff) { + case IAC: +- *opt_replyp++ = IAC; ++ opt_add(IAC); + break; + case NEW_ENV_VAR: + case NEW_ENV_VALUE: + case ENV_ESC: + case ENV_USERVAR: +- *opt_replyp++ = ENV_ESC; ++ opt_add(ENV_ESC); + break; + } +- *opt_replyp++ = c; ++ opt_add(c); + } + if ((ep = vp)) { + #ifdef OLD_ENVIRON + if (telopt_environ == TELOPT_OLD_ENVIRON) +- *opt_replyp++ = old_env_value; ++ opt_add(old_env_value); + else + #endif +- *opt_replyp++ = NEW_ENV_VALUE; ++ opt_add(NEW_ENV_VALUE); + vp = NULL; + } else + break; +@@ -1619,8 +1646,8 @@ env_opt_end(emptyok) + + len = opt_replyp - opt_reply + 2; + if (emptyok || len > 6) { +- *opt_replyp++ = IAC; +- *opt_replyp++ = SE; ++ opt_add(IAC); ++ opt_add(SE); + if (NETROOM() > len) { + ring_supply_data(&netoring, opt_reply, len); + printsub('>', &opt_reply[2], len - 2); +@@ -2197,7 +2224,7 @@ telnet(user) + send_will(TELOPT_LINEMODE, 1); + send_will(TELOPT_NEW_ENVIRON, 1); + send_do(TELOPT_STATUS, 1); +- if (env_getvalue((unsigned char *)"DISPLAY")) ++ if (env_getvalue((unsigned char *)"DISPLAY", 0)) + send_will(TELOPT_XDISPLOC, 1); + if (binary) + tel_enter_binary(binary); diff --git a/source/n/telnet/telnet-OpenBSD-20020321.diff b/source/n/telnet/telnet-OpenBSD-20020321.diff new file mode 100644 index 00000000..f8b9c829 --- /dev/null +++ b/source/n/telnet/telnet-OpenBSD-20020321.diff @@ -0,0 +1,70 @@ +--- ./telnet/commands.c.orig Thu Mar 21 20:27:13 2002 ++++ ./telnet/commands.c Thu Mar 21 20:27:42 2002 +@@ -2196,7 +2196,7 @@ + if (skiprc) + return; + +- strlcpy(m1save, m1, sizeof(m1save)); ++ strncpy(m1save, m1, sizeof(m1save)); + m1 = m1save; + + if (rcname[0] == 0) { +--- ./telnet/GNUmakefile.orig Thu Mar 21 20:22:45 2002 ++++ ./telnet/GNUmakefile Thu Mar 21 20:22:23 2002 +@@ -0,0 +1,34 @@ ++all: telnet ++ ++include ../MCONFIG ++include ../MRULES ++ ++ifeq ($(USE_GLIBC),1) ++CFLAGS += -D_GNU_SOURCE ++endif ++ ++#CFLAGS:=$(patsubst -O2, -g, $(CFLAGS)) ++ ++# -DAUTHENTICATE ++CFLAGS += -DUSE_TERMIO -DKLUDGELINEMODE ++LIBS += $(LIBTERMCAP) ++ ++CFLAGS += -I../ ++ ++LIBTELNETOBJS = genget.o ++ ++OBJS = authenc.o commands.o main.o network.o ring.o sys_bsd.o telnet.o \ ++ terminal.o tn3270.o utilities.o $(LIBTELNETOBJS) ++ ++telnet: $(OBJS) ++ $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ ++ ++install: telnet ++ install -s -m$(BINMODE) telnet $(INSTALLROOT)$(BINDIR) ++ install -m$(MANMODE) telnet.1 $(INSTALLROOT)$(MANDIR)/man1 ++ ++clean: ++ rm -f *.o telnet ++ ++genget.o: ../libtelnet/genget.c ++ $(CC) $(CFLAGS) $< -c +--- ./telnet/main.c.orig Thu Mar 21 20:27:27 2002 ++++ ./telnet/main.c Thu Mar 21 20:27:51 2002 +@@ -325,7 +325,7 @@ + break; + case 't': + #if defined(TN3270) && defined(unix) +- (void)strlcpy(tline, optarg, sizeof tline); ++ (void)strncpy(tline, optarg, sizeof tline); + transcom = tline; + #else + fprintf(stderr, +--- ./telnet/utilities.c.orig Thu Mar 21 20:27:22 2002 ++++ ./telnet/utilities.c Thu Mar 21 20:27:47 2002 +@@ -101,7 +101,7 @@ + if (file && (strcmp(file, "-") != 0)) { + NetTrace = fopen(file, "w"); + if (NetTrace) { +- strlcpy((char *)NetTraceFile, file, sizeof(NetTraceFile)); ++ strncpy((char *)NetTraceFile, file, sizeof(NetTraceFile)); + return; + } + fprintf(stderr, "Cannot open %s.\n", file); diff --git a/source/n/telnet/telnet.SlackBuild b/source/n/telnet/telnet.SlackBuild new file mode 100755 index 00000000..e1b182a2 --- /dev/null +++ b/source/n/telnet/telnet.SlackBuild @@ -0,0 +1,78 @@ +#!/bin/sh + +# Copyright 2007-2009 Patrick J. Volkerding, Sebeka, MN, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +VERSION=0.17 +ARCH=${ARCH:-x86_64} +BUILD=${BUILD:-2} + +CWD=$(pwd) +TMP=${TMP:-/tmp} +PKG=$TMP/package-telnet + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf netkit-telnet-$VERSION +tar xzvf $CWD/netkit-telnet-$VERSION.tar.gz +cd netkit-telnet-$VERSION +chown -R root:root . +zcat $CWD/netkit-telnet-0.17.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 +zcat $CWD/netkit-telnet-0.17-ayt.patch.gz | patch -p1 --verbose --backup --suffix=.orig || exit 1 +./configure --prefix=/usr +cd telnetd +make +strip telnetd +mkdir -p $PKG/usr/sbin +cat telnetd > $PKG/usr/sbin/in.telnetd +chmod 755 $PKG/usr/sbin/in.telnetd +mkdir -p $PKG/usr/man/man8 +cat telnetd.8 | gzip -9c > $PKG/usr/man/man8/in.telnetd.8.gz +cd .. +# The OpenBSD version of the telnet client is superior. +rm -rf telnet +tar xzvf $CWD/telnet-OpenBSD-20020321.tar.gz +zcat $CWD/telnet-OpenBSD-20020321.diff.gz | patch -p1 --verbose || exit +zcat $CWD/telnet-OpenBSD-014_telnet.diff.gz | patch -p1 --verbose --backup --suffix=.orig || exit +( cd telnet ; make ) +cd telnet +strip telnet +mkdir -p $PKG/bin +cat telnet > $PKG/bin/telnet +chmod 755 $PKG/bin/telnet +mkdir -p $PKG/usr/man/man1 +cat telnet.1 | gzip -9c > $PKG/usr/man/man1/telnet.1.gz +cd .. +mkdir -p $PKG/usr/doc/netkit-telnet-$VERSION +cp -a README $PKG/usr/doc/netkit-telnet-$VERSION +chown root:root $PKG/usr/doc/netkit-telnet-$VERSION/* +chmod 644 $PKG/usr/doc/netkit-telnet-$VERSION/* + +# Finish up the package: +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +# Build the package: +cd $PKG +makepkg -l y -c n $TMP/telnet-$VERSION-$ARCH-$BUILD.txz + |