[oe-commits] [openembedded-core] 45/94: base-files: add some safety checks in profile
git at git.openembedded.org
git at git.openembedded.org
Wed Jun 29 18:37:09 UTC 2016
rpurdie pushed a commit to branch krogoth
in repository openembedded-core.
commit fde37b91284953cedc50bc32d22aac65a65afde1
Author: Diego Rondini <diego.ml at zoho.com>
AuthorDate: Fri Apr 29 12:24:09 2016 +0200
base-files: add some safety checks in profile
Add some safety checks when sourcing files in /etc/profile.d/, in particular:
- source only *.sh files, not every file. This is the practice in use in both
Fedora and Debian/Ubuntu (see
https://help.ubuntu.com/community/EnvironmentVariables#A.2Fetc.2Fprofile.d.2F.2A.sh);
- check the input is actually a file and is readable. This check is especially
important if profile.d is empty, as "*.sh" will get expanded only if
profile.d is not empty. Previously if profile.d was present but empty,
"/etc/profile.d/*" was sourced causing errors on login and breaking stuff, for
example X startup.
(From OE-Core rev: 8961bc4b71723477a3b4a837a1d9c25c1b860b9e)
Signed-off-by: Diego Rondini <diego.ml at zoho.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster at mvista.com>
---
meta/recipes-core/base-files/base-files/profile | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index 53c2680..e98e786 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -20,8 +20,10 @@ if [ "$PS1" ]; then
fi
if [ -d /etc/profile.d ]; then
- for i in /etc/profile.d/* ; do
- . $i
+ for i in /etc/profile.d/*.sh ; do
+ if [ -f $i -a -r $i ]; then
+ . $i
+ fi
done
unset i
fi
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list