Bug has been fixed in the past, except it does not work for jails. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=117687 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=55539 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=37569 Steps to reproduce: 1) create a jail named: jail_name 2) configure jail $ mkdir "/tmp/Space Test" $ mkdir "/tmp/Space Mountpoint" $ echo "/tmp/Space\040Test /tmp/Space\040Mountpoint nullfs ro 0 0" >> /etc/fstab.jail_name 2) Start the jail: # cannot start jail "jail_name": # jail: jail_name: mount.fstab: /tmp/Space\040Mountpoint: No such file or directory I've tried a bunch of variations. Escaping spaces, \040, '\040', \s, double and single quoting the entire path. Nothing works. It gives a different error if you use quotes: "/tmp/Space Test" "/tmp/Space Mountpoint" nullfs ro 0 0 jail: jail_name: mount.fstab: Test: not an absolute pathname Any ideas of what else I could try or where this goes wrong? Kind Regards, Robert Sevat
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