[pulseaudio-tickets] [Bug 44680] "Daemon startup failed" due to "Failed to remove stale UNIX socket" and NFS-mounted homes

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Mar 13 18:27:46 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=44680

Colin Guthrie <fdo at colin.guthr.ie> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fdo at colin.guthr.ie

--- Comment #1 from Colin Guthrie <fdo at colin.guthr.ie> 2012-03-13 18:27:46 PDT ---
It looks like we're not allowing enough space in a variable somewhere for the
full socket path name.

Looking at the code, we're mostly pretty careful about our paths and using
flexible allocation etc., however I do notice this:


pa_socket_server* pa_socket_server_new_unix(pa_mainloop_api *m, const char
*filename) {
    int fd = -1;
    struct sockaddr_un sa;
    pa_socket_server *s;

    pa_assert(m);
    pa_assert(filename);

    if ((fd = pa_socket_cloexec(PF_UNIX, SOCK_STREAM, 0)) < 0) {
        pa_log("socket(): %s", pa_cstrerror(errno));
        goto fail;
    }

    memset(&sa, 0, sizeof(sa));
    sa.sun_family = AF_UNIX;
    pa_strlcpy(sa.sun_path, filename, sizeof(sa.sun_path));



Here, it's a limitation of the sa.sun_path.


Looking further in /usr/include/sys/un.h:

struct sockaddr_un
  {
    __SOCKADDR_COMMON (sun_);
    char sun_path[108];         /* Path name.  */
  };


So there we have it. 108 characters.

Not quite sure how to address this. I guess we could pass the path through
realpath() first to reduce the file size down, but it's certainly not a
universal solution. We should probably fail more gracelessly(!) when the path
overflows.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the pulseaudio-bugs mailing list