SA Bugzilla – Bug 3046
spamd forces unix domain sockets to spamd user owned, mode 0666
Last modified: 2004-05-05 14:00:33 UTC
The README.spamd (on my debian box) points out all the caveats of running spamd as root if users can connect to it. However, there's 99% of a reasonable mechanism to solve this problem already in place. spamd and spamc can use a unix domain socket. If I were to make the socket owned by a particular user (cyrus is convenient for me) and mode 600, I could run spamd as root, run spamc with the -u flag as user cyrus (from postfix, in my setup), and have reasonable security guarantees. However, when spamd starts up, it unlinks the existing unix domain socket, creates a new one as the spamd user, and then chmods it to 666! I think it would be very useful in a future version of spamd to have new flags to set the socket owner and mode (I propose --socketowner, --socketgroup, and --socketmode). In fact, I've appended a patch which implements this.
Created attachment 1776 [details] this patch implements the enhancement request
Taking bug.
btw why not just put the socket in a mode 0700 directory?
Good question. I suppose that would be sufficient, but it's a little more convenient this way (I don't need to maintain a local hack to init.d/spamassassin to create the directory if it doesn't exist). I could get around this by putting the socket in a directory outside of /var/run, but /var/run is the obvious place to put this.
assigning back to -dev
ok, just checked in a version of this. didn't use the patch, but I did use the same switch names ;)