Allow any user to read the NFS stats, for example with nfsstat(1).

This was originally allowed by 3cea29603d (2011).  But it got broken by
693957f886 (2016) and apparently nobody noticed.

MFC after:	1 week
Sponsored by:	Axcient
Reviewed by:	rmacklem, ken
Differential Revision: https://reviews.freebsd.org/D37589
This commit is contained in:
Alan Somers 2022-12-01 14:08:01 -07:00
parent 97c802923e
commit d2ce00e9a6

View file

@ -85,7 +85,7 @@ sys_nfssvc(struct thread *td, struct nfssvc_args *uap)
AUDIT_ARG_CMD(uap->flag);
/* Allow anyone to get the stats. */
if ((uap->flag & ~NFSSVC_GETSTATS) != 0) {
if ((uap->flag & ~(NFSSVC_GETSTATS | NFSSVC_NEWSTRUCT)) != 0) {
error = priv_check(td, PRIV_NFS_DAEMON);
if (error != 0)
return (error);