Bug 242485 - mount(8): not able to parse -e option for cd9660 filesystem
Summary: mount(8): not able to parse -e option for cd9660 filesystem
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.1-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-06 13:52 UTC by vermaden
Modified: 2019-12-09 20:10 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vermaden 2019-12-06 13:52:28 UTC
From the *man mount* page.

  Any additional options specific to a file system type that is not
  one of the internally known types (see the -t option) may be
  passed as a comma separated list; these options are distinguished
  by a leading “-” (dash).  For example, the mount command:

    mount -t cd9660 -o -e /dev/cd0 /cdrom

  causes mount to execute the equivalent of:

    /sbin/mount_cd9660 -e /dev/cd0 /cdrom



Then '-e' option should be handled the same by *mount_cd9660* and *mount -t cd9660* commands ... at least in theory.

In practice *mount(8)* can not handle the '-e' option for cd9660 filesystem as shown below.



% file FreeBSD.iso
FreeBSD.iso: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 1816971 sectors

% mdconfig -a -t vnode -f FreeBSD.iso
md0

% mount -t cd9660 -e /dev/md0 /mnt   
mount: illegal option -- e
usage: mount [-adflpruvw] [-F fstab] [-o options] [-t ufs | external_type]
       mount [-dfpruvw] special | node
       mount [-dfpruvw] [-o options] [-t ufs | external_type] special node

% mount -t cd9660
(none)

% mount_cd9660 -e /dev/md0 /mnt

% mount -t cd9660
/dev/md0 on /mnt (cd9660, local, read-only)



Regards.
Comment 1 Conrad Meyer freebsd_committer 2019-12-06 20:08:31 UTC
The quoted excerpt is a subset of the documentation for the '-o' flag:

     -o      Options are specified with a -o flag followed by a comma
             separated string of options.  In case of conflicting options
             being specified, the rightmost option takes effect.  The
             following options are available:
...
             Any additional options specific to a file system type that is not
             one of the internally known types (see the -t option) may be
             passed as a comma separated list; these options are distinguished
             by a leading “-” (dash).  For example, the mount command:

                   mount -t cd9660 -o -e /dev/cd0 /cdrom

Note that the example shows the '-o -e' explicitly.
Comment 2 vermaden 2019-12-06 22:27:17 UTC
(In reply to Conrad Meyer from comment #1)

I will say it this way ... as you pointed out literally, yes, man pages example shows -o option used before -e option. But the man page 'description' does not say it literally that -o option needs to be used before 'local' options such as -e option for cd9660.

If its not obvious for 14 years straight FreeBSD user (me) then its a bug and a lot of other people will hit it.

But my opinion often differs from FreeBSD developers opinion, so this may as well be closed as 'not a bug'.

Just wanted to make FreeBSD a little less painful for newcommers.

Regards.
Comment 3 Ed Maste freebsd_committer 2019-12-07 03:39:03 UTC
(In reply to vermaden from comment #2)
> But the man page 'description' does not say it literally that -o option needs
> to be used before 'local' options such as -e option for cd9660.

It does though, the text about filesystem-specific options is part of the documentation of the -o option, and the -o option is documented as "Options are specified with a -o flag followed by a comma separated string of options."

I'm not sure what more can be said?
Comment 4 vermaden 2019-12-08 12:38:33 UTC
(In reply to Ed Maste from comment #3)

That description is for options like noatime or noexec, thus the description of 'comma separated string of options' but I just tried and this works: mount -t cd9660 -o noatime,-e /dev/md0 /mnt so ok, it can be interpreted like that.
Comment 5 Ed Maste freebsd_committer 2019-12-09 20:03:01 UTC
(In reply to vermaden from comment #4)
> That description is for options like noatime or noexec

and also for options passed through to mount subcommands.

Everything from
     -o      Options are specified with a -o flag followed by a comma
             separated string of options.  In case of conflicting options
... to ...
             Additional options specific to file system types which are not
             internally known (see the description of the -t option below) may
             be described in the manual pages for the associated
             /sbin/mount_XXX utilities.

is part of the description of -o.
Comment 6 Ed Maste freebsd_committer 2019-12-09 20:10:19 UTC
Additional options specific to a file system type that is not
one of the internally known types (see the -t option) may be
passed as a comma separated list; these options are distinguished
by a leading "-" (dash).

Would changing
 "may be passed as a comma separated list"
to
 "may be included in the comma separated list"
have cleared it up for you? Implying that it's part of the same list, not perhaps a separate list?