Skip to content

Commit

Permalink
launch/config: fix path computation for <include>
Browse files Browse the repository at this point in the history
Right now, <include>some/path.conf</include> incorrectly calculates the
relative path. It appends the suffix to the path of the parent file,
rather than the parent directory.

The config_path_new() already deals with this issue. However, in case
of <include> tags we pass a forced prefix under all circumstances. This
is not what we want. This was a side effect of:

    commit dd2923e
    Author: Tom Gundersen <teg@jklm.no>
    Date:   Mon Aug 7 18:27:48 2017 +0200

        launch/config: support selinux_root_relative

Fix this by passing NULL. This way, config_path_new() will use the right
parent path.

Reviewed-by: Yang <lylyly86006869@126.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
  • Loading branch information
David Herrmann committed Feb 20, 2018
1 parent 0c7d8c9 commit 9af7901
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/launch/config.c
Expand Up @@ -1022,7 +1022,7 @@ static void config_parser_end_fn(void *userdata, const XML_Char *name) {
state->file,
state->current->include.selinux_root_relative ?
bus_selinux_policy_root() :
state->file->path,
NULL,
state->current->cdata);
if (r) {
state->error = error_trace(r);
Expand Down

0 comments on commit 9af7901

Please sign in to comment.