Skip to content
  • Simon McVittie's avatar
    gdbusauthmechanismexternal: Optionally send empty authorization identity · e0a07492
    Simon McVittie authored
    When using a GDBus client in a non-trivial user namespace, the result of
    geteuid() can differ from the uid in the namespace where the server is
    running. This would result in connection attempts being rejected, because
    the identity that the client claims to have does not match the identity
    that the server derives from its credentials.
    
    RFC 4422 allows us to send an empty authorization identity, which means we
    want to authenticate as whatever identity the server can derive from our
    out-of-band credentials. In particular, this resolves the authentication
    failure when crossing between different Linux user namespaces.
    
    Because D-Bus does not have a way to represent an empty initial response
    as distinct from the absence of an initial response, we cannot use the
    initial-response optimization (RFC 4422 §4.3.a) in this case, and must
    fall back to waiting for the server to send a challenge.
    
    Unfortunately, GDBus versions older than !2826 ...
    e0a07492