From c83e3a7f83ac8d47cbb20d6ead6de7c99009fcde Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 29 Jan 2015 15:11:51 +0100 Subject: [PATCH] Properly handle the session daemon not running --- xdg-app-helper.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xdg-app-helper.c b/xdg-app-helper.c index 024d6d50..d2b6a219 100644 --- a/xdg-app-helper.c +++ b/xdg-app-helper.c @@ -245,6 +245,7 @@ ascii_isdigit (char c) static int create_etc_symlink = 0; static int create_etc_dir = 1; +static int create_monitor_links = 0; static const create_table_t create[] = { { FILE_TYPE_DIR, ".oldroot", 0755 }, @@ -270,7 +271,7 @@ static const create_table_t create[] = { { FILE_TYPE_DIR, "etc", 0755, NULL, 0, &create_etc_dir}, { FILE_TYPE_REGULAR, "etc/passwd", 0755, NULL, 0, &create_etc_dir}, { FILE_TYPE_REGULAR, "etc/group", 0755, NULL, 0, &create_etc_dir}, - { FILE_TYPE_SYMLINK, "etc/resolv.conf", 0755, "/run/user/%1$d/xdg-app-monitor/resolv.conf", 0, &create_etc_dir}, + { FILE_TYPE_SYMLINK, "etc/resolv.conf", 0755, "/run/user/%1$d/xdg-app-monitor/resolv.conf", 0, &create_monitor_links}, { FILE_TYPE_REGULAR, "etc/machine-id", 0755, NULL, 0, &create_etc_dir}, { FILE_TYPE_DIR, "tmp/.X11-unix", 0755 }, { FILE_TYPE_REGULAR, "tmp/.X11-unix/X99", 0755 }, @@ -627,7 +628,7 @@ link_extra_etc_dirs () dst_path = strconcat ("/usr/etc/", dirent->d_name); if (symlink (dst_path, src_path) != 0) - die ("symlink %s", src_path); + die_with_error ("symlink %s", src_path); free (dst_path); free (src_path); @@ -1103,6 +1104,9 @@ main (int argc, } } + if (monitor_path != NULL && create_etc_dir) + create_monitor_links = 1; + if (n_args < 2) usage (argv);