Unexpected gdbus behaviour during PAM authentication



Hi all,

I've been trying to create a pam module that sends a dbus message to a
service using gdbus, but it's failing in a way I can't figure out.

I've used gdbus and gdbus-codegen for both the service and the caller,
and it all seems to work fine when I call the service from a simple test
application.

However, when I move the same code from the test program to a pam module
I then get the unexpected behaviour. The first time the pam module is
run I call *_proxy_new_for_bus_sync to return a proxy and when I use
this to call the service it all 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.

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.

I'm confused for two reasons. First, I find it odd that the behaviour is
inconsistent across executions. Second *_proxy_new_for_bus_sync is
returning NULL without returning an error, which the documentation
doesn't seem to cover.

If anyone has any suggestions for what might be going on, I'd be
grateful. I uploaded a minimal working example to github:

Service: https://github.com/llewelld/dbus-pam-test/blob/master/src/service.c
Test app: https://github.com/llewelld/dbus-pam-test/blob/master/src/test.c
Pam module:
https://github.com/llewelld/dbus-pam-test/blob/master/src/pam_test.c

And in case it's helpful, the output to syslog from running these is
here: https://github.com/llewelld/dbus-pam-test/blob/master/log-output.log

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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]