Gentoo Archives: gentoo-user

From: Jarry <mr.jarry@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] PAM auto-adding ".db" suffix: feature or bug?
Date: Sun, 24 Aug 2014 04:54:14
Message-Id: 53F96F55.9060609@gmail.com
In Reply to: Re: [gentoo-user] PAM auto-adding ".db" suffix: feature or bug? by Alan McKinnon
1 On 24-Aug-14 0:07, Alan McKinnon wrote:
2 > On 23/08/2014 21:21, Jarry wrote:
3 >> Hi Gentoo-users,
4 >>
5 >> after playing with PAM for a few days I discovered one strange
6 >> thing: PAM adds ".db" suffix to database definition on its own!
7 >> What I mean is following:
8 >> _____________________
9 >>
10 >> more /etc/pam.d/postfix
11 >> auth required pam_userdb.so db=/etc/postfix/virtual_users.db
12 >> account required pam_userdb.so db=/etc/postfix/virtual_users.db
13 >>
14 >> ls -l /etc/postfix/virtual_users.db
15 >> -rw------- 1 root root 12288 Aug 20 18:45 /etc/postfix/virtual_users.db
16 >>
17 >> testsaslauthd -u user1 -p password1 -s postfix
18 >> 0: NO "authentication failed"
19 >>
20 >> tail -n1 saslauth.log
21 >> saslauthd: pam_userdb(postfix:auth): user_lookup: could not open
22 >> database '/etc/postfix/virtual_users.db': no such file or directory
23 >> ______________________
24 >>
25 >> Then I changed /etc/pam.d/postfix to:
26 >>
27 >> auth required pam_userdb.so db=/etc/postfix/virtual_users
28 >> account required pam_userdb.so db=/etc/postfix/virtual_users
29 >>
30 >> And now everything works. But there is no /etc/postfix/virtual_users
31 >> file, only /etc/postfix/virtual_users.db!
32 >>
33 >> So it seems to me PAM adds ".db" to database-definition itself
34 >> and user has to define it without ".db", otherwise what PAM is
35 >> actually looking for is /etc/postfix/virtual_users.db.db
36 >>
37 >> Is this normal? Never seen this "Windows-like" behaviour with
38 >> auto-adding suffix in *nix world. And I did not find anything
39 >> about it in PAM-documentation. It says just:
40 >>
41 >> pam_userdb.so db=/path/database
42 >>
43 >> Not a single word that user has to cut ".db" suffix from
44 >> "database" off. If all this is feature and not bug, then it
45 >> should definitely be mentioned somewhere...
46 >
47 >
48 > Consult Google and find out more about postfix's postmaps with
49 > particular reference to how it's done if you use db files from sleepycat
50
51 This has nothing to do with postfix, I used it just as
52 an example. I had the very same problem with ftp.
53
54 My Postfix uses cyrus-sasl for smtp-authentification,
55 and cyrus-sasl in my example uses pam with user-db.
56
57 Problem is PAM configuration, which must contain:
58 db=/etc/postfix/virtual_users (without ".db")
59
60 But real user database is in:
61 /etc/postfix/virtual_users.db
62
63 This I find very strange...
64
65 Jarry
66 --
67 _______________________________________________________________
68 This mailbox accepts e-mails only from selected mailing-lists!
69 Everything else is considered to be spam and therefore deleted.

Replies

Subject Author
Re: [gentoo-user] PAM auto-adding ".db" suffix: feature or bug? Alan McKinnon <alan.mckinnon@×××××.com>