diff options
| author | Kevin Tian <kevin.tian@intel.com> | 2011-01-26 16:28:45 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-28 16:49:12 +0000 |
| commit | abc25cb88570bf54d3bb518b5083402894cca061 (patch) | |
| tree | ea24890e4acbbe6f7163645d536d5fd1c861de2f /meta/recipes-core | |
| parent | 1b26bce9675f1beb3d0370f49fc5ed9709c979f6 (diff) | |
| download | poky-abc25cb88570bf54d3bb518b5083402894cca061.tar.gz | |
base-files: remove ending colon from default $PATH for root user
now the PATH for root user defined in a problematic way
PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:
from eglibc:
/* Two adjacent colons, or a colon at the beginning or the end
of `PATH' means to search the current directory. */
that means current directory is always searched as the last path,
which could generate undesired behavior.
One example is found in LTP cron_deny01 test, which always complains
"sh: cron_deny01 not found"
cron_deny01 is a shell script which setups the initial test preparation
and then invokes itself for real test under a different user:
su $TEST_USER1 -c "$0"
'su' doesn't inherit PATH into the sub-shell, and thus $0 has to
be an absolute path to have right script found.
ltp appends the path of cron_deny01 to $PATH before running the test:
export PATH="${PATH}:${LTPROOT}/testcases/bin"
In ideal way "${LTPROOT}/testcases/bin/cron_deny01" is found and becomes
$0, which works well.
However due to the ending colon in original PATH:
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin::${LTPROOT}/testcases/bin
$0 becomes 'cron_deny01' w/o leading path which makes sub-shell under 'su'
failed to locate cron_deny01.
remove ending colon then fixes this problem.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Diffstat (limited to 'meta/recipes-core')
| -rw-r--r-- | meta/recipes-core/base-files/base-files/profile | 2 | ||||
| -rw-r--r-- | meta/recipes-core/base-files/base-files_3.0.14.bb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile index aa1c20fdb8..e9408d17d7 100644 --- a/meta/recipes-core/base-files/base-files/profile +++ b/meta/recipes-core/base-files/base-files/profile | |||
| @@ -12,7 +12,7 @@ if [ ! -e /etc/localtime ]; then | |||
| 12 | fi | 12 | fi |
| 13 | 13 | ||
| 14 | if [ "$HOME" = "/home/root" ]; then | 14 | if [ "$HOME" = "/home/root" ]; then |
| 15 | PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin: | 15 | PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin |
| 16 | fi | 16 | fi |
| 17 | if [ "$PS1" ]; then | 17 | if [ "$PS1" ]; then |
| 18 | # works for bash and ash (no other shells known to be in use here) | 18 | # works for bash and ash (no other shells known to be in use here) |
diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb index 2363feb6ba..d2fec72913 100644 --- a/meta/recipes-core/base-files/base-files_3.0.14.bb +++ b/meta/recipes-core/base-files/base-files_3.0.14.bb | |||
| @@ -2,7 +2,7 @@ SUMMARY = "Miscellaneous files for the base system." | |||
| 2 | DESCRIPTION = "The base-files package creates the basic system directory structure and provides a small set of key configuration files for the system." | 2 | DESCRIPTION = "The base-files package creates the basic system directory structure and provides a small set of key configuration files for the system." |
| 3 | SECTION = "base" | 3 | SECTION = "base" |
| 4 | PRIORITY = "required" | 4 | PRIORITY = "required" |
| 5 | PR = "r66" | 5 | PR = "r67" |
| 6 | LICENSE = "GPLv2" | 6 | LICENSE = "GPLv2" |
| 7 | LIC_FILES_CHKSUM = "file://licenses/GPL-2;md5=94d55d512a9ba36caa9b7df079bae19f" | 7 | LIC_FILES_CHKSUM = "file://licenses/GPL-2;md5=94d55d512a9ba36caa9b7df079bae19f" |
| 8 | SRC_URI = "file://rotation \ | 8 | SRC_URI = "file://rotation \ |
