opnsense-src/usr.sbin/mountd
Dan Mcgregor e615bcd321 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.

(cherry picked from commit 7c5146da128688ba2bb6bdad5e98716087a47281)
2023-12-22 12:42:15 -08:00
..
exports.5 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
mountd.8 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
mountd.c mountd: Add support for spaces in exported directories 2023-12-22 12:42:15 -08:00
netgroup.5 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
pathnames.h Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00