Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 345135 - sys-apps/qingy is not compatible with sys-auth/consolekit and pam_ck_connector.so
Summary: sys-apps/qingy is not compatible with sys-auth/consolekit and pam_ck_connecto...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Michele Noberasco (RETIRED)
URL: http://sourceforge.net/tracker/?func=...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-11 19:19 UTC by Samuli Suominen (RETIRED)
Modified: 2010-12-07 13:51 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
The hack to allow qingy work with consolekit (qingy-0.9.9-foo.patch,1.58 KB, patch)
2010-11-11 19:19 UTC, Samuli Suominen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Samuli Suominen (RETIRED) gentoo-dev 2010-11-11 19:19:17 UTC
Find pam_open_session in src/libraries/session.c, a child-branch of a fork() call:

<Honoome> if I got it right, consolekit gets a connection to dbus
<Honoome> and as long as that connection is open, it is considered an active session
<Honoome> but since the process that opened the session (and thus the dbus connection) is execve()'ing away, that connection is dropped

If pam_open_session is moved before the fork call, ConsoleKit gets a session as seen by `ck-list-sessions`. The attached patch is a quick hack to accomplish this, propably not Portage ready as is. 

So this bug is more a reminder for flameeyes ;-)
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2010-11-11 19:19:45 UTC
Created attachment 254027 [details, diff]
The hack to allow qingy work with consolekit
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2010-11-11 19:33:19 UTC
Here's the matching upstream bug:

http://sourceforge.net/tracker/?func=detail&aid=3107455&group_id=82854&atid=567417
Comment 3 Michele Noberasco (RETIRED) gentoo-dev 2010-12-03 10:43:28 UTC
Hi,

can you please me explain exactly how it fails? I tried with original source code, then with patch applied, and in both cases I'm able to login successfully and /var/log/messages reports:
Dec  3 13:32:44 khazad-dum qingy: pam_unix(qingy:session): session opened for user thorin by (uid=0)
Dec  3 13:32:44 khazad-dum qingy: pam_ck_connector(qingy:session): using 1001 as uid
Dec  3 13:32:44 khazad-dum qingy: pam_ck_connector(qingy:session): open session result: 1
Dec  3 13:32:44 khazad-dum qingy: pam_ck_connector(qingy:session): registered uid=1001 on tty='/dev/tty6' with ConsoleKit

Then, when I log out, it reads:
Dec  3 13:36:50 khazad-dum qingy: pam_unix(qingy:session): session closed for user thorin
Dec  3 13:36:50 khazad-dum qingy: pam_mail(qingy:session): pam_putenv: delete non-existent entry; MAIL

My /etc/pam.d/qingy is as follows:

# File autogenerated by pamd_mimic in pam eclass
auth    include         system-local-login
account include         system-local-login
password        include         system-local-login
session include         system-local-login
session optional pam_loginuid.so
session optional pam_ck_connector.so debug

Using qingy-0.9.9, consolekit-0.4.2-r4, pam-1.1.3.
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-12-03 11:27:42 UTC
Try ck-list-sessions → it will not list anything. You can find the full dissection of why (without patch) it won't work on my blog post:

http://blog.flameeyes.eu/2010/11/15/qingy-and-consolekit
Comment 5 Michele Noberasco (RETIRED) gentoo-dev 2010-12-03 15:24:27 UTC
Diego,

thanks for the heads up. I have read your blog post and found it very interesting.

Now, to start, know that I'm the author of qingy, so it is in my best interest that patches are merged upstream ;-)

To comment your blog post, you are very right. There are surely a lot of features in PAM that qingy simply does not support, such as nifty fingerprint-based authentication systems. And you are also right when you notice that qingy does some things internally, such as lastlog management, without relying on existing PAM modules. The answer is simple, when qingy was first developed, PAM did not exist yet, or if it did it was at the very beginnings and still was not the standard for Linux authentication. In fact, qingy support for PAM is optional and it works nicely on PAM-less system (such as ancient passwd or passwd+shadow systems). As such, the many little things that surround user authentication, qingy has always handled internally.

The main problem: I'm not knowledgeable about PAM, or at least any reasonably modern version of PAM. As you surely have noticed, qingy-provided pam file is broken and useless and Gentoo ebuild mercilessly (and rightly) replaces it with something resembling decency.

For the scope of this bug: I tried to run ck-list-sessions and it reports nothing, be it that login occurrs using patched or unpatched qingy, or standard agetty, so something is definitely wrong in my setup and I cannot reproduce (let alone fix) the issue. Would you please provide me with a set of USE flags to try and packages to re-emerge in order to be able to reproduce this (and have agetty work correctly with consolekit, too)?

For the broader scope, can you provide me with an explanation (or links to documentation) so that I can learn what features (such as lastlog) are available within PAM and how to support them in qingy, so that it does them internally only when PAM support is not enabled at compile time?

If you want to take this discussion outside here (maybe to your blog), I'm fine with that since I'm going off-topic.

Thanks,
Michele
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2010-12-03 21:48:38 UTC
you propably need to remove "nox11" parameter from pam_ck_connector.so from /etc/pam.d/system-login before ck-list-sessions will print anything (bug 342345) with the patch attached here.
Comment 7 Michele Noberasco (RETIRED) gentoo-dev 2010-12-06 11:47:57 UTC
(In reply to comment #6)
> you propably need to remove "nox11" parameter from pam_ck_connector.so from
> /etc/pam.d/system-login before ck-list-sessions will print anything (bug
> 342345) with the patch attached here.

My issue was much more lame than that and I will decently refrain from explaining it here :-P


I was able to make my agetty with consolekit, and subsequently reproduce this issue with unpathed qingy (patched version works). I'll make the necessary adjustments in qingy and release a new version.

Comment 8 Michele Noberasco (RETIRED) gentoo-dev 2010-12-06 15:59:27 UTC
The issue is now fixed in qingy svn repository. I'll release a new version as soon as possible.
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2010-12-06 16:02:47 UTC
(In reply to comment #8)
> The issue is now fixed in qingy svn repository. I'll release a new version as
> soon as possible.
> 

cool. thanks.
Comment 10 Michele Noberasco (RETIRED) gentoo-dev 2010-12-07 10:01:26 UTC
(In reply to comment #4)
> Try ck-list-sessions → it will not list anything. You can find the full
> dissection of why (without patch) it won't work on my blog post:
> 
> http://blog.flameeyes.eu/2010/11/15/qingy-and-consolekit

Funny how Diego goes to great extent in analyzing a problem, then when the package author tries to get some feedback, he falls silent.

Comment 11 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-12-07 12:06:49 UTC
Michele, I spent the weekend out of home, yesterday working on two paid jobs and today I'm waiting for Yamato to rebuild its storage system after replacing the two build disks... and you haven't mailed me, you left a bug comment that I only look at when I have time.

I pour in time whenever I can, I have poured a lot on ConsoleKit, and right now it's far from my priorities. We can discuss about qingy by mail if you wish, but don't pretend an immediate response on the bug when it was opened almost a month ago.
Comment 12 Michele Noberasco (RETIRED) gentoo-dev 2010-12-07 13:47:50 UTC
Released fixed qingy version and related ebuild.
Comment 13 Michele Noberasco (RETIRED) gentoo-dev 2010-12-07 13:51:24 UTC
(In reply to comment #11)
OK Diego, you are right, sorry.
I, too, devote what little time I have when I have it.

Right now I released a version that fixes only the specific issue reported in this bug, but I would like to bring qingy up to date with modern PAM systems.

If you wish to answer my previous post, please e-mail me separately, any feedback will be appreciated.

Bye,
Michele