LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-06-2017, 03:50 PM   #1
trailman
LQ Newbie
 
Registered: Jun 2008
Posts: 7

Rep: Reputation: 1
telnet failing to parse ~/.telnetrc on Fedora


During years, I have been using telnet with a ~/.telnetrc file to connect to a serial port server. This file had the following content :
Code:
serialsrv
       mode char
       set binary
Connecting with "telnet serialsrv" was dislaying the message "Negotiating binary mode with remote host." (due to "set binary" in file), and everything was working OK.

But after upgrading to Fedora 25, I had unexpected local echo and no negotiation message anymore. The workaround was to type "mode char" and "set binary" at the telnet> prompt (reached with Ctrl-]), because the file was ignored.

After some debug I discovered that the hostanme entry in the file (serialsrv) was not processed correctly due to strncpy() used on overlaping dest/src buffers (see telnet/commands.c, function cmdrc(), lines 2220,2222,2224). Overlaping is not allowed according to strncpy man page. The fix is to replace these three strncpy with memmove().

Strangely, rebuilding the telnet-0.17-68.fc25.x86_64 RPM package from source SRPM using "make" (rpm -i srpm + rpmbuild -bp specfile + make) solves the probem, but not when rebuilding with rpmbuild (rpm -i srpm + rpmbuild -bb specfile).
Building with "rpmbuild" uses extra compilation flags not present with "make". The extra flag showing this strncpy() programming issue is -Wp,-D_FORTIFY_SOURCE=2.

NOTE : as this problem is related to rpmbuild flags, it should also be present with other RPM based distros.

Last edited by trailman; 10-06-2017 at 03:56 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Tor downloaded in centOS 7 but is failing to start and giving an error mesage that is "Failed to parse/validate config: Failed to bind one " th3g3ntl3man Linux - Newbie 1 01-20-2017 10:44 AM
Linux to Linux Telnet on port 5038 failing Telleraine Linux - Networking 1 02-20-2013 11:55 AM
libblkid uuid_parse() failing to parse UUID for lvm volume on raid device wroom Programming 0 09-04-2010 07:08 PM
Piping to telnet 80 failing michaelsanford Linux - Networking 2 01-19-2006 04:20 PM
Failing to connect to TELNET, FTP or SSH dbadft Linux - Networking 10 04-16-2003 02:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration