Email List: Xaustin-group-lX
[All Lists]

[1003.1(2008)/Issue 7 0000168]: Incorrect description of how the shell e

To: austin-group-l@xxxxxxxxxxxxx
Subject: [1003.1(2008)/Issue 7 0000168]: Incorrect description of how the shell executes external utilities
From: Austin Group Bug Tracker <noreply@xxxxxxxxxxxxx>
Date: Tue, 13 Oct 2009 09:16:46 +0000
Keywords: [1003.1(2008)/Issue 7] Shell and Utilities
The following issue has been SUBMITTED. 
====================================================================== 
http://austingroupbugs.net/view.php?id=168 
====================================================================== 
Reported By:                geoffclare
Assigned To:                ajosey
====================================================================== 
Project:                    1003.1(2008)/Issue 7
Issue ID:                   168
Category:                   Shell and Utilities
Type:                       Error
Severity:                   Objection
Priority:                   normal
Status:                     Under Review
Name:                       Geoff Clare 
Organization:               The Open Group 
User Reference:              
Section:                    2.9.1.1 
Page Number:                2317,2318 
Line Number:                73143,73165 
Interp Status:              --- 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2009-10-13 09:16 UTC
Last Modified:              2009-10-13 09:16 UTC
====================================================================== 
Summary:                    Incorrect description of how the shell executes
external utilities
Description: 
XCU 2.9.1.1 Command Search and Execution says (in item 1.d.i.b):

    ... the shell executes the utility in a separate utility
    environment (see Section 2.12, on page 2331) with actions
    equivalent to calling the execve() function as defined in the
    System Interfaces volume of POSIX.1-2008 with the path argument
    set to the pathname resulting from the search, arg0 set to the
    command name, and the remaining arguments set to the operands,
    if any.

This refers to execve(), but the description of what is passed
to it matches the arguments for execl(), not execve().  It also
requires only the _operands_ to be passed, omitting any options
(and the "--" delimiter if present).  This defect goes all the
way back to POSIX.2-1992.

Item 2 in the same section also has the same problems.

While fixing this, we should also address the issue raised on the
mailing list in July 2009 regarding passing on invalid environment
variables.  The changes I have suggested allow both types of
existing practice.

Desired Action: 
<pre>
At line 73143 change:

    calling the execve() function as defined in the System Interfaces
    volume of POSIX.1-2008 with the path argument set to the pathname
    resulting from the search, arg0 set to the command name, and the
    remaining arguments set to the operands, if any.

to:

    calling the execl() function as defined in the System Interfaces
    volume of POSIX.1-2008 with the path argument set to the pathname
    resulting from the search, arg0 set to the command name, and the
    remaining execl() arguments set to the command arguments (if any)
    and the null terminator.

At line 73147 change:

    If the execve() function fails

to:

    If the execl() function fails

After line 73155 add a new paragraph (indented the same as the
previous paragraph):

    It is unspecified whether environment variables that were passed
    to the shell when it was invoked, but were not used to initialize
    shell variables (see [xref to 2.5.3]) because they had invalid
    names, are included in the environment passed to execl() and (if
    execl() fails as described above) to the new shell.

At line 73165 change:

    calling the execve() function defined in the System Interfaces
    volume of POSIX.1-2008 with the path and arg0 arguments set to the
    command name, and the remaining arguments set to the operands, if
    any.

to:

    calling the execl() function as defined in the System Interfaces
    volume of POSIX.1-2008 with the path and arg0 arguments set to the
    command name, and the remaining execl() arguments set to the
    command arguments (if any) and the null terminator.

At line 73169 change:

    If the execve() function fails

to:

    If the execl() function fails

After line 73173 add a new paragraph (indented the same as the
previous paragraph):

    It is unspecified whether environment variables that were passed
    to the shell when it was invoked, but were not used to initialize
    shell variables (see [xref to 2.5.3]) because they had invalid
    names, are included in the environment passed to execl() and (if
    execl() fails as described above) to the new shell.
</pre>

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-10-13 09:16 geoffclare     New Issue                                    
2009-10-13 09:16 geoffclare     Status                   New => Under Review 
2009-10-13 09:16 geoffclare     Assigned To               => ajosey          
2009-10-13 09:16 geoffclare     Name                      => Geoff Clare     
2009-10-13 09:16 geoffclare     Organization              => The Open Group  
2009-10-13 09:16 geoffclare     Section                   => 2.9.1.1         
2009-10-13 09:16 geoffclare     Page Number               => 2317,2318       
2009-10-13 09:16 geoffclare     Line Number               => 73143,73165     
2009-10-13 09:16 geoffclare     Interp Status             => ---             
======================================================================

<Prev in Thread] Current Thread [Next in Thread>