Nicolas Lopez
2005-Jan-27 23:08 UTC
[Dovecot] Dovecot doesn't call pam_open_session, thus dodging pam_mkhomedir
I hit a small snag using Dovecot-imapd smoothly in my environment with maildir and most of my accounts in LDAP. Since the accounts are created through a web interface on another server home directories on the mail server don't get created automatically. There's the handy pam module pam_mkhomedir.so to automagically create home directories, but unfortunatly Dovecot wasn't calling pam_open_session to run the session setup pam modules. I made a small patch to passdb-pam.c to call pam_open_session between pam_acct_mgmt and pam_get_item and now I my home dirs are automagically created and everyone is happy. So, I figured I'd share the little patch in case someone else finds it useful. My patch doesn't properly close the session which will probably iritate more advanced session modules that actually have something to clean up, oh well. Aside from manually having to create home directories Dovecot-imapd has been working really well for us for a number of months, I just finally got around to dealing with the home dir creation issue. - Nick Lopez nlopez at espri.arizona.edu -------------- next part -------------- A non-text attachment was scrubbed... Name: passdb-pam.c.diff Type: text/x-patch Size: 505 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20050127/ac7796ea/attachment-0001.bin>
news.gmane.org
2005-Feb-01 08:18 UTC
[Dovecot] Re: Dovecot doesn't call pam_open_session, thus dodging pam_mkhomedir
Nicolas Lopez wrote:> I hit a small snag using Dovecot-imapd smoothly in my environment with > maildir and most of my accounts in LDAP. Since the accounts are created > through a web interface on another server home directories on the mail > server don't get created automatically. There's the handy pam module > pam_mkhomedir.so to automagically create home directories, but > unfortunatly Dovecot wasn't calling pam_open_session to run the session > setup pam modules. I made a small patch to passdb-pam.c to call > pam_open_session between pam_acct_mgmt and pam_get_item and now I my > home dirs are automagically created and everyone is happy. > > So, I figured I'd share the little patch in case someone else finds it > useful. My patch doesn't properly close the session which will probably > iritate more advanced session modules that actually have something to > clean up, oh well. > > Aside from manually having to create home directories Dovecot-imapd has > been working really well for us for a number of months, I just finally > got around to dealing with the home dir creation issue. > > - Nick Lopez > nlopez at espri.arizona.eduNick I am running dovecot-0.99.13 on FC2 with pam_mkhomedir, and it has been working fine. Not sure why you are having a problem. If I could just figure out how to get Exim to do the same, I'd be happy :-) Thanks for the patch, I'm sure those having the same problem will be grateful! Regards -- Chris Hills IT Services North East Worcestershire College
Possibly Parallel Threads
- Dovecot doesn't call pam_open_session, thus dodging pam_mkhomedir (fwd)
- Re: Dovecot doesn't call pam_open_session, thus dodging
- RE: Dovecot doesn't call pam_open_session, thus dodging
- [s-x86] OpenSSH 1.2pre14 fails on pam_open_session() ...
- Re: sshd and PAM [summary]