Bug 12678

Summary: POSIX.1-2008 non-compliance in sysdeps/posix/system.c: Hard-coded shell path
Product: glibc Reporter: Shea Levy <shea>
Component: libcAssignee: Ulrich Drepper <drepper.fsp>
Status: RESOLVED INVALID    
Severity: minor CC: shea
Priority: P2 Flags: fweimer: security-
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

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.