Bug 19706 - pam_setcred(pamh, PAM_DELETE_CRED) выполняется не под тем sessionid
Summary: pam_setcred(pamh, PAM_DELETE_CRED) выполняется не под тем sessionid
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: wdm (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Sir Raorn
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-21 17:00 MSD by Anton Farygin
Modified: 2009-04-22 23:41 MSD (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Farygin 2009-04-21 17:00:58 MSD
Для регистрации выхода пользователя из системы используется поиск 
события аудита с типом USER_END.
Данное событие генерится pam'ом при вызове функции pam_setcred(pamh, PAM_DELETE_CRED).

В случае wdm'а эта функция выполняется не в том треде, что приводит к регистрации события под не выставленным sessionid, uid и pid, отличающимся от USER_LOGIN. 

----
type=USER_LOGIN msg=audit(04/21/09 15:51:23.773:6806) : user pid=6975 uid=root auid=rider ses=18 msg='op=wdm id=rider exe=/usr/bin/wdm (hostname=?, addr=?, terminal=:0 res=success)' 
----
type=USER_END msg=audit(04/21/09 15:51:47.296:6809) : user pid=6961 uid=root auid=unset ses=unset msg='op=PAM:session_close acct=rider exe=/usr/bin/wdm (hostname=?, addr=?, terminal=:0 res=success)' 


Для сравнения - корректная запись в логе. Как видно - pid, auid, ses у обоих записей совпадают.:
----
type=USER_LOGIN msg=audit(04/21/09 15:41:03.281:6798) : user pid=9699 uid=root auid=rider ses=17 msg='op=login id=rider exe=/bin/login (hostname=?, addr=?, terminal=/dev/tty3 res=success)' 
----
type=USER_END msg=audit(04/21/09 15:41:03.888:6800) : user pid=9699 uid=root auid=rider ses=17 msg='op=PAM:session_close acct=rider exe=/bin/login (hostname=localhost, addr=127.0.0.1, terminal=/dev/tty3 res=success)
Comment 1 Sir Raorn 2009-04-21 18:18:57 MSD
Этот кусок надо переписать чуть менее чем полностью.  А по w/who иксовые сессии должны быть видны?
Comment 2 Repository Robot 2009-04-22 23:41:27 MSD
wdm-1.28-alt6 -> sisyphus:

* Wed Apr 22 2009 Alexey I. Froloff <raorn@altlinux> 1.28-alt6

- Call pam_open_session() from the same process pam_close_session()
  will be called (closes: #19706)
- pam_loginuid should be called before system-auth
- Moved wdm's authfiles to /var/lib/wdm
- Added logrotate script for wdm-error.log
- Added update_wms method
- Configuration and scripts updated:
  + GiveConsole/TakeConsole: also set "terminal"
  + Xservers, Xsetup_0: stolen from xinitrc/xdm
  + wdm-config: terminateServer for :0 set to "true", fixed paths and
    filenames