Summary: | It is not possible to use spaces in fstab paths when using jails | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Robert Sevat <robert> | ||||
Component: | kern | Assignee: | Jamie Gritton <jamie> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | jail, jamie, pi | ||||
Priority: | --- | ||||||
Version: | 10.2-RELEASE | ||||||
Hardware: | amd64 | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Robert Sevat
2016-04-10 01:46:22 UTC
Created attachment 169588 [details]
Use strunvis to escape fstab characters
I took at look at getfsent(3), and it uses strunvis(3) to parse escape codes (only in the pathnames). So I've done the same thing when I parse fstab lines and the "mount" parameter.
Now the example you gave works, with the same \040 for space. The quotes still won't work, but then they don't work in getfsent either, so that sounds proper.
Won't the following work? $ mkdir /tmp/Space\ Test $ mkdir /tmp/Space\ Mountpoint $ echo "/tmp/Space\ Test /tmp/Space\ Mountpoint" nullfs ro 0 0" >> /etc/fstab.jail_name (untested) Also, isn't fstab called fsTAB for a reason? While I've never tried to create one that uses spaces instead of tabs, I can't help but wonder. :) --Chris No, that won't work - strunvis(3) unfortunately doesn't escape things that way. Also, getfsent(3) treats all whitespace the same. As it should - I remember being stymied by sendmail.cf files that looked perfect but didn't work right, because there some spaces where a tab should be. A commit references this bug: Author: jamie Date: Mon Apr 25 03:24:48 UTC 2016 New revision: 298562 URL: https://svnweb.freebsd.org/changeset/base/298562 Log: Make jail(8) interpret escape codes in fstab the same as getfsent(3). PR: 208663 MFC after: 3 days Changes: head/usr.sbin/jail/command.c A commit references this bug: Author: jamie Date: Thu Apr 28 01:40:47 UTC 2016 New revision: 298729 URL: https://svnweb.freebsd.org/changeset/base/298729 Log: MFC r298562: Make jail(8) interpret escape codes in fstab the same as getfsent(3). PR: 208663 Changes: _U stable/10/ stable/10/usr.sbin/jail/command.c |