From a50e6e4c500e3080b8df7ec14c7e42741477a423 Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Tue, 14 May 2013 09:48:26 -0700 Subject: 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. Signed-off-by: Ossama Othman --- man/weston.ini.man | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'man') diff --git a/man/weston.ini.man b/man/weston.ini.man index 22877306..d37654aa 100644 --- a/man/weston.ini.man +++ b/man/weston.ini.man @@ -24,7 +24,10 @@ server is started: .nf .BR "$XDG_CONFIG_HOME/weston.ini " "(if $XDG_CONFIG_HOME is set)" .BR "$HOME/.config/weston.ini " "(if $HOME is set)" -.BR "/weston.ini " "(if both variables were not set)" +.B "weston/weston.ini in each" +.BR "\ \ \ \ $XDG_CONFIG_DIR " "(if $XDG_CONFIG_DIRS is set)" +.BR "/etc/xdg/weston/weston.ini " "(if $XDG_CONFIG_DIRS is not set)" +.BR "/weston.ini " "(if no variables were set)" .fi .RE .PP @@ -32,7 +35,12 @@ where environment variable .B $HOME is the user's home directory, and .B $XDG_CONFIG_HOME -is the user specific configuration directory. +is the user specific configuration directory, and +.B $XDG_CONFIG_DIRS +is a colon +.B ':' +delimited listed of configuration base directories, such as +.BR /etc/xdg-foo:/etc/xdg . .PP The .I weston.ini -- cgit v1.2.3