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
Unknown Object (File)
Thu, Oct 31, 6:54 AM
Unknown Object (File)
Thu, Oct 10, 2:31 AM
Unknown Object (File)
Sep 24 2024, 12:14 PM
Unknown Object (File)
Sep 23 2024, 9:51 PM
Unknown Object (File)
Sep 17 2024, 4:21 AM
Unknown Object (File)
Sep 8 2024, 1:37 PM
Unknown Object (File)
Sep 8 2024, 9:10 AM
Unknown Object (File)
Aug 25 2024, 12:40 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.