fstab entries are supposed to have special characters backslash-escaped. OpenRC lacks unescaping of those characters, which the attached patch adds.
Created attachment 248633 [details, diff] The patch
(In reply to comment #1) > Created an attachment (id=248633) [details] > The patch Looks sane. Can you give me an example of what special chars need this so I can test at my end.
where exactly do you find a spec that says fstab uses escaped syntax ?
(In reply to comment #3) > where exactly do you find a spec that says fstab uses escaped syntax ? > I'm not sure about other special characters, but spaces must be escaped octal. From man fstab: "If the name of the mount point contains spaces these can be escaped as `\040'."
(In reply to comment #3) > where exactly do you find a spec that says fstab uses escaped syntax ? I don't know if we even have a spec for stab but that's how util-linux-ng work. For example, in fsck/fsck.c, parse_fstab_line() all fields are clearly passed to parse_escape() which handles \t, \n and octal escapes. Maybe 'printf %b' isn't exact re-implementation of that process but I think it's sufficient for our needs, and it will work the same with sane fstabs (i.e. those not using escapes unsupported by util-linux-ng). (In reply to comment #2) > Looks sane. Can you give me an example of what special chars need this so I > can test at my end. Space (\040) and basically everything below it (i.e. newline, tab, bell).
the C library itself does not do this much parsing, and considering %b gobbles more than util-linux, i dont think we want to use that either. the only syntax that is safe to use is what glibc and util-linux both consume. anything else is unreliable and thus not worth our time supporting. especially considering this is rarely (if ever) used by anyone. look at misc/mntent_r.c:decode_name() in glibc. it only supports: \040 (space) \011 (tab) \012 (newline) \\ (backslash) \134 (backslash) and considering openrc's `mountinfo` and `fstabinfo` use the C libraries' functions already, the escaping is handled for us. $ tail -n1 /etc/fstab //vapier/a\040b\\c\011d\041e /a\040b\\c\011d\041e $ ./fstabinfo | tail -n1 | hexdump -C 00000000 2f 61 20 62 5c 63 09 64 5c 30 34 31 65 0a |/a b\c.d\041e.| so back to the original report. i dont see any bug in openrc, just user misconfiguration of their fstab. use the reduced syntax that glibc supports if you want proper compatibility across all tools and not just random ones in util-linux.