Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177428257
D42432.1794356936.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D42432.1794356936.diff
View Options
diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5
--- a/usr.sbin/mountd/exports.5
+++ b/usr.sbin/mountd/exports.5
@@ -108,6 +108,9 @@
or
.Dq Pa ..
components.
+Pathnames are decoded by
+.Xr strunvis 3
+allowing special characters to be included in the name.
Mount points for a file system may appear on multiple lines each with
different sets of hosts and export options.
.Pp
@@ -428,6 +431,7 @@
/u2 -maproot=root friends
/u2 -alldirs -network cis-net -mask cis-mask
/cdrom -alldirs,quiet,ro -network 192.168.33.0 -mask 255.255.255.0
+/exports/path\\040with\\040spaces -network 192.168.33.0 -mask 255.255.255.0
/private -sec=krb5i
/secret -sec=krb5p
V4: / -sec=krb5:krb5i:krb5p -network 131.104.48 -mask 255.255.255.0
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -83,6 +83,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <vis.h>
#include "pathnames.h"
#include "mntopts.h"
@@ -1561,10 +1562,13 @@
char *err_msg = NULL;
int len, has_host, got_nondir, dirplen, netgrp;
uint64_t exflags;
+ char unvis_dir[PATH_MAX + 1];
+ int unvis_len;
v4root_phase = 0;
anon.cr_groups = NULL;
dirhead = (struct dirlist *)NULL;
+ unvis_dir[0] = '\0';
while (get_line()) {
if (debug)
warnx("got line %s", line);
@@ -1631,17 +1635,22 @@
} else if (*cp == '/') {
savedc = *endcp;
*endcp = '\0';
+ unvis_len = strnunvis(unvis_dir, sizeof(unvis_dir), cp);
+ if (unvis_len < 0) {
+ getexp_err(ep, tgrp, "Cannot strunvis decode dir");
+ goto nextline;
+ }
if (v4root_phase > 1) {
if (dirp != NULL) {
getexp_err(ep, tgrp, "Multiple V4 dirs");
goto nextline;
}
}
- if (check_dirpath(cp, &err_msg) &&
- check_statfs(cp, &fsb, &err_msg)) {
+ if (check_dirpath(unvis_dir, &err_msg) &&
+ check_statfs(unvis_dir, &fsb, &err_msg)) {
if ((fsb.f_flags & MNT_AUTOMOUNTED) != 0)
syslog(LOG_ERR, "Warning: exporting of "
- "automounted fs %s not supported", cp);
+ "automounted fs %s not supported", unvis_dir);
if (got_nondir) {
getexp_err(ep, tgrp, "dirs must be first");
goto nextline;
@@ -1652,16 +1661,16 @@
goto nextline;
}
if (strlen(v4root_dirpath) == 0) {
- strlcpy(v4root_dirpath, cp,
+ strlcpy(v4root_dirpath, unvis_dir,
sizeof (v4root_dirpath));
- } else if (strcmp(v4root_dirpath, cp)
+ } else if (strcmp(v4root_dirpath, unvis_dir)
!= 0) {
syslog(LOG_ERR,
- "different V4 dirpath %s", cp);
+ "different V4 dirpath %s", unvis_dir);
getexp_err(ep, tgrp, NULL);
goto nextline;
}
- dirp = cp;
+ dirp = unvis_dir;
v4root_phase = 2;
got_nondir = 1;
ep = get_exp();
@@ -1699,8 +1708,8 @@
/*
* Add dirpath to export mount point.
*/
- dirp = add_expdir(&dirhead, cp, len);
- dirplen = len;
+ dirp = add_expdir(&dirhead, unvis_dir, unvis_len);
+ dirplen = unvis_len;
}
} else {
if (err_msg != NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 11, 12:28 AM (21 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41650590
Default Alt Text
D42432.1794356936.diff (3 KB)
Attached To
Mode
D42432: mountd: Allow spaces in directory paths
Attached
Detach File
Event Timeline