Bug 459553

Summary: Mistake in parse parameter server_args with string quoting.
Product: Red Hat Enterprise Linux 5 Reporter: Andrey <afletdinov>
Component: xinetdAssignee: Jan Safranek <jsafrane>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: low Docs Contact:
Priority: medium    
Version: 5.2   
Target Milestone: rc   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-08-21 11:33:54 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 Andrey 2008-08-20 00:41:32 UTC
Description of problem:
Mistake in parse parameter server_args with string quoting.

Version-Release number of selected component (if applicable):
xinetd-2.3.14-10.el5

How reproducible:
always

Steps to Reproduce:
1. small C program:
#include <stdio.h>

int main(int argc, char *argv[])
{
    char **c = &argv[0];

    for(;*c;++c) printf("arg: %s\n", *c);

   return 0;
}

example:
./test 1 2 3 "4 5 6" 7
arg: ./test
arg: 1
arg: 2
arg: 3
arg: 4 5 6
arg: 7

2. config for xinetd:
service acr-nema
{
    disable = no
    socket_type     = stream
    wait            = no
    user            = nobody
    server          = /opt/test
    server_args     = 1 2 3 "4 5 6" 7
}

3. check: telnet 127.0.0.1 104

Actual results:
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
arg: /opt/test
arg: 1
arg: 2
arg: 3
arg: "4
arg: 5
arg: 6"
arg: 7
Connection closed by foreign host.


Expected results:
arg: /opt/test
arg: 1
arg: 2
arg: 3
arg: 4 5 6
arg: 7


Additional info:

Comment 1 Jan Safranek 2008-08-21 11:33:54 UTC
I don't think xinetd has ever claimed that double quotes in the configuration file are interpreted anyhow, your assumption that it encapsulates one argument which can contain spaces is IMHO wrong.