Gentoo Archives: gentoo-user

From: Nilesh Govindrajan <me@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] PAM auto-adding ".db" suffix: feature or bug?
Date: Sun, 24 Aug 2014 02:22:31
Message-Id: 1408846899.25375.0.camel@nileshgr.com
In Reply to: [gentoo-user] PAM auto-adding ".db" suffix: feature or bug? by Jarry
1 On Sat, 2014-08-23 at 21:21 +0200, Jarry wrote:
2 > Hi Gentoo-users,
3 >
4 > after playing with PAM for a few days I discovered one strange
5 > thing: PAM adds ".db" suffix to database definition on its own!
6 > What I mean is following:
7 > _____________________
8 >
9 > more /etc/pam.d/postfix
10 > auth required pam_userdb.so db=/etc/postfix/virtual_users.db
11 > account required pam_userdb.so db=/etc/postfix/virtual_users.db
12 >
13 > ls -l /etc/postfix/virtual_users.db
14 > -rw------- 1 root root 12288 Aug 20 18:45 /etc/postfix/virtual_users.db
15 >
16 > testsaslauthd -u user1 -p password1 -s postfix
17 > 0: NO "authentication failed"
18 >
19 > tail -n1 saslauth.log
20 > saslauthd: pam_userdb(postfix:auth): user_lookup: could not open
21 > database '/etc/postfix/virtual_users.db': no such file or directory
22 > ______________________
23 >
24 > Then I changed /etc/pam.d/postfix to:
25 >
26 > auth required pam_userdb.so db=/etc/postfix/virtual_users
27 > account required pam_userdb.so db=/etc/postfix/virtual_users
28 >
29 > And now everything works. But there is no /etc/postfix/virtual_users
30 > file, only /etc/postfix/virtual_users.db!
31 >
32 > So it seems to me PAM adds ".db" to database-definition itself
33 > and user has to define it without ".db", otherwise what PAM is
34 > actually looking for is /etc/postfix/virtual_users.db.db
35 >
36 > Is this normal? Never seen this "Windows-like" behaviour with
37 > auto-adding suffix in *nix world. And I did not find anything
38 > about it in PAM-documentation. It says just:
39 >
40 > pam_userdb.so db=/path/database
41 >
42 > Not a single word that user has to cut ".db" suffix from
43 > "database" off. If all this is feature and not bug, then it
44 > should definitely be mentioned somewhere...
45 >
46 > Jarry
47
48 I think it's doing it correctly, because postfix doesn't lookup text
49 files. Instead it expects hash files which are to be generated using
50 stuff like newaliases (for /etc/mail/aliases.db).
51
52 --
53 Nilesh Govindrajan <me@××××××××.com>