Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1337251 - telnet sessions ignore SIGPIPE due to systemd, telnet@.service needs IgnoreSIGPIPE=no
Summary: telnet sessions ignore SIGPIPE due to systemd, telnet@.service needs IgnoreSI...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: telnet
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Michal Ruprich
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-18 15:35 UTC by giulioo
Modified: 2020-07-16 08:46 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-06 16:06:14 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 4619251 0 None None None 2019-11-28 13:15:59 UTC

Description giulioo 2016-05-18 15:35:07 UTC
Description of problem:
telnet sessions ignore SIGPIPE because systemd defaults to IgnoreSIGPIPE=yes

Version-Release number of selected component (if applicable):
telnet-server-0.17-59.el7.x86_64

How reproducible:
Always


Steps to Reproduce:
1. Telnet to a RHEL7 system
2. Run
   $ perl -le 'print $SIG{PIPE}'
3. Run
   $ seq 1 100000|head -n 1

Actual results:
$ perl -le 'print $SIG{PIPE}'
IGNORE
$ seq 1 1000000|head -n 1
1
seq: write error: Broken pipe
$


Expected results:
$ perl -le 'print $SIG{PIPE}'

$ seq 1 1000000|head -n 1
1
$


Additional info:

/usr/lib/systemd/system/telnet@.service needs a line with IgnoreSIGPIPE=no

[Service]
IgnoreSIGPIPE=no               <======= to be added
ExecStart=-/usr/sbin/in.telnetd
StandardInput=socket

Comment 5 Michal Ruprich 2017-07-12 15:07:20 UTC
I was trying to reproduce this on current RHEL-7 and on a few older versions and it works, there is no broken pipe. I had the same versions of telnet, telnet-server and ksh that are described in the customer case. Is this still an issue for you? Because I really cannot reproduce this behaviour.

Comment 6 Thomas Gardner 2017-07-12 17:47:15 UTC
(In reply to Michal Ruprich from comment #5)
> I was trying to reproduce this on current RHEL-7 and on a few older versions
> and it works, there is no broken pipe. I had the same versions of telnet,
> telnet-server and ksh that are described in the customer case. Is this still
> an issue for you? Because I really cannot reproduce this behaviour.

Are you sure there wasn't already a "IgnoreSIGPIPE=no" in the telnet unit file already when you tried it?  That seems to be the problem.

On the other hand, if you put "IgnoreSIGPIPE=yes" in your telnet unit file, are you then able to reproduce the problem?

I don't mean to insult you, but you are telnetting into the system, right?  If not, that would certainly be the problem, right there.

Is there a reason we can't add "IgnoreSIGPIPE=no" in the telnet unit file?  Blocking pipe signals is definitely NOT normal behavior for traditional in.telnetd (or xinetd, or inetd, or any of that).  Classically, pipe signals are not blocked from a login shell like this, and if someone is using telnet, they are certainly looking for classical behavior, bless their little hearts.

Comment 7 giulioo 2017-07-12 21:39:04 UTC
(In reply to Michal Ruprich from comment #5)

> I was trying to reproduce this on current RHEL-7 and on a few older versions
> and it works, there is no broken pipe. I had the same versions of telnet,
> telnet-server and ksh that are described in the customer case. Is this still
> an issue for you? Because I really cannot reproduce this behaviour.

I just tried a fresh install using rhel7.3 media, telnet-server is now 0.17-60.
I can see the exact same behavior from my 1st comment.

Note that I use bash (default) and not ksh; the bare $ prompt was just me reducing the info to the minimum.
I tried creating an user with ksh as shell, and the results are the same.

Comment 8 Michal Ruprich 2017-07-13 06:55:51 UTC
> Are you sure there wasn't already a "IgnoreSIGPIPE=no" in the telnet unit
> file already when you tried it?  That seems to be the problem.

I'm sure it wasn't there.
 
> On the other hand, if you put "IgnoreSIGPIPE=yes" in your telnet unit file,
> are you then able to reproduce the problem?

I even tried that just in case and still could not reproduce.
 
> I don't mean to insult you, but you are telnetting into the system, right? 
> If not, that would certainly be the problem, right there.
 
Yes I'm using telnet ;)

> Is there a reason we can't add "IgnoreSIGPIPE=no" in the telnet unit file? 

No I don't have a problem with that, I was just trying to confirm the described behaviour. I have a similar bug on rsh where the broken pipe problem actually appears and the IgnoreSIGPIPE fixes it so I think I can fix this one as well.

Comment 9 Michal Ruprich 2017-07-13 06:57:38 UTC
(In reply to giulioo from comment #7)

> I just tried a fresh install using rhel7.3 media, telnet-server is now
> 0.17-60.
> I can see the exact same behavior from my 1st comment.

I did exactly the same but no wrong behaviour. Nevertheless like I said in comment #8 I will fix that, because I see no harm in that.

Comment 10 Thomas Gardner 2017-07-13 11:25:34 UTC
(In reply to giulioo from comment #7)
> [...]
> Note that I use bash (default) and not ksh; the bare $ prompt was just me
> reducing the info to the minimum.
> I tried creating an user with ksh as shell, and the results are the same.

Right.  This really doesn't have anything to do with the shell.
The problem is with telnet.  I'm sure csh, tcsh, ash, or any other
shell that splits a pipeline into multiple processes would all have
similar problems.  They may or may not produce an error message,
but the underlying problem would still be there.

(In reply to Michal Ruprich from comment #9)
> [...]
> I did exactly the same but no wrong behaviour. Nevertheless like I
> said in comment #8 I will fix that, because I see no harm in that.

Thank you, Michal.

Thanks,
tg.

Comment 11 Michal Ruprich 2017-08-08 12:23:27 UTC
Just a note: I was finally able to reproduce this with clean machine. Apparently my own virtual machine had some older settings that were messing with the reproducer.

Comment 14 Tomáš Hozza 2019-12-06 16:06:06 UTC
Red Hat Enterprise Linux version 7 entered the Maintenance Support 1 Phase in August 2019. In this phase only qualified Critical and Important Security errata advisories (RHSAs) and Urgent Priority Bug Fix errata advisories (RHBAs) may be released as they become available. Other errata advisories may be delivered as appropriate.

This bug has been reviewed by Support and Engineering representative and does not meet the inclusion criteria for Maintenance Support 1 Phase. If this issue still exists in newer major version of Red Hat Enterprise Linux, it has been cloned there and work will continue in the cloned bug.

For more information about Red Hat Enterprise Linux Lifecycle, please see https://access.redhat.com/support/policy/updates/errata/

Comment 15 RHEL Program Management 2019-12-06 16:06:14 UTC
Development Management has reviewed and declined this request. You may appeal this decision by using your Red Hat support channels, who will make certain  the issue receives the proper prioritization with product and development management.

https://www.redhat.com/support/process/production/#howto


Note You need to log in before you can comment on or make changes to this bug.