A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=1789 ====================================================================== Reported By: Mark_Galeck Assigned To: ====================================================================== Project: Issue 8 drafts Issue ID: 1789 Category: Shell and Utilities Type: Error Severity: Objection Priority: normal Status: New Name: Mark Galeck Organization: User Reference: Section: Volume 2, Chapter 3 Page Number: 865, 2487 Line Number: 80936, 29495 Final Accepted Text: ====================================================================== Date Submitted: 2023-11-22 02:24 UTC Last Modified: 2023-11-22 09:57 UTC ====================================================================== Summary: if command name contains slash, it cannot be arg0 for execl() ======================================================================
---------------------------------------------------------------------- (0006582) Guy Harris (reporter) - 2023-11-22 09:57 https://austingroupbugs.net/view.php?id=1789#c6582 ---------------------------------------------------------------------- And if "the program calling execl()" is a POSIX-compliant shell, then section 2.9.1.6 Non-built-in Utility Execution of the current Draft 3 specifies that: If the command name does not contain any <slash> characters, the command name shall | 80907 be searched for using the PATH environment variable as described in XBD Chapter 8 (on | 80908 page 167): If the search is successful, the shell shall execute the utility with actions equivalent | to calling the execl() function as defined in the System Interfaces volume of POSIX.1-202x 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. ... If the command name contains at least one <slash>: If the named utility exists, the shell shall execute the utility with actions equivalent | to calling the execl() function defined in the System Interfaces volume of POSIX.1-202x 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. so the filename string passed as arg0 to the exec function used by the shell is *not* a filename, it's a pathname; if you want a filename, you'll have to strip off everything up to the last path separator. Issue History Date Modified Username Field Change ====================================================================== 2023-11-22 02:24 Mark_Galeck New Issue 2023-11-22 02:24 Mark_Galeck Name => Mark Galeck 2023-11-22 02:24 Mark_Galeck Section => Volume 2, Chapter 3 2023-11-22 02:24 Mark_Galeck Page Number => 865, 2487 2023-11-22 02:24 Mark_Galeck Line Number => 80936, 29495 2023-11-22 06:20 larryv Note Added: 0006579 2023-11-22 07:18 Don Cragun Note Added: 0006580 2023-11-22 07:19 Don Cragun Project 1003.1(2016/18)/Issue7+TC2 => Issue 8 drafts 2023-11-22 07:21 Don Cragun version => Draft 3 2023-11-22 09:42 Guy Harris Note Added: 0006581 2023-11-22 09:57 Guy Harris Note Added: 0006582 ======================================================================