Skip to content
  • Simon McVittie's avatar
    Add support for unix:runtime=yes as an address mode · e3f117e7
    Simon McVittie authored
    This is not used by default, but can be configured by OS builders (or
    regression-test environments) if desired.
    
    If used, this listens on $XDG_RUNTIME_DIR/bus, or fails if $XDG_RUNTIME_DIR
    is not set. Fallback behaviour is unnecessary, because it is already
    possible to use a string of semicolon-separated addresses like
    <listen>unix:runtime=yes;unix:tmpdir=/tmp</listen>, resulting in
    listening on either $XDG_RUNTIME_DIR/bus or /tmp/something.
    
    We use a non-abstract socket here, because that is desirable for
    use with Linux containers: abstract sockets are attached to the
    network namespace, whereas non-abstract sockets are part of the
    filesystem and can be bind-mounted between domains if necessary.
    The major advantage of abstract sockets is that they do not need
    cleanup, but the specification of XDG_RUNTIME_DIR guarantees to
    provide cleanup anyway.
    
    Based on prior work by Simon McVittie, Colin Walters and Alexander
    Larsson.
    
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61303
    
    
    Reviewed-by: default avatarPhilip Withnall <philip.withnall@collabora.co.uk>
    e3f117e7