]> code.ossystems Code Review - openembedded-core.git/commit
base-files: add some safety checks in profile
authorDiego Rondini <diego.ml@zoho.com>
Fri, 29 Apr 2016 10:24:09 +0000 (12:24 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 9 May 2016 07:03:55 +0000 (08:03 +0100)
commit8961bc4b71723477a3b4a837a1d9c25c1b860b9e
tree6793f773164a21ac7c336325acabdeb49076eba3
parent53048d65402211e0caa9a7c8b90e3d9711a5262a
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.

Signed-off-by: Diego Rondini <diego.ml@zoho.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/base-files/base-files/profile