View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000535 | 1003.1(2008)/Issue 7 | Shell and Utilities | public | 2012-01-11 12:55 | 2012-02-09 16:19 |
| Reporter | marko | Assigned To | ajosey | ||
| Priority | normal | Severity | Objection | Type | Enhancement Request |
| Status | Closed | Resolution | Rejected | ||
| Name | Marko Schütz-Schmuck | ||||
| Organization | |||||
| User Reference | |||||
| Section | 2.9.5, 3.10 | ||||
| Page Number | n/a | ||||
| Line Number | n/a | ||||
| Interp Status | --- | ||||
| Final Accepted Text | |||||
| Summary | 0000535: require support for path separator in function and alias names | ||||
| Description | Alias names and function names are may contain path separator characters as an extension. Using path separators in alias and/or function names is a way to change the execution environment (e.g. the compilation environment) without requiring privileges. For example, a developer may define a function named /usr/bin/cc to hook into executions of the compiler without affecting other users and without requiring administrator privileges. | ||||
| Desired Action | Require conforming shells to support <slash> in function and alias names. | ||||
| Tags | No tags attached. | ||||
|
|
Making this change would open up a security hole, since existing scripts count on the use of <slash> to bypass any alias or function names in order to ensure they are executing the intended binary. Additionally, the use of such a function name would not propagate to child processes that directly execute the path name that had been intended to be covered by the function. |
|
|
A complying shell may currently allow <slash> in function as well as in alias names. A portable script should not assume <slash> to bypass function and alias names. The assumption that a <slash> acts as a by-pass should be seen as the cause for the security hole of such scripts. Whether or not such names propagate to child processes is a different issue. Depending on the implementation different methods may be used to achieve this, e.g. using a file of definitions that gets read on each shell invocation. |
|
|
On Jan 15, Jilles Tjoelker sent this response in email:A shell may allow defining such a function, but shall not allow calling it. In XCU 2.9.1.1 Command Search and Execution, if the command name contains a <slash>, the shell shall perform actions equivalent to calling execve(); functions and shell builtins apply only if the command name does not contain a <slash>. Allowing a <slash> in an alias name looks like a valid extension. Although allowing propagation gives more flexibility, it also makes the execution environment less predictable. Instead, the called script can source the definitions again, or the called script can be sourced (possibly in a subshell environment so it cannot modify the parent environment). On that basis, the Austin Group still believes that mandating the use of <slash> is not appropriate for the standard, but implementations may still offer it as an extension for aliases, and that it makes no sense for functions. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-01-11 12:55 | marko | New Issue | |
| 2012-01-11 12:55 | marko | Status | New => Under Review |
| 2012-01-11 12:55 | marko | Assigned To | => ajosey |
| 2012-01-11 12:55 | marko | Name | => Marko Schütz-Schmuck |
| 2012-01-11 12:55 | marko | Section | => 2.9.5, 3.10 |
| 2012-01-11 12:55 | marko | Page Number | => n/a |
| 2012-01-11 12:55 | marko | Line Number | => n/a |
| 2012-01-12 17:11 | eblake | Interp Status | => --- |
| 2012-01-12 17:11 | eblake | Note Added: 0001092 | |
| 2012-01-12 17:11 | eblake | Status | Under Review => Closed |
| 2012-01-12 17:11 | eblake | Resolution | Open => Rejected |
| 2012-01-15 17:30 | marko | Note Added: 0001095 | |
| 2012-01-15 17:30 | marko | Status | Closed => Under Review |
| 2012-01-15 17:30 | marko | Resolution | Rejected => Reopened |
| 2012-02-09 16:17 | eblake | Note Added: 0001117 | |
| 2012-02-09 16:18 | eblake | Resolution | Reopened => Rejected |
| 2012-02-09 16:19 | eblake | Status | Under Review => Closed |