config-parser: Honor XDG_CONFIG_DIRS.
authorOssama Othman <ossama.othman@intel.com>
Fri, 10 May 2013 20:13:11 +0000 (13:13 -0700)
committerOssama Othman <ossama.othman@intel.com>
Tue, 14 May 2013 05:25:58 +0000 (22:25 -0700)
commitdd0dc86946cda0caa6d1564d7dbc9f33b446fba7
treee4e10e399d27bf2944fa593c2e2538a5025ae0e6
parent68e95c289f412df1e3293cbd921bdfbc786192b9
config-parser: Honor XDG_CONFIG_DIRS.

This set of changes adds support for searching for a given config file
in the directories listed in $XDG_CONFIG_DIRS if it wasn't found in
$XDG_CONFIG_HOME or ~/.config.  This allows packages to install custom
config files in /etc/xdg/weston, for example, thus allowing them to
avoid dealing with home directories.

To avoid a TOCTOU race the config file is actually open()ed during the
search.  Its file descriptor is returned and stored in the compositor
for later use when performing subsequent config file parses.

Change-Id: If473edf71839434eb0de88061a3ceca593a934ad
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
14 files changed:
clients/desktop-shell.c
clients/tablet-shell.c
clients/terminal.c
clients/window.c
man/weston.ini.man
shared/config-parser.c
shared/config-parser.h
src/compositor-android.c
src/compositor-drm.c
src/compositor-wayland.c
src/compositor-x11.c
src/compositor.c
src/compositor.h
src/shell.c