diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-15 17:26:25 +0200 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-10-15 17:26:25 +0200 |
commit | 4a13c99ba80ef3082a4a3bd1025dd6778265ec8d (patch) | |
tree | 523ea00ef18f0bcbde5b40813f5388c3fcea69b4 /src | |
parent | 2860fc63ac8246fe78efd47d7319b52e8372a48c (diff) | |
download | abrt-4a13c99ba80ef3082a4a3bd1025dd6778265ec8d.tar.gz abrt-4a13c99ba80ef3082a4a3bd1025dd6778265ec8d.tar.xz abrt-4a13c99ba80ef3082a4a3bd1025dd6778265ec8d.zip |
abrtd: fix "unset PATH" problem when started from dbus daemon
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/daemon/Daemon.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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 */ |