diff --git a/.cvsignore b/.cvsignore index e69de29..cdb6499 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1,2 @@ +netkit-telnet-0.17-pre20000412.tar.gz +telnet-client.tar.gz diff --git a/sources b/sources index e69de29..175e4ed 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +e2d1af881cd1527dd30f4d4551000cf6 netkit-telnet-0.17-pre20000412.tar.gz +d74983062470c5a3e7ae14f34c489e00 telnet-client.tar.gz diff --git a/telnet-0.17-env.patch b/telnet-0.17-env.patch new file mode 100644 index 0000000..bbcea39 --- /dev/null +++ b/telnet-0.17-env.patch @@ -0,0 +1,156 @@ +--- netkit-telnet-0.17-pre-20000204/telnet/commands.c.env Thu Apr 8 19:30:20 1999 ++++ netkit-telnet-0.17-pre-20000204/telnet/commands.c Tue May 16 17:19:47 2000 +@@ -1815,11 +1815,11 @@ + } + + unsigned char * +-env_getvalue(unsigned char *var) ++env_getvalue(unsigned char *var, int exported_only) + { +- struct env_lst *ep; ++ struct env_lst *ep = env_find(var); + +- if ((ep = env_find(var))) ++ if (ep && (!exported_only || ep->export)) + return(ep->value); + return(NULL); + } +--- netkit-telnet-0.17-pre-20000204/telnet/telnet.c.env Tue May 16 17:19:47 2000 ++++ netkit-telnet-0.17-pre-20000204/telnet/telnet.c Tue May 16 17:19:47 2000 +@@ -438,7 +438,7 @@ + #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; + +@@ -693,7 +693,7 @@ + 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)) && + (telnet_setupterm(tname, 1, &err) == 0)) { + tnamep = mklist(termbuf, tname); + } else { +@@ -870,7 +870,7 @@ + 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. +@@ -1527,7 +1527,7 @@ + env_opt_add(ep); + return; + } +- vp = env_getvalue(ep); ++ vp = env_getvalue(ep, 1); + if (opt_replyp + (vp ? strlen((char *)vp) : 0) + + strlen((char *)ep) + 6 > opt_replyend) + { +@@ -2170,7 +2170,7 @@ + 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); +--- netkit-telnet-0.17-pre-20000204/telnet/externs.h.env Mon Feb 8 15:56:11 1999 ++++ netkit-telnet-0.17-pre-20000204/telnet/externs.h Tue May 16 17:19:47 2000 +@@ -203,7 +203,7 @@ + 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); +@@ -335,7 +335,7 @@ + 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); +--- netkit-telnet-0.17-pre-20000204/telnet-NETKIT/telnet.cc.env Thu Aug 19 05:34:15 1999 ++++ netkit-telnet-0.17-pre-20000204/telnet-NETKIT/telnet.cc Tue May 16 17:22:40 2000 +@@ -456,7 +456,7 @@ + break; + + case TELOPT_XDISPLOC: /* X Display location */ +- if (env_getvalue("DISPLAY")) ++ if (env_getvalue("DISPLAY", 0)) + new_state_ok = 1; + break; + +@@ -636,7 +636,7 @@ + + if (resettermname) { + resettermname = 0; +- tname = env_getvalue("TERM"); ++ tname = env_getvalue("TERM", 0); + if (!tname || my_setupterm(tname, 1, &err)) { + termbuf[0] = 0; + tname = "UNKNOWN"; +@@ -769,7 +769,7 @@ + if (SB_EOF()) + return; + if (SB_GET() == TELQUAL_SEND) { +- const char *dp = env_getvalue("DISPLAY"); ++ const char *dp = env_getvalue("DISPLAY", 0); + if (dp == NULL) { + /* + * Something happened, we no longer have a DISPLAY +@@ -1182,7 +1182,7 @@ + for (ep = env_next(&i,1); ep; ep = env_next(&i,1)) env_opt_add(ep); + return; + } +- vp = env_getvalue(ep); ++ vp = env_getvalue(ep, 1); + if (opt_replyp + (vp ? strlen(vp) : 0) + strlen(ep) + 6 > opt_replyend) + { + register int len; +@@ -1736,7 +1736,7 @@ + send_will(TELOPT_LINEMODE, 1); + send_will(TELOPT_ENVIRON, 1); + send_do(TELOPT_STATUS, 1); +- if (env_getvalue("DISPLAY")) ++ if (env_getvalue("DISPLAY", 0)) + send_will(TELOPT_XDISPLOC, 1); + if (eight) + tel_enter_binary(eight); +--- netkit-telnet-0.17-pre-20000204/telnet-NETKIT/environ.cc.env Thu Aug 19 05:34:15 1999 ++++ netkit-telnet-0.17-pre-20000204/telnet-NETKIT/environ.cc Tue May 16 17:19:47 2000 +@@ -193,8 +193,9 @@ + return NULL; + } + +-const char *env_getvalue(const char *var) { ++const char *env_getvalue(const char *var, int exported_only) { + enviro *ep = env_find(var); +- if (ep) return ep->getval(); ++ if (ep && (!exported_only || ep->getexport())) ++ return ep->getval(); + return NULL; + } +--- netkit-telnet-0.17-pre-20000204/telnet-NETKIT/environ.h.env Tue Aug 13 20:48:59 1996 ++++ netkit-telnet-0.17-pre-20000204/telnet-NETKIT/environ.h Tue May 16 17:19:47 2000 +@@ -4,7 +4,7 @@ + void env_unexport(const char *); + void env_send(const char *); + void env_list(void); +-const char *env_getvalue(const char *); ++const char *env_getvalue(const char *, int exported_only); + + void env_iterate(int *, int exported_only); + const char *env_next(int *, int exported_only); diff --git a/telnet-xinetd b/telnet-xinetd new file mode 100644 index 0000000..636938c --- /dev/null +++ b/telnet-xinetd @@ -0,0 +1,13 @@ +# default: on +# description: The telnet server serves telnet sessions; it uses \ +# unencrypted username/password pairs for authentication. +service telnet +{ + flags = REUSE + socket_type = stream + wait = no + user = root + server = /usr/sbin/in.telnetd + log_on_failure += USERID +} + diff --git a/telnet.spec b/telnet.spec index 4a61aa7..658082e 100644 --- a/telnet.spec +++ b/telnet.spec @@ -1,55 +1,199 @@ -Summary: telnet +%define _snapshot -pre20000412 + +Summary: The client program for the telnet remote login protocol. Name: telnet -Group: test/test -Version: 0.0.0.1 -Release: 1 -License: GPL -ExclusiveArch: %{ix86} +Version: 0.17 +Release: 7 +Copyright: BSD +Group: Applications/Internet +Source0: ftp://ftp.uk.linux.org/pub/linux/Networking/netkit-devel/netkit-telnet-%{version}%{_snapshot}.tar.gz +Source2: telnet-client.tar.gz +Source3: telnet-xinetd +Patch4: telnet-0.10-escapechar.patch +Patch6: telnet-0.17-env.patch Buildroot: %{_tmppath}/%{name}-root %description -test +Telnet is a popular protocol for logging into remote systems over the +Internet. The telnet package provides a command line telnet client. + +Install the telnet package if you want to telnet to remote machines. + +%package server +Requires: xinetd +Group: System Environment/Daemons +Summary: The server program for the telnet remote login protocol. + +%description server +Telnet is a popular protocol for logging into remote systems over the +Internet. The telnet-server package a telnet daemon, which will +support remote logins into the host machine. The telnet daemon is +enabled by default. You may disable the telnet daemon by editing +/etc/xinet.d/telnet + +Install the telnet-server package if you want to support remote logins +to your own machine. %prep -cat > conftest.c < -#include -#include -volatile int count=0; -void handle(int foo) { count++; } -int main() { - int pid=getpid(); - int tcount; - signal(SIGINT, handle); - kill(pid,SIGINT); - kill(pid,SIGINT); - kill(pid,SIGINT); - tcount = count; - if (tcount!=3) { - fprintf(stderr, "count = %d\n", tcount); - sleep(1); - if(count != 3) { - fprintf(stderr, "count = %d\n", count); - return 1; - } - } - return 0; -} -EOF +%setup -q -n netkit-telnet-%{version}%{_snapshot} +mv telnet telnet-NETKIT +%setup -T -D -q -a 2 -n netkit-telnet-%{version}%{_snapshot} +%patch4 -p1 -b .escapechar + +%patch6 -p1 -b .env %build -gcc $RPM_OPT_FLAGS -g -o conftest conftest.c +sh configure +perl -pi -e ' + s,^CC=.*$,CC=cc,; + s,-O2,\$(RPM_OPT_FLAGS),; + s,^BINDIR=.*$,BINDIR=%{_bindir},; + s,^MANDIR=.*$,MANDIR=%{_mandir},; + s,^SBINDIR=.*$,SBINDIR=%{_sbindir},; + ' MCONFIG + +# XXX hack around gcc-2.96 problem +%ifarch i386 +export RPM_OPT_FLAGS="`echo $RPM_OPT_FLAGS | sed -e s/-O2/-O0/`" +%endif + +make %install -./conftest || exit 10 +rm -rf ${RPM_BUILD_ROOT} +mkdir -p ${RPM_BUILD_ROOT}%{_bindir} +mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} +mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1 +mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man5 +mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8 + +make INSTALLROOT=${RPM_BUILD_ROOT} install + +mkdir -p ${RPM_BUILD_ROOT}/etc/X11/applnk/Internet +cat > ${RPM_BUILD_ROOT}/etc/X11/applnk/Internet/telnet.desktop < - 1-1 -- test script for strange signal behaviour +* Tue Jul 18 2000 Bill Nottingham +- add description & default to xinetd file + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Mon Jun 19 2000 Jeff Johnson +- FHS packaging. +- update to 0.17-pre20000412. + +* Tue May 23 2000 Trond Eivind Glomsr�d +- moved the xinet entry to the server + +* Mon May 22 2000 Trond Eivind Glomsr�d +- add an entry to /etc/xinetd.d + +* Tue May 16 2000 Jeff Johnson +- permit telnet queries only for exported variables. + +* Fri Mar 24 2000 Bernhard Rosenkraenzer +- 0.17 + +* Tue Mar 7 2000 Jeff Johnson +- rebuild for sparc baud rates > 38400. + +* Fri Feb 11 2000 Bill Nottingham +- fix description + +* Mon Feb 07 2000 Preston Brown +- wmconfig gone + +* Wed Feb 02 2000 Cristian Gafton +- man pages are compressed +- fix description + +* Tue Jan 4 2000 Bill Nottingham +- split client and server + +* Tue Dec 21 1999 Jeff Johnson +- update to 0.16. + +* Sun Oct 10 1999 Matt Wilson +- corrected the Terminal setting of the .desktop (needs to be 'true' not '1') + +* Sat Sep 24 1999 Preston Brown +- red hat .desktop entry + +* Sat Aug 21 1999 Jeff Johnson +- rebuild for 6.1. + +* Wed Aug 18 1999 Bill Nottingham +- don't trust random TERM variables in telnetd (#4560) + +* Wed Jun 2 1999 Jeff Johnson +- fix (#3098). + +* Thu May 27 1999 Antti Andreimann +- fixed the problem with escape character (it could not be disabled) +- changed the spec file to use %setup macro for unpacking telnet-client + +* Thu Apr 15 1999 Jeff Johnson +- use glibc utmp routines. + +* Thu Apr 8 1999 Jeff Johnson +- fix the fix (wrong way memcpy). + +* Wed Apr 7 1999 Jeff Johnson +- fix "telnet localhost" bus error on sparc64 (alpha?). + +* Tue Apr 6 1999 Jeff Johnson +- use OpenBSD telnet client (and fix minor core dump with .telnetrc #247) + +* Thu Mar 25 1999 Erik Troan +- use openpty in telnetd + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 22) + +* Mon Mar 15 1999 Jeff Johnson +- compile for 6.0. + +* Fri Apr 24 1998 Prospector System +- translations modified for de, fr, tr + +* Fri Apr 24 1998 Cristian Gafton +- compile C++ code using egcs + +* Tue Apr 14 1998 Erik Troan +- built against new ncurses + +* Wed Oct 29 1997 Donnie Barnes +- added wmconfig entry +* Tue Jul 15 1997 Erik Troan +- initial build