polkit fails to authenticate on dbus
karu.pruun
karu.pruun at gmail.com
Sun Jan 25 16:44:50 PST 2015
On Thu, Jan 22, 2015 at 10:20 PM, Simon McVittie wrote:
> polkitd uses GDBus, part of the GIO module in GLib, so that's the place
> to start looking to find out why polkitd is saying "hi, I'm uid
> (uint32_t) -1" instead of "hi, I'm uid 0". My guess is that some API
> call used by GLib is failing and returning -1, and GLib isn't catching
> that failure.
>
> If my theory is correct, then gdbus(1) and other tools that use GDBus
> will fail to authenticate in exactly the same way polkitd does, but
> libdbus applications like dbus-send(1) and dbus-monitor(1) might be
> fine. Please try that and see what happens.
You were right! dbus was fine: in dbus, DragonFly runs through the
same codepath as FreeBSD, namely, the one defined by the HAVE_CMSGCRED
macro. (Interestingly DragonFly is mentioned in the code.)
However, the problem was with GLib where the support for the same
mechanism is implemented via a #defined macro. Adding #elif
defined(__DragonFly__) etc in gio/gcredentialsprivate.h did the trick.
polkitd now runs and authenticates fine.
I'll try and see if I can submit a patch to GLib directly.
Thanks again for your helpful comments, as well as others above. They
were crucial in fixing the issue.
Peeter
--
More information about the dbus
mailing list