Bug 207807

Summary: mountd: mountd.pid file is not readable by normal users
Product: Base System Reporter: Ruben Kerkhof <ruben>
Component: binAssignee: freebsd-bugs mailing list <bugs>
Status: New ---    
Severity: Affects Some People CC: jilles
Priority: --- Keywords: patch
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Change permissions of mountd.pid to 0644 none

Description Ruben Kerkhof 2016-03-08 14:34:55 UTC
I have a daemon running as a normal user, that runs /etc/rc.d/mountd status once in a while to check if mountd is running. /var/run/mountd.pid is only readable by root however:

% ls -l /var/run/mountd.pid 
-rw-------  1 root  wheel  5 Mar  8 14:33 /var/run/mountd.pid


It's not that it contains secret information ;)
Can those permissions please be changed?
Comment 1 Ruben Kerkhof 2016-03-08 14:42:15 UTC
Created attachment 167853 [details]
Change permissions of mountd.pid to 0644
Comment 2 Jilles Tjoelker freebsd_committer 2016-03-09 19:35:44 UTC
Unfortunately, mountd uses pidfile(3) which relies on file locking and making the file world-readable would allow any user to lock it in shared mode, possibly disturbing the scheme.
Comment 3 Ruben Kerkhof 2016-03-10 09:39:15 UTC
Thanks for the explanation Jilles.

Interestingly enough dhclient and nscd also set the permissions on their pidfiles to 644.