Bug 207807 - mountd: mountd.pid file is not readable by normal users
Summary: mountd: mountd.pid file is not readable by normal users
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
Keywords: patch
Depends on:
Reported: 2016-03-08 14:34 UTC by Ruben Kerkhof
Modified: 2016-04-04 08:04 UTC (History)
1 user (show)

See Also:

Change permissions of mountd.pid to 0644 (1.38 KB, patch)
2016-03-08 14:42 UTC, Ruben Kerkhof
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.