OSDN Git Service

Fall back to SO_PEERCRED if credentials passing fails
authorAlexander Larsson <alexl@redhat.com>
Thu, 12 Apr 2012 14:50:20 +0000 (16:50 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 12 Apr 2012 14:50:20 +0000 (16:50 +0200)
commit386f0f29fd3dc8e39f49b50ae496c6b1feb3b0a1
tree35975abd5d4f7d4152f7870fb58c37d847d1f496
parentec91ed00f14c70cca9749347b8ebc19d72d9885b
Fall back to SO_PEERCRED if credentials passing fails

Turns out libdbus doesn't send struct ucred credentials on linux, but
just relies on the SO_PEERCRED support. However, gdbus does send, and
expect to recieve a ucred credential. So, when libdbus talks to a
gdbus server the authentication fails to send the credentials.

We fix this by falling back to g_socket_get_credentials() if we don't
get any credential messages.
gio/gunixconnection.c