From 13ecd00fcc2fe6e4104ce73d500484f517e5417b Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 15 Nov 2010 17:12:31 +0100 Subject: abrt-handle-crashdump: prepend our libexec path to $PATH Signed-off-by: Denys Vlasenko --- src/daemon/Daemon.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/daemon/Daemon.cpp') diff --git a/src/daemon/Daemon.cpp b/src/daemon/Daemon.cpp index 72bb54bf..7d31ebac 100644 --- a/src/daemon/Daemon.cpp +++ b/src/daemon/Daemon.cpp @@ -840,13 +840,13 @@ int main(int argc, char** argv) * (I saw it set only DBUS_STARTER_ADDRESS and DBUS_STARTER_BUS_TYPE). * In this case, set something sane: */ - if (!getenv("PATH")) - putenv((char*)"PATH=/usr/sbin:/usr/bin:/sbin:/bin"); - - /* need to add LIBEXEC_DIR to PATH, because otherwise abrt-action-* - * is not found by exec() + /* Need to add LIBEXEC_DIR to PATH, because otherwise abrt-action-* + * are not found by exec() */ - putenv(xasprintf("PATH=%s:%s", LIBEXEC_DIR, getenv("PATH"))); + const char *env_path = getenv("PATH"); + if (!env_path || !env_path[0]) + env_path = "/usr/sbin:/usr/bin:/sbin:/bin"; + putenv(xasprintf("PATH=%s:%s", LIBEXEC_DIR, env_path)); putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose)); -- cgit