On 24-Aug-14 0:07, Alan McKinnon wrote:
On 23/08/2014 21:21, 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...


Consult Google and find out more about postfix's postmaps with
particular reference to how it's done if you use db files from sleepycat

This has nothing to do with postfix, I used it just as
an example. I had the very same problem with ftp.

My Postfix uses cyrus-sasl for smtp-authentification,
and cyrus-sasl in my example uses pam with user-db.

Problem is PAM configuration, which must contain:
db=/etc/postfix/virtual_users (without ".db")

But real user database is in:
/etc/postfix/virtual_users.db

This I find very strange...

Jarry
--
_______________________________________________________________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.

Reply via email to