aboutsummaryrefslogtreecommitdiff
path: root/contrib/telnet
Commit message (Collapse)AuthorAgeFilesLines
* Fix snprintf truncation in telnetDimitry Andric2023-12-211-1/+1
| | | | | | | | | | | | | | | | Building telnet with clang 18 results in the following warning: contrib/telnet/telnet/telnet.c:231:5: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 11 [-Werror,-Wformat-truncation] 231 | snprintf(temp2, sizeof(temp2), "%c%c%c%c....%c%c", IAC, SB, TELOPT_COMPORT, | ^ The temp2 buffer is 10 chars, while the format string also consists of 10 chars. Therefore, snprintf(3) will truncate the last character, 'SE' (end sub negotation) in this case. Bump the buffer to 11 chars to avoid truncation. MFC after: 3 days
* telnet: remove locally added __FBSDIDBrooks Davis2023-11-2722-67/+0
| | | | | | | This partially reverts 77b7cdf1999ee965ad494fddd184b18f532ac91a. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D42704
* telnet: Use C89 function definitions for two stragglers.John Baldwin2023-04-182-5/+3
| | | | | Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D39528
* telnet.1: Fix a typo in the manual pageGordon Bergling2023-04-111-1/+1
| | | | | | - s/addreess/address/ MFC after: 3 days
* Remove telnetd sourcesBrooks Davis2022-10-0513-7655/+0
| | | | Differential Revision: https://reviews.freebsd.org/D36621
* Put OPIE to rest.Dag-Erling Smørgrav2022-10-021-4/+0
| | | | Differential Revision: https://reviews.freebsd.org/D36592
* manpages: Remove telnetd referencesBrooks Davis2022-09-291-2/+2
| | | | | | | | | | Mostly remove from the SEE ALSO section, adding a mention of the port where not removed. Elsewhere, remove as appropriate and change from .Xr to .Nm where a mention of telnetd continues to make sense (or removing it would require significant reworking of the surrounding text). Reviewed by: imp, delphij, emaste Differential Revision: https://reviews.freebsd.org/D36785
* Fix CVE-2020-10188Cy Schubert2022-09-271-11/+21
| | | | | | | Reviewed by: emaste Obtained from: NetBSD 6cc1539c8028b MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D36732
* telnetd: fix two-byte input crashBrooks Davis2022-09-261-5/+5
| | | | | | | | | | | | Move initialization of the slc table earlier so it doesn't get accessed before that happens. For details on the issue, see: https://pierrekim.github.io/blog/2022-08-24-2-byte-dos-freebsd-netbsd-telnetd-netkit-telnetd-inetutils-telnetd-kerberos-telnetd.html Reviewed by: cy Obtained from: NetBSD via cy Differential Revision: https://reviews.freebsd.org/D36680
* Deprecate telnet daemonBrooks Davis2022-09-211-1/+6
| | | | | | | | | | | The telnetd codebase is old, unmaintained, and has a number of quality issues. Users wishing to provide telnetd service should find a maintained implementation. The telnet client is NOT deprecated as it is lower risk. Reviewed by: pauamma, kevans, kp, melifaro MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D36619
* telnet: Fix telnet segfault when invalid set or help help commandsCy Schubert2022-07-151-3/+3
| | | | | | | | | | | Silently ignore invalid set ' ' and invalid help help commands. This is the same fix applied by NetBSD in hg commit 1019940:4f248823eaff. PR: 265097 Reported by: Simon Josefsson <simon@josefsson.org> Obtained from: NetBSD hg commit 1019940:4f248823eaff NetBSD PR/56918 MFC after: 1 week
* telnet(1): add quiet mode ("telnet -Q")Edward Tomasz Napierala2021-06-213-8/+25
| | | | | | | | Reviewed By: imp, phk Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #54 Differential Revision: https://reviews.freebsd.org/D30819
* Set stdout & stderr unbuffered, so that the "telnet>" promptPoul-Henning Kamp2020-12-291-0/+2
| | | | | | also shows up when output is redirected: telnet |& tee _log
* telnet(1): Document -P optionGordon Bergling2020-08-071-1/+9
| | | | | | | | | | | | | PR: 248157 Submitted by: Juraj Lutter <juraj at lutter dot sk> Reviewed by: bcr Approved by: bcr Obtained from: NetBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25794 Notes: svn path=/head/; revision=364005
* telnet: kill off remaining duplicate definitionKyle Evans2020-03-281-2/+0
| | | | Notes: svn path=/head/; revision=359406
* Re-apply r359399: telnet -fno-common fixKyle Evans2020-03-285-33/+36
| | | | | | | | | | | | | | | | line and auth_level's redefinitions are just extraneous telnetd will #define extern and then include ext.h to allocate storage for all of these extern'd vars; however, two of them are actually defined in libtelnet instead. Instead of doing an #ifdef extern dance around those function pointers, just add an EXTERN macro to make it easier to differentiate by sight which ones will get allocated in globals.c and which ones are defined elsewhere. MFC after: 3 days Notes: svn path=/head/; revision=359404
* Revert 359399: telnet -fno-common bitsKyle Evans2020-03-284-5/+11
| | | | | | | | There was a large misfire from my local diff that I need to investigate, and this version committed did not build. Notes: svn path=/head/; revision=359403
* telnet: remove some duplicate definitions, mark terminaltype externKyle Evans2020-03-284-11/+5
| | | | | | | | | | | | Most of these were already properly declared and defined elsewhere, this is effectively just a minor cleanup that fixes the -fno-common build. -fno-common will become the default in GCC10/LLVM11. MFC after: 3 days Notes: svn path=/head/; revision=359399
* libtelnet: Replace bogus use of srandomdev + random to generate "public key ↵Conrad Meyer2019-12-131-6/+1
| | | | | | | | | | | pair" I'm pretty skeptical that any crypto in telnet is worth using, but if we're ostensibly generating keys, arc4random is strictly better than the previous construct. Notes: svn path=/head/; revision=355699
* telnet: remove 3rd clause from Berkeley copyrightsEd Maste2019-08-1548-240/+48
| | | | | | | | | | | | Per the July 22, 1999 letter (in /COPYRIGHT) from William Hoskins Director, Office of Technology Licensing University of California, Berkeley MFC after: 1 week Notes: svn path=/head/; revision=351070
* telnet: use asprintf for r349890 changeEd Maste2019-08-011-4/+1
| | | | | | | | | Suggested by: imp MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=350498
* telnet: fix minor style violationPhilip Paeps2019-07-101-1/+4
| | | | | | | | | While here also fix a very unlikely NULL pointer dereference. Submitted by: Shawn Webb <shawn.webb@hardenedbsd.org> Notes: svn path=/head/; revision=349896
* telnet: fix a couple of snprintf() buffer overflowsPhilip Paeps2019-07-103-7/+8
| | | | | | | | Obtained from: Juniper Networks MFC after: 1 week Notes: svn path=/head/; revision=349890
* Make telnet(1) buildable.Jung-uk Kim2018-09-195-30/+30
| | | | Notes: svn path=/projects/openssl111/; revision=338777
* Revert r338774. Unrelated changes were committed with Apache Serf.Jung-uk Kim2018-09-195-30/+30
| | | | Notes: svn path=/projects/openssl111/; revision=338775
* Update Apache Serf to 1.3.9 to make it buildable with OpenSSL 1.1.1.Jung-uk Kim2018-09-195-30/+30
| | | | Notes: svn path=/projects/openssl111/; revision=338774
* telnetd(8): Fix dereference of uninitialized value 'IF'Conrad Meyer2018-03-161-1/+1
| | | | | | | | Reported by: Coverity Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=331074
* Fix memory leak in edithostStephen J. Kiernan2017-06-011-21/+21
| | | | | | | | | | | | | | | | | | | | | The problem is that when the parameter 'pat' is null, the function locally allocates a NULL string but never frees it. Instead of tracking the local alloc, it is noted that the while(*pat) never enters when there is a local alloc. So instead of doing the local alloc, check that 'pat' is null before the while(*pat) loop. Found using clang's static analyzer - scan-build Submitted by: Thomas Rix <trix@juniper.net> Reviewed by: markm Approved by: sjg (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9689 Notes: svn path=/head/; revision=319453
* When telnetd(8) composes argument list for login(1), an unexpected sequenceGleb Smirnoff2016-12-061-3/+4
| | | | | | | | | | | | | | of memory allocation failures combined with insufficient error checking could result in the construction and execution of an argument sequence that was not intended. Fix that treating malloc(3) failures as fatal condition. Submitted by: brooks Security: FreeBSD-SA-16:36.telnetd Notes: svn path=/head/; revision=309638
* Fix warnings in telnet about invalid constant conversions, e.g.:Dimitry Andric2016-08-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | contrib/telnet/telnet/commands.c:2914:13: error: implicit conversion from 'int' to 'char' changes value from 137 to -119 [-Werror,-Wconstant-conversion] *lsrp++ = IPOPT_SSRR; ~ ^~~~~~~~~~ /usr/include/netinet/ip.h:152:21: note: expanded from macro 'IPOPT_SSRR' #define IPOPT_SSRR 137 /* strict source route */ ^~~ contrib/telnet/telnet/commands.c:2916:13: error: implicit conversion from 'int' to 'char' changes value from 131 to -125 [-Werror,-Wconstant-conversion] *lsrp++ = IPOPT_LSRR; ~ ^~~~~~~~~~ /usr/include/netinet/ip.h:148:21: note: expanded from macro 'IPOPT_LSRR' #define IPOPT_LSRR 131 /* loose source route */ ^~~ Use unsigned char buffers instead. MFC after: 1 week Notes: svn path=/head/; revision=305086
* Squelch clang 3.9.0 warnings about BASE (which is 32768) being convertedDimitry Andric2016-08-301-1/+1
| | | | | | | | | | | to -32768 when it is used as an argument to mp_itom(), in both libtelnet and newkey. This code has been wrong since r26238 (!), so after almost 20 years it is rather useless to try to correct it. MFC after: 1 week Notes: svn path=/head/; revision=305077
* Add baud rate support to telnet(1)Enji Cooper2014-11-1110-134/+199
| | | | | | | | | | | | | | | | This implements part of RFC-2217 It's based off a patch originally written by Sujal Patel at Isilon, and contributions from other Isilon employees. PR: 173728 Phabric: D995 Reviewed by: markj, markm MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274364
* Improve upon previous commit:Marcel Moolenaar2014-03-021-6/+7
| | | | | | | | | | | 1. Check return of mmap(2) (*) 2. Avoid FD leak when fstat fails. 3. Fix style(9). (*) Pointed out by jmg@ Notes: svn path=/head/; revision=262679
* Revive support for /etc/issue, lost due revision 81963.Marcel Moolenaar2014-03-021-0/+19
| | | | | | | Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=262673
* Propagate ancient fix from Junos.Simon J. Gerraty2013-11-071-1/+1
| | | | | | | | | Use of -h is not supposed to depend on AUTHENTICATION being defined. Reviewed by: markm Notes: svn path=/head/; revision=257773
* Fix "automatic" login, broken by revision 69825 (12 years, 5 months ago).Marcel Moolenaar2013-05-311-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The "automatic" login feature is described as follows: The USER environment variable holds the name of the person telnetting in. This is the username of the person on the client machine. The traditional behaviour is to execute login(1) with this username first, meaning that login(1) will prompt for the password only. If login fails, login(1) will retry, but now prompt for the username before prompting for the password. This feature got broken by how the environment got scrubbed. Before the change in r69825 we removed variables that we deemed dangerous. Starting with r69825 we only keep those variable we know to be safe. The USER environment variable fell through the cracks. It suddenly got scrubbed (i.e. removed from the environment) while still being checked for. It also got explicitly removed from the environment to handle the failed login case. The fix is to obtain the value of the USER environment variable before we scrub the environment and used the "cached" in subsequent checks. This guarantees that the environment does not contain the USER variable in the end, while still being able to implement "automatic" login. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=251188
* Make sure that each va_start has one and only one matching va_end,Kevin Lo2012-09-281-1/+3
| | | | | | | especially in error cases. Notes: svn path=/head/; revision=241021
* Remove superfluous paragraph macro.Joel Dahl2012-06-171-2/+0
| | | | Notes: svn path=/head/; revision=237190
* - Do not use deprecated krb5 error message reporting functions in libtelnet.Stanislav Sedov2012-04-061-53/+55
| | | | Notes: svn path=/head/; revision=233932
* Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]Colin Percival2011-12-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Add an API for alerting internal libc routines to the presence of "unsafe" paths post-chroot, and use it in ftpd. [11:07] Fix a buffer overflow in telnetd. [11:08] Make pam_ssh ignore unpassphrased keys unless the "nullok" option is specified. [11:09] Add sanity checking of service names in pam_start. [11:10] Approved by: so (cperciva) Approved by: re (bz) Security: FreeBSD-SA-11:06.bind Security: FreeBSD-SA-11:07.chroot Security: FreeBSD-SA-11:08.telnetd Security: FreeBSD-SA-11:09.pam_ssh Security: FreeBSD-SA-11:10.pam Notes: svn path=/head/; revision=228843
* In contrib/telnet/telnet/utilities.c, fix a few warnings about formatDimitry Andric2011-12-171-4/+4
| | | | | | | | | strings not being literals. MFC after: 1 week Notes: svn path=/head/; revision=228651
* In contrib/telnet/telnetd/utility.c, fix a few warnings about formatDimitry Andric2011-12-161-4/+4
| | | | | | | | | strings not being literals. MFC after: 1 week Notes: svn path=/head/; revision=228589
* In contrib/telnet/libtelnet/sra.c, use the correct number of bytes toDimitry Andric2011-12-161-1/+1
| | | | | | | | | zero the password buffer. MFC after: 1 week Notes: svn path=/head/; revision=228559
* telnet: Fix infinite loop if local output generates SIGPIPE.Jilles Tjoelker2010-04-306-16/+17
| | | | | | | | | | | | | | | | | | | | Instead of catching SIGPIPE and jumping out of the signal handler with longjmp, ignore it and handle write errors to the local output by exiting from there. I have changed the error message to mention the local output instead of NetBSD's wrong "Connection closed by foreign host". Write errors to the network were already handled by exiting immediately and this now applies to EPIPE too. The code assumed that SIGPIPE could only be generated by the network connection; if it was generated by the local output, it would longjmp out of the signal handler and write an error message which caused another SIGPIPE. PR: 19773 Obtained from: NetBSD MFC after: 1 week Notes: svn path=/head/; revision=207449
* Forgot a part that was missing in the previous commit.Ed Schouten2010-01-131-1/+0
| | | | | | | | There is no need to call trimdomain() anymore now that ut_host is big enough to fit decent hostnames. Notes: svn path=/head/; revision=202214
* Let telnetd build without utmp and logwtmp(3).Ed Schouten2010-01-132-19/+1
| | | | | | | | | | Just like rlogind, there is no need to change the ownership of the terminal during shutdown anymore. Also don't call logwtmp, because the login(1)/PAM is responsible for doing this. Also use SHUT_RDWR instead of 2. Notes: svn path=/head/; revision=202212
* Remove unneeded inclusion of <utmp.h> and dead variables.Ed Schouten2009-12-271-14/+0
| | | | Notes: svn path=/head/; revision=201047
* Use <termios.h> instead of <sys/termios.h>.Ed Schouten2009-11-281-1/+1
| | | | | | | <sys/termios.h> only works on FreeBSD by accident. Notes: svn path=/head/; revision=199874
* Rename all symbols in libmp(3) to mp_*, just like Solaris.Ed Schouten2009-02-261-43/+43
| | | | | | | | | | | | | | | The function pow() in libmp(3) clashes with pow(3) in libm. We could rename this single function, but we can just take the same approach as the Solaris folks did, which is to prefix all function names with mp_. libmp(3) isn't really popular nowadays. I suspect not a single application in ports depends on it. There's still a chance, so I've increased the SHLIB_MAJOR and __FreeBSD_version. Reviewed by: deischen, rdivacky Notes: svn path=/head/; revision=189092
* Correctly scrub telnetd's environment.Colin Percival2009-02-161-4/+19
| | | | | | | | Approved by: so (cperciva) Security: FreeBSD-SA-09:05.telnetd Notes: svn path=/head/; revision=188699