On Wed, Oct 19, 2005 at 10:39:03AM -0700, Jeremy Kitchen wrote: > when you're running it on the command line you're probably running it > as root, and when apache is running it, it's probably running it as > the 'apache' or 'nobody' user (or whatever apache runs as on your > system) and therefore doesn't have permission to read the vpopmail > data.
On Wed, Oct 19, 2005 at 08:26:48PM +0200, Jan Lange wrote: > you must your script run as user root or vpopmail. On Wed, Oct 19, 2005 at 08:43:58PM +0200, Tijs Zwinkels wrote: > Probably your /var/vpopmail/etc/vpopmail.mysql isn't readable by the > user the apache-server runs under. Thank you all very much for your help! It certainly does seem to be something to do with permissions but I'm not sure what. If I run the program from the command line as the www-data user (which is the user Apache runs as) then it fails in the same way. However, the www-data user can read ~vpopmail/etc/vpopmail.mysql (www-data is a member of the vchkpw group and the file permissions are set to 640) and valias_insert() and valias_remove() work fine (both of which access and modify the database as my aliases are stored in the MySQL database.) I thought maybe it was something to do with the permissions in the ~vpopmail/domains directory but they are all set to be group readable and writable so www-data should be able to change them as necessary. As a temporary solution my program is owned by root:www-data with the permissions set to 04750 but I'd like to work out what is going on if possible. MySQL access works fine, is there anything else that vauth_getpw() needs access to that might be causing the problem? (Incidentally, this is not a public server - I am the only person who can run CGI programs on it.) Thank you all for your help, it's greatly appreciated. -- Charles Collicutt
Description: PGP signature