#
ecccb638 |
| 01-Feb-2025 |
Ed Maste <emaste@FreeBSD.org> |
mountd: Promote missing netmask log to LOG_ERR
Historical network classes are deprecated, but currently still supported in mountd with a LOG_WARNING-priority message added by Mike Karels in 2021. U
mountd: Promote missing netmask log to LOG_ERR
Historical network classes are deprecated, but currently still supported in mountd with a LOG_WARNING-priority message added by Mike Karels in 2021. Upgrade the log to LOG_ERR well in advance of this becoming a fatal error.
Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48795
show more ...
|
Revision tags: release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3 |
|
#
07cd69e2 |
| 28-Dec-2024 |
Rick Macklem <rmacklem@FreeBSD.org> |
mountd.c: Define a new -a command line option
Bugzilla PR#282995 reported that, when a file system was exported with the "-alldirs" flag, the export succeeded even if the directory path was not a se
mountd.c: Define a new -a command line option
Bugzilla PR#282995 reported that, when a file system was exported with the "-alldirs" flag, the export succeeded even if the directory path was not a server file system mount point.
This behaviour for "-alldirs" was only documented in the Example section of exports(5) and had not been enforced since FreeBSD2. (A patch applied between FreeBSD1 and FreeBSD2 broke the check for file system mount point.)
Since the behaviour of allowing the export has existed since FreeBSD2, the concensus on a mailing list was that it would be a POLA violation to change it now. Therefore, this patch adds a new "-a" mountd command line option to enforce a check for the exported directory being a server file system mount point.
PR: 282995 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D48137
show more ...
|
Revision tags: release/14.2.0 |
|
#
e87848a8 |
| 08-Oct-2024 |
Olivier Certner <olce@FreeBSD.org> |
mountd(8): Allow to pass {NGROUPS_MAX} + 1 groups
NGROUPS_MAX is just the minimum maximum of the number of allowed supplementary groups. The actual runtime value may be greater. Allow more groups
mountd(8): Allow to pass {NGROUPS_MAX} + 1 groups
NGROUPS_MAX is just the minimum maximum of the number of allowed supplementary groups. The actual runtime value may be greater. Allow more groups to be specified accordingly (now that, a few commits ago, nmount(2) has been changed similarly).
To this end, we just allocate once and for all a static array called 'tmp_groups' big enough to hold {NGROUPS_MAX} + 1 groups (the maximum number of supplementary groups plus the effective GID, which we store in a variable named 'tngroups_max' to avoid confusion with the kernel variable 'ngroups_max' holding only the maximum number of *supplementary* groups) in main() and use this temporary space in get_exportlist_one(), do_opt() and parsecred(). Doing so in passing fixes a (benign) memory leak in case "-maproot" and/or "-mapall" were specified multiple times and the first option comprised more than SMALLNGROUPS.
parsecred() does not use 'cr_smallgrps' anymore, but we have kept 'cr_smallgrps'/SMALLNGROUPS as 'struct expcred' is also included in 'struct exportlist' and 'struct grouplist', and thus this preallocated field still results in an optimization for the common case of small number of groups (although its real impact is probably negligible and arguably was not worth the trouble).
While here, in do_mount(), remove some unnecessary groups array allocation and copying.
Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47016
show more ...
|
#
a20d5024 |
| 08-Oct-2024 |
Olivier Certner <olce@FreeBSD.org> |
mountd(8): parsecred(): Re-order operations for clarity
No functional change (intended).
Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Sponsored by
mountd(8): parsecred(): Re-order operations for clarity
No functional change (intended).
Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47015
show more ...
|
#
0b011b5c |
| 08-Oct-2024 |
Olivier Certner <olce@FreeBSD.org> |
mountd(8): parsecred(): Remove comment on non-existent bug
'name' can never be NULL, as it is equal to 'names' and 'namelist', which was passed by do_cred() only if the actual parameter wasn't NULL.
mountd(8): parsecred(): Remove comment on non-existent bug
'name' can never be NULL, as it is equal to 'names' and 'namelist', which was passed by do_cred() only if the actual parameter wasn't NULL.
Reviewed by: rmacklem Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47014
show more ...
|
#
7f7f3b6c |
| 03-Oct-2024 |
Olivier Certner <olce@FreeBSD.org> |
mountd(8): parsecred(): Groups limit: NGROUPS_MAX => NGROUPS_MAX + 1
Lift this unnecessary limitation.
Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
mountd(8): parsecred(): Groups limit: NGROUPS_MAX => NGROUPS_MAX + 1
Lift this unnecessary limitation.
Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46921
show more ...
|
#
bdc259ef |
| 08-Oct-2024 |
Olivier Certner <olce@FreeBSD.org> |
mountd(8): parsecred(): Fallback to "nogroup" or GID_NOGROUP
In the 'uid:gid:gid:...' case (for '-maproot' or '-mapall'), if no GID is specified at all (i.e., input is of the form 'uid:', with the c
mountd(8): parsecred(): Fallback to "nogroup" or GID_NOGROUP
In the 'uid:gid:gid:...' case (for '-maproot' or '-mapall'), if no GID is specified at all (i.e., input is of the form 'uid:', with the colon at the end), mountd(8) would pass credentials with an empty array of groups to the kernel.
For security reasons, we have put in place a kernel fallback a while ago, which is to use the single group GID_NOGROUP (see commits cfbe7a62dc62 ("nfs, rpc: Ensure kernel credentials have at least one group") and 5169d4307eb9 ("nfs: Fallback to GID_NOGROUP on no groups")). Here, as we are in userland, we first try to find the GID number corresponding to "nogroup", and only then fall back to GID_NOGROUP, as nfsuserd(8) does.
Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47011
show more ...
|
#
f2d2318f |
| 26-Sep-2024 |
Olivier Certner <olce@FreeBSD.org> |
mountd(8): parsecred(): Remove "duplicate compression"
No functional change (intended).
This code dates back to 4.4BSD, became wrong after some getgrouplist() (nssswitch-related) change in 2007, wa
mountd(8): parsecred(): Remove "duplicate compression"
No functional change (intended).
This code dates back to 4.4BSD, became wrong after some getgrouplist() (nssswitch-related) change in 2007, was fixed only in 2020 and since then underwent cosmetic changes.
It is likely that in fact it never served any useful purpose in FreeBSD, except perhaps at the very beginning. It's most probably not the case today: NFS credentials are normally only used to check for file accesses, whose group is checked against all groups of a credentials indiscriminately (except for the real GID). Consequently, having a single duplicate, which the code would actually remove only if in the first supplementary group slot, doesn't change behavior. Moreover, we are going to regain one slot in a subsequent commit.
Discussed with: rmacklem Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46920
show more ...
|
#
ae22a4bb |
| 26-Sep-2024 |
Olivier Certner <olce@FreeBSD.org> |
mountd(8): parsecred(): uid:gid:... loop: Simplify a bit
No functional change intended.
Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Sponsored by:
mountd(8): parsecred(): uid:gid:... loop: Simplify a bit
No functional change intended.
Reviewed by: rmacklem (older version) Approved by: markj (mentor) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46919
show more ...
|
Revision tags: release/13.4.0 |
|
#
3df987c9 |
| 07-Sep-2024 |
Rick Macklem <rmacklem@FreeBSD.org> |
mountd: Add check for "=" after exports(5) options
Some exports(5) options take a "=arg" component that provides an argument value for the option. Others do not. Without this patch, if "=arg" was p
mountd: Add check for "=" after exports(5) options
Some exports(5) options take a "=arg" component that provides an argument value for the option. Others do not. Without this patch, if "=arg" was provided for an option that did not take an argument value, the "=arg" was simply ignored. This could result in confusion w.r.t. what was being exported, as noted by the Problem Report.
This patch adds a check for "=arg" for the options that do not take an argument value and fails the exports line if one is found.
PR: 281003 MFC after: 2 weeks
show more ...
|
#
7c2901b0 |
| 11-Jul-2024 |
Joyu Liao <joyul@juniper.net> |
mountd: Add options to disable daemon mode and setting localhost
In our products, we need those options to support our features.
Add daemon mode option for mountd, nfsd. Add skip local host binding
mountd: Add options to disable daemon mode and setting localhost
In our products, we need those options to support our features.
Add daemon mode option for mountd, nfsd. Add skip local host binding option for rpcd. Add skip local host binding option for mountd.
Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D45118
show more ...
|
Revision tags: release/14.1.0 |
|
#
fefb7c39 |
| 31-Mar-2024 |
Rick Macklem <rmacklem@FreeBSD.org> |
mountd.c: Add warning messages for administrative controls
When "administrative controls" (which are exports of subdirectories within a NFS server's local file system) are used, they export the enti
mountd.c: Add warning messages for administrative controls
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.
Reviewed by: emaste, markj MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D44502
show more ...
|
Revision tags: release/13.3.0 |
|
#
0b8224d1 |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals.
Remove copyright strings ifdef'd out
We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require).
Sponsored by: Netflix
show more ...
|
#
8a7b6120 |
| 23-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
usr.sbin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a p
usr.sbin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script.
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
7c5146da |
| 04-Nov-2023 |
Dan Mcgregor <dan.mcgregor_usask.ca> |
mountd: Add support for spaces in exported directories
The previous code would correctly parse strings including quotation marks (") or backslash (/), but the tests when creating the export includes
mountd: Add support for spaces in exported directories
The previous code would correctly parse strings including quotation marks (") or backslash (/), but the tests when creating the export includes them in the final string. This prevents exporting paths with embedded spaces, for example "/exports/with space". Trying results in log lines resembling:
mountd[1337]: bad exports list line '/exports/with\ space': /exports/with\ space: lstat() failed: No such file or directory.
Turns out that when creating its exports list, zfs escapes strings in a format compatible with vis(3). Since I expect that zfs sharenfs is the dominating use case for generating an exports list, use strunvis(3) to parse the export path. The result is lines like the following allowing spaces:
/exports/with\040space -network 192.168.0 -mask 255.255.255.0
A man page update will be done as a separate commit.
MFC after: 1 month Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D42432
show more ...
|
#
48514c57 |
| 08-Sep-2023 |
Mike Karels <karels@FreeBSD.org> |
mountd: do not warn about using class mask with -mask
The previous code would warn that the mask was being defaulted to an obsolete class mask even if -mask was present after -network. Import a fix
mountd: do not warn about using class mask with -mask
The previous code would warn that the mask was being defaulted to an obsolete class mask even if -mask was present after -network. Import a fix from Peter Much with a little tweaking, deferring the warning until after all parameters are processed.
PR: 263011 Obtained from: pmc at citilink.dinoex.sub.org MFC after: 3 days Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D41774
show more ...
|
#
1d386b48 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
24092311 |
| 10-Aug-2023 |
Rick Macklem <rmacklem@FreeBSD.org> |
mountd: Fix type of signal variable
Without this patch got_sighup(), which is the SIGHUP handler, would set a variable of type int.
This would appear to be incorrect, although it has worked reliabl
mountd: Fix type of signal variable
Without this patch got_sighup(), which is the SIGHUP handler, would set a variable of type int.
This would appear to be incorrect, although it has worked reliably. This patch changes the type to "_Atomic(int)", which appears to be all that is needed to correct it.
Reported by: pen@lysator.lui.se Reviewed by: theraven, karels (prev version), kevans (prev version) Differential Revision: https://reviews.freebsd.org/D41265
show more ...
|
#
c77cc846 |
| 02-Jun-2023 |
Elyes Haouas <ehaouas@noos.fr> |
mountd: Fix typos
Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/653
|
#
572b77f8 |
| 06-May-2023 |
Alexander Motin <mav@FreeBSD.org> |
mountd: Improve error message for exports lines
Currently mountd print error message "symbolic link in export path or statfs failed" in case some path component in an exports line fails validation.
mountd: Improve error message for exports lines
Currently mountd print error message "symbolic link in export path or statfs failed" in case some path component in an exports line fails validation. This revision improves the error message by giving more information about the precise error as well as the path component that caused the issue.
Submitted by: Andrew Walker <awalker@ixsystems.com> Reviewed by: mav, rmacklem Differential Revision: https://reviews.freebsd.org/D39840
show more ...
|
Revision tags: release/13.2.0 |
|
#
afc55510 |
| 19-Jan-2023 |
Gordon Bergling <gbe@FreeBSD.org> |
mountd(8): Fix a typo in a source code comment
- s/ingore/ignore/
MFC after: 3 days
|
Revision tags: release/12.4.0, release/13.1.0, release/12.3.0 |
|
#
f4bf849b |
| 18-Nov-2021 |
Rick Macklem <rmacklem@FreeBSD.org> |
mountd: Fix handling of usernames that start with a digit
yocalebo_gmail.com submitted a patch for mountd.c that fixes the case where a username starts with a digit. Without this patch, the username
mountd: Fix handling of usernames that start with a digit
yocalebo_gmail.com submitted a patch for mountd.c that fixes the case where a username starts with a digit. Without this patch, the username that starts with a digit is misinterpreted as a numeric uid. With this patch, any string that does not entirely convert to a decimal number via strtoul() is considered a user/group name.
Submitted by: yocalebo_gmail.com Reviewed by: rmacklem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D32993
show more ...
|
#
92aebdea |
| 27-Oct-2021 |
Mike Karels <karels@FreeBSD.org> |
mountd: deprecate exports to a network without mask
The exports file format allows export to a network using an explicit mask or prefix length (CIDR). It also allows a network with just a dotted ad
mountd: deprecate exports to a network without mask
The exports file format allows export to a network using an explicit mask or prefix length (CIDR). It also allows a network with just a dotted address, in which case the historical mask was used. Deprecate this usage, and warn when it is used. Document that this is deprecated.
MFC after: 1 month Reviewed by: rmacklem, bcr, #manpages Differential Revision: https://reviews.freebsd.org/D32713
show more ...
|
Revision tags: release/13.0.0 |
|
#
09673fc0 |
| 09-Mar-2021 |
Rick Macklem <rmacklem@FreeBSD.org> |
mountd(8): generate a syslog message when the "V4:" line is missing
Daniel reported that NFSv4 mounts were not working despite having set "nfsv4_server_enable=YES" in /etc/rc.conf. Mountd was loggi
mountd(8): generate a syslog message when the "V4:" line is missing
Daniel reported that NFSv4 mounts were not working despite having set "nfsv4_server_enable=YES" in /etc/rc.conf. Mountd was logging a message that there was no /etc/exports file. He noted that creating a /etc/exports file with a "V4:" line in it was needed make NFSv4 mounts work. At least one "V4:" line in one of the exports(5) file(s) is needed to make NFSv4 mounts work. This patch fixes mountd.c so that it logs a message indicting that there is no "V4:" line in any exports(5) file when NFSv4 mounts are enabled. To avoid this message being generated erroneously, /etc/rc.d/mountd is updated to make sure vfs.nfsd.server_max_nfsvers is properly set before mountd(8) is started.
Reported by: debdrup PR: 253901 MFC after: 2 weeks
show more ...
|
#
bde6f938 |
| 25-Oct-2020 |
Rick Macklem <rmacklem@FreeBSD.org> |
Add "-R" option to tell mountd to not register with rpcbind.
rpcbind is now considered a security risk for some sites. Since an NFSv4 only NFS server does not need rpcbind, it makes sense to have an
Add "-R" option to tell mountd to not register with rpcbind.
rpcbind is now considered a security risk for some sites. Since an NFSv4 only NFS server does not need rpcbind, it makes sense to have an option that implements this.
This patch adds a "-R" option that disables the Mount protocol (not used by NFSv4) and does not register with rpcbind.
Changes are required to /etc/rc.d/mountd and /etc/rc.d/nfsd. Those will be in a separate commit.
Reviewed by: freqlabs, asomers MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26746
show more ...
|