baiwyc119 / lxmppd

Automatically exported from code.google.com/p/lxmppd
0 stars 0 forks source link

Inaccessible user data fails too quietly. #455

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I hit an issue with my prosody server recently, which I eventually traced to a 
permissions error (prosody did not have access to the directory containing user 
account information). The symptoms were that I was unable to log in (I'm the 
only user). The logs (once cranked up to debug level) contained the following:

Dec 25 20:57:46 datamanager     debug   Assuming empty accounts storage 
('cannot open /usr/local/var/lib/prosody/zenhack%2enet/accounts/ian.dat: 
Permission denied') for user: ian@zenhack.net
Dec 25 20:57:46 datamanager     debug   Assuming empty accounts storage 
('cannot open /usr/local/var/lib/prosody/zenhack%2enet/accounts/ian.dat: 
Permission denied') for user: ian@zenhack.net
Dec 25 20:57:46 datamanager     debug   Assuming empty accounts storage 
('cannot open /usr/local/var/lib/prosody/zenhack%2enet/accounts/ian.dat: 
Permission denied') for user: ian@zenhack.net
Dec 25 20:59:07 datamanager     debug   Assuming empty roster storage ('cannot 
open /usr/local/var/lib/prosody/zenhack%2enet/roster/ian.dat: Permission 
denied') for user: ian@zenhack.net
Dec 25 20:59:07 datamanager     debug   Assuming empty roster storage ('cannot 
open /usr/local/var/lib/prosody/zenhack%2enet/roster/ian.dat: Permission 
denied') for user: ian@zenhack.net

In my opinion, this should cause the server to fail to start, with a message 
logged at *error* level. I can't think of a circumstance where the current 
behavior is reasonable.

What steps will reproduce the problem?
1. configure prosody for "internal" storage
2. create a user
3. ensure that prosody's data directory (in my case /usr/local/var/lib/prosody) 
is not executable by the user prosody will run as
4. set log level to debug.
5. restart the server

What is the expected output? What do you see instead?

Prosody *should* fail early and loudly -- preferably the server should fail to 
start, displaying an error message (and writing the same message to the logs at 
error level).

Currently, Prosody will log a message at debug level, and start running. Users 
will be unable to log in, since prosody cannot access the user database.

What version of the product are you using? On what operating system?

Prosody 0.9.7 on FreeBSD 9.3

Please provide any additional information below.

Original issue reported on code.google.com by i...@zenhack.net on 28 Dec 2014 at 5:34