From 4a13c99ba80ef3082a4a3bd1025dd6778265ec8d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 15 Oct 2010 17:26:25 +0200 Subject: abrtd: fix "unset PATH" problem when started from dbus daemon Signed-off-by: Denys Vlasenko --- src/daemon/Daemon.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/daemon/Daemon.cpp b/src/daemon/Daemon.cpp index b8c23edd..d7ff5781 100644 --- a/src/daemon/Daemon.cpp +++ b/src/daemon/Daemon.cpp @@ -898,6 +898,13 @@ int main(int argc, char** argv) if (opts & OPT_s) start_syslog_logging(); + /* When dbus daemon starts us, it doesn't set PATH + * (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"); + putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose)); msg_prefix = "abrtd"; /* for log(), error_msg() and such */ -- cgit