Bug 126242

Summary: xinetd displays a banner twice
Product: [Fedora] Fedora Reporter: Dax Kelson <dkelson>
Component: xinetdAssignee: Jay Fenlason <fenlason>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 2CC: jfeeney
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-06-18 19:51:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dax Kelson 2004-06-17 22:11:35 UTC
Description of problem:

I'm just testing Xinetd on FC2 and I discovered this behavior change
versus FC1/RHEL3.

I added the following lines to the /etc/xinetd.d/telnet configuration
file:

        log_on_success  += DURATION
        instances       = 5
        per_source      = 1
        banner          = /etc/go.away.banner


So that the complete file now looks like this:
service telnet
{
        disable = no
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/sbin/in.telnetd
        log_on_failure  += USERID
        log_on_success  += DURATION
        instances       = 5
        per_source      = 1
        banner          = /etc/go.away.banner
}


I did a '/etc/init.d/xinetd reload' and created the file
/etc/go.away.banner. It has two lines in it as you can see.

[root@station1 root]# cat /etc/go.away.banner
This is a secured system, unauthorized access is prohibited.
All access is logged.
[root@station1 root]#

I then telneted to the box from another FC2 host.

This was displayed:

[root@station2 root]# telnet station1
Trying 10.100.0.1...
Connected to station1.example.com (10.100.0.1).
Escape character is '^]'.
This is a secured system, unauthorized access is prohibited.
All access is logged.
This is a secured system, unauthorized access is prohibited.
All access is logged.
Fedora Core release 2 (Tettnang)
Kernel 2.6.5-1.358smp on an i686
login:

(note the double display of the banner).

Comment 1 Jay Fenlason 2004-06-18 19:51:35 UTC
Ayup.  That's a bug.  (What's happening is xinetd "writes" the data 
before it forks (to spawn the telnet server), then both processes 
flush the buffered-but-unwritten banner data, resulting in two 
copies of it going to the client.  banner_fail suffers from the same 
problem, but the symptom is that no banner data shows up at all.)  I 
just built fixed rpms which should show up in rawhide Real Soon Now.