Page MenuHomeFreeBSD

Make mountd generate warning log messages when administrative controls exports entire file systems
ClosedPublic

Authored by rmacklem on Mar 25 2024, 11:36 PM.
Tags
None
Referenced Files
F82308763: D44502.diff
Sat, Apr 27, 12:54 PM
Unknown Object (File)
Fri, Apr 26, 4:29 AM
Unknown Object (File)
Fri, Apr 19, 6:59 AM
Unknown Object (File)
Wed, Apr 17, 2:09 AM
Unknown Object (File)
Sat, Mar 30, 5:44 PM
Unknown Object (File)
Sat, Mar 30, 4:07 PM
Unknown Object (File)
Mar 28 2024, 2:06 AM
Subscribers

Details

Summary

When "administrative controls" (which are exports of subdirectories
within a NFS server's local file system) are used, they export the
entire local server file system. (The subdirectory only applies to
the Mount protocol used for NFSv3 mounts.)

To minimize the risk that this causes confusion w.r.t. what is exported
to NFS client(s), this patch generates warning messages for these.
Only one message is generated for each server local file system.
The messages can be silenced via a new "-A" command line option.

The mountd.8 man page will be patched via a separate commit.

Test Plan

Tested with an exports file that has multiple
administrative controls in it.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste added inline comments.
usr.sbin/mountd/mountd.c
276

we could start sneaking C99 in, if you're so inclined
static bool warn_admin = true

This revision is now accepted and ready to land.Mar 26 2024, 12:29 AM
usr.sbin/mountd/mountd.c
276

Sun RPC has its own bool definition that
is not compatible with stdbool.h.
(There is probably some way to make them
co-exist, but I think I'll resist and just stick
with the style it is written in.)

This looks reasonable to me, thank you.