Bug#567071: forgot quotes in fstab-decode man page example

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#567071: forgot quotes in fstab-decode man page example

積丹尼 Dan Jacobson
Package: sysvinit-utils
Version: 2.87dsf-8
Severity: wishlist
File: /usr/share/man/man8/fstab-decode.8.gz

Firstly, you want to change
       fstab-decode umount $(awk '$3 ==  vfat  { print $2 }' /etc/fstab) #wrong
       fstab-decode umount $(awk '$3 == "vfat" { print $2 }' /etc/fstab) #right
else it _won't work_.

Secondly, you might add to this example "here's what we needed back in
the bad old days before fstab-decode: ..." so users can see what
fstab-decode is helping them do.




--
To UNSUBSCRIBE, email to [hidden email]
with a subject of "unsubscribe". Trouble? Contact [hidden email]

Reply | Threaded
Open this post in threaded view
|

Bug#567071: forgot quotes in fstab-decode man page example

Dmitry Bogatov-3

control: tags -1 +moreinfo
control: retitle -1 what is the purpose of fstab-decode

[2010-01-27 08:05] [hidden email]

> Package: sysvinit-utils
> Version: 2.87dsf-8
> Severity: wishlist
> File: /usr/share/man/man8/fstab-decode.8.gz
>
> Firstly, you want to change
>        fstab-decode umount $(awk '$3 ==  vfat  { print $2 }' /etc/fstab) #wrong
>        fstab-decode umount $(awk '$3 == "vfat" { print $2 }' /etc/fstab) #right
> else it _won't work_.
>
> Secondly, you might add to this example "here's what we needed back in
> the bad old days before fstab-decode: ..." so users can see what
> fstab-decode is helping them do.

As of sysvinit=2.93, quotes are fixed. About lack of example I agree.
I do not understand from manpage what process fstab-decode simplify.
Jesse, what do you think?
--
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --

Reply | Threaded
Open this post in threaded view
|

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

Jesse Smith-2
In reply to this post by 積丹尼 Dan Jacobson
I agree, the manual page for fstab-decode is vague, at best. I will add
a paragraph explaining what it does. The updated manual page will be
included in sysvinit-2.94.

- Jesse

Reply | Threaded
Open this post in threaded view
|

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

Dmitry Bogatov-3

control: tags -1 +fixed-upstream

[2019-02-21 15:08] Jesse Smith <[hidden email]>
> I agree, the manual page for fstab-decode is vague, at best. I will add
> a paragraph explaining what it does. The updated manual page will be
> included in sysvinit-2.94.
--
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --

Reply | Threaded
Open this post in threaded view
|

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

Dmitry Bogatov-3
In reply to this post by Jesse Smith-2

control: reopen -1
control: tags -1 -fixed-upstream +upstream

[2019-02-21 15:08] Jesse Smith <[hidden email]>
> I agree, the manual page for fstab-decode is vague, at best. I will add
> a paragraph explaining what it does. The updated manual page will be
> included in sysvinit-2.94.

Maybe it is just me, but I still do not understand purpose of
fstab-decode, therefore reopening bug. Here is manual from 2.94 (by the
way, there is also fstab-decode.old somewhy in release tarball):

  fstab-decode decodes escapes (such as newline characters) in the speci‐
  fied ARGUMENTs and uses them to run  COMMAND.   The  argument  escaping
  uses  the  same  rules  as  path  escaping in /etc/fstab, /etc/mtab and
  /proc/mtab.

  In essence fstab-decode can be used anytime we want  to  pass  multiple
  parameters  to  a  command as a list of command line argments. It turns
  output like this:

  /root
  /mnt/remote-disk
  /home

  Into one long list of parameters, "/root /mnt/remote-disk /home". This
  can be useful when trying to work with multiple filesystems at once. For
  instance, we can use it to unmount multiple NFS shares.

  EXAMPLES
  fstab-decode umount $(awk '$3 == "vfat" { print $2 }' /etc/fstab)

What exactly is decoded? Where should I read about escaping rules?
How it is different from plain `xargs'?
--
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --

Reply | Threaded
Open this post in threaded view
|

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

Jonathan de Boyne Pollard
Dmitry Bogatov:
 > 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. (-:

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.

Reply | Threaded
Open this post in threaded view
|

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

Dmitry Bogatov-3

[2019-02-28 15:43] Jonathan de Boyne Pollard <[hidden email]>
>  > 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
                                                                             --

Reply | Threaded
Open this post in threaded view
|

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

Jonathan de Boyne Pollard
Dmitry Bogatov:
 > Also, reference to fstab(5) and this particular paragraph may be useful:

Not as much as you would think.  The idiosyncratic encoding applies to
more than just that 1 field, and encodes more than what is stated, but
does not generalize to octal escaping as one might guess.

Reply | Threaded
Open this post in threaded view
|

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

Dmitry Bogatov-3

[ Jonathan de Boyne Pollard ]
> > [Dmitry Bogatov]
> > Also, reference to fstab(5) and this particular paragraph may be useful:
>
> Not as much as you would think.  The idiosyncratic encoding applies to
> more than just that 1 field, and encodes more than what is stated, but
> does not generalize to octal escaping as one might guess.

fstab(5) may be not perfect, but it still contains information. I
believe adding fstab(5) to SEE-ALSO of fstab-decode(8) would be useful.
--
        Note, that I send and fetch email in batch, once every 24 hours.
                 If matter is urgent, try https://t.me/kaction
                                                                             --