Aug 08 2007
Internal error: pcfg_openfile() called with NULL filename
While upgrading Apache to version 2.2.4-2 for a subversion upgrade (version 1.4.4dfsg1-1) I ran into errors with my auth_pgsql (or any other auth_mysql, auth_ldap or auth_* module) setup:
“Internal error: pcfg_openfile() called with NULL filename”
This is caused by auth_basic and stops the authentication and authorisation process. Adding the following directive to your auth_pgsql or auth_ldap config file solves the problem:
“AuthBasicAuthoritative Off”
It disables basic authorisation being authoritive for the authorisation process. The errors will still be visible in your logfiles, but the authorisation scheme works as normal.
Other tags:
- Apache 2.2 error
- Apache 2.2 subversion 1.4.4 error
- mod_pgsql pcfg_openfile errors
http://gforge.org/forum/message.php?msg_id=10926&group_id=128
Thanks! That was a quick google to fix my problem
David.
Thanks a lot! I had the same problem with mod_auth_imap.
Thanks!! Solved issue…
You can get rid of the errors by addding
AuthUserFile /dev/null
to your configuration file. I found this over here: http://readthefuckingmanual.net/error/1387/ (sorry for the website name–not mine!)
And thanks for the post–hard to find solutions sometimes for simple stuff like this.
-Shane
Thanks, fixed my issue
.
FYI, also found this line in my logs “(9)Bad file descriptor: Could not open password file: (null)” which was also caused by this error.
thx 4 ur info
Thanks for the solution.
To avoid the entries in the error log, I created an empty password file (by creating a one user file and then deleting the user), then pointed apache to it.
htpasswd -c /home/test/emptypw testuser
htpasswd -D /home/test/emptypw testuser
# patch for ‘Internal error: pcfg_openfile() called with NULL filename’
# empty password file ‘emptypw’ prevents error messages
AuthBasicAuthoritative Off
AuthUserFile /home/test/emptypw
Thanks a lot!
I seek the answer for a one month!!!
It has nothing to do with htpasswd.
The solution is to have `AuthBasicAuthoritative Off`.
But Apache error log keeps claiming `Internal error: pcfg_openfile() called with NULL filename` and `(9)Bad file descriptor: Could not open password file: (null)`.
To get rid of that error too add `AuthUserFile /dev/null`.
Thus my `httpd.conf` extract
.
.
DAV svn
SVNParentPath /var/svn
# To get rid of
# 1. `Internal error: pcfg_openfile() called with NULL filename`
# 2. `user … not found`
AuthUserFile /dev/null
AuthBasicAuthoritative Off
.
.
.
require valid-user
.
.
.
My environment:
Red Hat Enterprise Linux Server release 5.2 (Kernel 2.6.18-92.el5)
Apache 2.2.11
Subversion 1.6.3
Note: I’m authenticating using mod_auth_mysql v3.0.0.
Windows users do not have the ability to specify “AuthUserFile /dev/null”. Furthermore, that is an undesirable solution. This is the appropriate method (which is described in the rtfm.net document referenced earlier in this thread), provided as a complete example:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
AuthBasicProvider dbm
AuthDBMType SDBM
AuthBasicAuthoritative Off
AuthName “Protected Area”
AuthType Basic
AuthDBMUserFile “D:/Program Files/Apache/passwords.dat”
require valid-user
Obviously, “AuthBasicProvider” and “AuthDBMType” must reflect the correct values for your system (available types for “AuthDBMType” are: default|SDBM|GDBM|NDBM|DB). See http://httpd.apache.org/docs/2.0/mod/mod_auth_dbm.html and http://httpd.apache.org/docs/2.1/mod/mod_auth_basic.html for additional information.
The above example functions as expected with Berkeley DB (11gR2) and Apache 2.0.48 on Windows 7 x86. “passwords.dat” should be created with something like this:
> D:\Program Files\apache\bin>htdbm -cs “D:\Program Files\Apache\passwords.dat” yourname
Be good!
Moderator, you may wish to replace my earlier comment with the following, which contains a few corrections and has extraneous information removed. Thanks!
=================================================
Windows users do not have the ability to specify “AuthUserFile /dev/null”. Furthermore, that is an undesirable solution (as others have noted). This is the appropriate method, provided as a complete example (these directives would go inside a tag within httpd.conf, a .htaccess file, etc.):
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
AuthBasicProvider dbm
AuthDBMType SDBM
AuthName “Protected Area”
AuthType Basic
AuthDBMUserFile “D:/Program Files/Apache/passwords.dat”
require valid-user
Obviously, “AuthBasicProvider” and “AuthDBMType” must reflect the correct values for your system (available types for “AuthDBMType” are: default|SDBM|GDBM|NDBM|DB). See http://httpd.apache.org/docs/2.0/mod/mod_auth_dbm.html and http://httpd.apache.org/docs/2.1/mod/mod_auth_basic.html for additional information.
The above example functions as expected with Apache 2.2.6 on Windows 7 x86. “passwords.dat” should be created with something like this:
> D:\Program Files\apache\bin>htdbm -cs “D:\Program Files\Apache\passwords.dat” yourname
Note also that, according to the mod_auth_basic manual page (cited above), setting “AuthBasicAuthoritative” to “Off” “… should only be necessary when combining mod_auth_basic with third-party modules that are not configured with the AuthBasicProvider directive.”
Thanks to everyone here for the assistance in getting this to work properly (under Windows, no less).