Unexpected gdbus behaviour during PAM authentication

David Llewellyn-Jones david at flypig.co.uk
Fri Jan 13 14:37:59 UTC 2017


Hi all,

I've been experiencing strange behaviour connecting to the system bus
from a pam module. This is on Ubuntu 16.04 using gdbus and gdbus-codegen
for both the caller and listening service.

Using a simple test application for thee caller everything works fine.
Here's the minimal code for the test app and service:
https://github.com/llewelld/dbus-pam-test/blob/master/src/test.c
https://github.com/llewelld/dbus-pam-test/blob/master/src/service.c

However, when I move the same code from the test program to a pam module
I then get the unexpected behaviour. The pam module is executed by
pressing Win-L to trigger the Unity lock screen.

The first time the pam module is run, it calls *_proxy_new_for_bus_sync
to return a proxy and then calls the service and everything works fine.
The second time it's run the same *_proxy_new_for_bus_sync function
returns a NULL proxy, but apparently without returning any error. The
third time it's run the *_proxy_new_for_bus_sync function hangs and
never returns.

Here's the code for the pam module:
https://github.com/llewelld/dbus-pam-test/blob/master/src/pam_test.c

This behaviour happens when I use the pam module with the unity lock
screen, but if I use pamtester instead, everything works fine every time.

And in case it's helpful, the output to syslog from running the service
and pam module can be seen here:
https://github.com/llewelld/dbus-pam-test/blob/master/log-output.log

Does anyone have any suggestion for why this might be happening?

David
-- 
Website: http://www.flypig.co.uk


More information about the dbus mailing list