Bug 12678 - POSIX.1-2008 non-compliance in sysdeps/posix/system.c: Hard-coded shell path
Summary: POSIX.1-2008 non-compliance in sysdeps/posix/system.c: Hard-coded shell path
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 minor
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-15 13:28 UTC by Shea Levy
Modified: 2014-06-27 13:35 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shea Levy 2011-04-15 13:28:03 UTC
From http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html:

"Applications should note that the standard PATH to the shell cannot be assumed to be either /bin/sh or /usr/bin/sh, and should be determined by interrogation of the PATH returned by getconf PATH , ensuring that the returned pathname is an absolute pathname and not a shell built-in."

From sysdeps/posix/system.c:

#define SHELL_PATH      "/bin/sh"       /* Path of the shell.  */

Thus any application that uses system() is violating the above section.
Comment 1 Andreas Schwab 2011-04-15 13:46:51 UTC
glibc is not an application, it is part of the system that defines the location
of the shell.
Comment 2 Shea Levy 2011-04-15 13:51:04 UTC
No, glibc is not an application, but it causes any application that uses system() to assume that the path to the shell is /bin/sh rather than interrogating PATH.