On Sat, 2014-08-23 at 21:21 +0200, Jarry wrote:
> Hi Gentoo-users,
> 
> after playing with PAM for a few days I discovered one strange
> thing: PAM adds ".db" suffix to database definition on its own!
> What I mean is following:
> _____________________
> 
> more /etc/pam.d/postfix
> auth    required  pam_userdb.so  db=/etc/postfix/virtual_users.db
> account required  pam_userdb.so  db=/etc/postfix/virtual_users.db
> 
> ls -l /etc/postfix/virtual_users.db
> -rw------- 1 root root 12288 Aug 20 18:45 /etc/postfix/virtual_users.db
> 
> testsaslauthd -u user1 -p password1 -s postfix
> 0: NO "authentication failed"
> 
> tail -n1 saslauth.log
> saslauthd: pam_userdb(postfix:auth): user_lookup: could not open
> database '/etc/postfix/virtual_users.db': no such file or directory
> ______________________
> 
> Then I changed /etc/pam.d/postfix to:
> 
> auth    required  pam_userdb.so  db=/etc/postfix/virtual_users
> account required  pam_userdb.so  db=/etc/postfix/virtual_users
> 
> And now everything works. But there is no /etc/postfix/virtual_users
> file, only /etc/postfix/virtual_users.db!
> 
> So it seems to me PAM adds ".db" to database-definition itself
> and user has to define it without ".db", otherwise what PAM is
> actually looking for is /etc/postfix/virtual_users.db.db
> 
> Is this normal? Never seen this "Windows-like" behaviour with
> auto-adding suffix in *nix world. And I did not find anything
> about it in PAM-documentation. It says just:
> 
> pam_userdb.so db=/path/database
> 
> Not a single word that user has to cut ".db" suffix from
> "database" off. If all this is feature and not bug, then it
> should definitely be mentioned somewhere...
> 
> Jarry

I think it's doing it correctly, because postfix doesn't lookup text
files. Instead it expects hash files which are to be generated using
stuff like newaliases (for /etc/mail/aliases.db).

-- 
Nilesh Govindrajan <[email protected]>


Reply via email to