[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.18-22-geac5662

Lennart Poettering gitmailer-noreply at 0pointer.de
Tue Sep 29 10:35:59 PDT 2009


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  faf113d95bfa6be3baa5d5a7330984e04bfd895f (commit)

- Log -----------------------------------------------------------------
eac5662 Don't refuse to start on systems using GNU stow, graft, STORE et al
-----------------------------------------------------------------------

Summary of changes:
 src/daemon/main.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

-----------------------------------------------------------------------

commit eac566226ed9026347cdb415a93ad9b15fbd8b45
Author: Nix <nix at esperi.org.uk>
Date:   Sat Sep 26 20:18:00 2009 +0100

    Don't refuse to start on systems using GNU stow, graft, STORE et al
    
    There are multiple package management systems out there which implement
    packages using symlinks. The recent (otherwise useful) check to ensure that
    a re-executed pulseaudio is actually reexecuting itself unfortunately breaks
    in the presence of all these packaging systems, because PA_BINARY refers
    to its installed location (e.g. /usr/local/bin/pulseaudio), which is a
    symlink to the binary (e.g. /usr/local/stow/pulseaudio-0.9.18/bin/pulseaudio),
    because /proc/self/exe always contains the canonical path of the executable,
    with all symlinks resolved.
    
    (At least one distribution uses a symlink-based packaging system, so
    will be forced to apply this locally in any case.)
    
    The fix is simple: canonicalize PA_BINARY before equality-testing. (This
    should be completely safe, because the OS does just that when PA_BINARY
    is executed.)
    
    The patch is against 0.9.18, but applies without fuzz to current master.

diff --git a/src/daemon/main.c b/src/daemon/main.c
index af59ade..2e16c18 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -416,23 +416,28 @@ int main(int argc, char *argv[]) {
 
     if (!getenv("LD_BIND_NOW")) {
         char *rp;
+        char *canonical_rp;
 
         /* We have to execute ourselves, because the libc caches the
          * value of $LD_BIND_NOW on initialization. */
 
         pa_set_env("LD_BIND_NOW", "1");
 
+        canonical_rp = pa_realpath(PA_BINARY);
+
         if ((rp = pa_readlink("/proc/self/exe"))) {
 
-            if (pa_streq(rp, PA_BINARY))
+            if (pa_streq(rp, canonical_rp))
                 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_log_warn("/proc/self/exe does not point to %s, cannot self execute. Are you playing games?", canonical_rp);
 
             pa_xfree(rp);
 
         } else
             pa_log_warn("Couldn't read /proc/self/exe, cannot self execute. Running in a chroot()?");
+
+        pa_xfree(canonical_rp);
     }
 #endif
 

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list