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

About logging in with kdm and login.


I'm with a module, pam_script. This module is able to execute a script when a 
session starts and ends.

I'm using this ability to execute some scripts when a user logins in for the 
first time, and when a user is logging out and he is not logged in on a other 

To do this I use the utility "w": 
wc -h $userid | wc -l 
gives the amount this user is logged in.

Now when logging in for the first time - with login (of the shadow [ackage)
or with kdm (of kde) - this is zero. That makes sense. Until pam has completed 
all the things it does when a user logs in, this user is still not logged in. 
He is when pam has finished.

So, there is no problem when logging in (at the console or with a graphical 

But now loging out. When logging out with login (part of shadow)
the output of the command is:

wc -h $userid | wc -l


but when logging out with kdm it is:

wc -h $userid | wc -l


Now kdm and login are using the same file in the /etc/pam.d directory.
I'm using kdm from kde-3.4.2, and login from shadow-4.0.12.

When I look at the source code (login.c and client.c resp.)
I can't explain this different behaviour. Both are calling (in this order):

pam_setcred(pamh, PAM_DELETE_CRED)
retcode = pam_close_session(pamh,0)

KDM is not using the variable retcode, but I think that's not important. The 
order is what counts.

Does anybody know what's causing this?

Thanks in advance.

Stef Bon

(but really, I don't want to understand, I only want that wahtever way I 
login, the behaviour should be exactly the  same.)

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