diff options
author | Tanu Kaskinen <tanuk@iki.fi> | 2009-08-16 21:25:48 +0300 |
---|---|---|
committer | Tanu Kaskinen <tanuk@iki.fi> | 2009-08-16 21:25:48 +0300 |
commit | bcaba0b1b43d6a1b32aadfa98860f40b2c93e136 (patch) | |
tree | 6bd0d60a8fa822bfd688b90d062d0f73eee2e47e /src/daemon/main.c | |
parent | 2bb3eef414f80189cf6af6cd66c519630e4c0a43 (diff) | |
parent | 01e4b61a910afdd21f860fadbe98075735c2bf51 (diff) |
Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
Conflicts:
src/Makefile.am
src/daemon/daemon-conf.c
src/daemon/daemon.conf.in
src/modules/module-stream-restore.c
src/pulse/client-conf.c
src/pulsecore/namereg.c
Diffstat (limited to 'src/daemon/main.c')
-rw-r--r-- | src/daemon/main.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/daemon/main.c b/src/daemon/main.c index f4209859..73696005 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -110,7 +110,7 @@ int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; #endif -#ifdef HAVE_OSS +#ifdef HAVE_OSS_WRAPPER /* padsp looks for this symbol in the running process and disables * itself if it finds it and it is set to 7 (which is actually a bit * mask). For details see padsp. */ @@ -407,7 +407,8 @@ int main(int argc, char *argv[]) { /* Disable lazy relocations to make usage of external libraries more deterministic for our RT threads. We abuse __OPTIMIZE__ as - a check whether we are a debug build or not. + a check whether we are a debug build or not. This all is + admittedly a bit snake-oilish. */ if (!getenv("LD_BIND_NOW")) { @@ -418,9 +419,16 @@ int main(int argc, char *argv[]) { pa_set_env("LD_BIND_NOW", "1"); - if ((rp = pa_readlink("/proc/self/exe"))) - pa_assert_se(execv(rp, argv) == 0); - else + if ((rp = pa_readlink("/proc/self/exe"))) { + + if (pa_streq(rp, PA_BINARY)) + pa_assert_se(execv(rp, argv) == 0); + else + pa_log_warn("/proc/self/exe does not point to " PA_BINARY ", cannot self execute. Are you playing games?"); + + pa_xfree(rp); + + } else pa_log_warn("Couldn't read /proc/self/exe, cannot self execute. Running in a chroot()?"); } #endif @@ -435,10 +443,13 @@ int main(int argc, char *argv[]) { /* We might be autospawned, in which case have no idea in which * context we have been started. Let's cleanup our execution * context as good as possible */ + + pa_reset_personality(); pa_drop_root(); pa_close_all(passed_fd, -1); pa_reset_sigs(-1); pa_unblock_sigs(-1); + pa_reset_priority(); setlocale(LC_ALL, ""); pa_init_i18n(); |