Bug#567071: what is the purpose of fstab-decode

Dmitry Bogatov KAction at debian.org
Fri Mar 1 18:06:31 GMT 2019


[2019-02-28 15:43] Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups at NTLWorld.COM>
>  > What exactly is decoded? Where should I read about escaping rules?
> How it is different from plain `xargs'?
>
> You are suffering from the notoriously poor Linux documentation. (-:

Thank you. Wouderful. I believe it should find its way into upstream
distribution. Also, reference to fstab(5) and this particular paragraph
may be useful:

	The second field (fs_file).
	      This  field  describes the mount point (target) for the filesys‐
	      tem.  For swap partitions, this field  should  be  specified  as
	      `none'.  If  the name of the mount point contains spaces or tabs
	      these can be escaped as `\040' and '\011' respectively.

> The manuals for fstab on the BSDs explain that the fields are encoded , 
> so that they can contain whitespace characters, with strvis() and must 
> be decoded with strunvis() when read.  The BSD C library getfsent() 
> function does this for one.
>
> It is pretty much undocumented, but roughly the same in fact holds true 
> for Linux operating systems and their C libraries.  It is not the vis 
> encoding scheme, and is rather an encoding scheme that is peculiar to 
> fstab.  But the fields are encoded so that they can contain whitespace 
> characters, and the getfsent() library function (or, actually, the 
> getmntent() library function in the GNU C library) does this for one.
>
> If you read fstab with a program like awk, it will of course read and 
> process the encoded forms.  To actually get hold of the decoded forms, 
> so that they can be passed as arguments to programs that do not expect 
> them to be encoded, such as unmount in the example; one has to pass them 
> through a decoder program.  fstab-decode is simply such a decoder 
> program.  It runs all of its arguments through the decoder, and then 
> execs the result.
-- 
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --




More information about the Debian-init-diversity mailing list