* mount: what is the point of 'nouser' on the command line?
@ 2014-07-14 9:57 Benno Schulenberg
2014-07-14 14:57 ` Karel Zak
0 siblings, 1 reply; 6+ messages in thread
From: Benno Schulenberg @ 2014-07-14 9:57 UTC (permalink / raw)
To: Util-Linux
Hi all,
The man page of mount(8) currently contains the following example
to show how the -o option can be used:
mount LABEL=mydisk -o noatime,nouser
As the command does not contain a mountpoint, it requires an entry
in fstab in order to work. If that entry does not contain the keyword
'user' in the options field, then the mount will effectively already be
'nouser'. If it does contain the keyword 'user', does specifying 'nouser'
then somehow exclude other users? As far as I can tell it doesn't.
So, is it ever useful to specify '-o nouser' on the command line?
Something else. On the man page of umount, shouldn't it say that
the -O and -t options are only effective in combination with -a?
Further, mount recognizes the options -L and -U besides the keywords
LABEL= and UUID=, but umount only recognizes the latter two. For
symmetry it would be nice if umount also recognized -L and -U.
Benno
--
http://www.fastmail.fm - Access your email from home and the web
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: mount: what is the point of 'nouser' on the command line?
2014-07-14 9:57 mount: what is the point of 'nouser' on the command line? Benno Schulenberg
@ 2014-07-14 14:57 ` Karel Zak
2014-07-14 15:24 ` Benno Schulenberg
0 siblings, 1 reply; 6+ messages in thread
From: Karel Zak @ 2014-07-14 14:57 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: Util-Linux
On Mon, Jul 14, 2014 at 11:57:44AM +0200, Benno Schulenberg wrote:
>
> The man page of mount(8) currently contains the following example
> to show how the -o option can be used:
>
> mount LABEL=mydisk -o noatime,nouser
>
> As the command does not contain a mountpoint, it requires an entry
> in fstab in order to work. If that entry does not contain the keyword
> 'user' in the options field, then the mount will effectively already be
> 'nouser'. If it does contain the keyword 'user', does specifying 'nouser'
> then somehow exclude other users? As far as I can tell it doesn't.
It does not exclude others users. The idea of the "no*" options is
disable previously applied flags. The options from command line are
evaluated after options from fstab, so for example "foo,bar" (fstab)
and "nofoo" (command line) means that "nofoo" negate the previous "foo".
The "user" option is alias to "noexec,nosuid,nodev" mount flags.
I'm not sure why, but "nouser" has never been implemented. So it does not
have any effect and "user" from fstab is still applied -- maybe to
avoid possible security bugs or so.
> So, is it ever useful to specify '-o nouser' on the command line?
No, it would be better to remove it from the example and add to the
man page note that "nouser" has no any effect and you have to
explicitly use "exec,suid,dev" to negate.
> Something else. On the man page of umount, shouldn't it say that
> the -O and -t options are only effective in combination with -a?
The -t is generic and it's usable in more case (for example to
specify filesystem that should be tried for the device).
The -O is really usable for -a only.
> Further, mount recognizes the options -L and -U besides the keywords
> LABEL= and UUID=, but umount only recognizes the latter two. For
> symmetry it would be nice if umount also recognized -L and -U.
I think -L and -U are mistakes maintained for backward compatibility,
because TAG=value is more generic and extendable syntax. For example
now we also supports PARTUUID= and PARTLABEL=.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: mount: what is the point of 'nouser' on the command line?
2014-07-14 14:57 ` Karel Zak
@ 2014-07-14 15:24 ` Benno Schulenberg
2014-07-15 8:02 ` Karel Zak
0 siblings, 1 reply; 6+ messages in thread
From: Benno Schulenberg @ 2014-07-14 15:24 UTC (permalink / raw)
To: Karel Zak; +Cc: Util-Linux
On Mon, Jul 14, 2014, at 16:57, Karel Zak wrote:
> The "user" option is alias to "noexec,nosuid,nodev" mount flags.
Ehm... Not quite. It *implies* those options, to lightly protect
the user from some dangers, but its main purpose is to allow
ordinary users to mount the filesystem so marked in fstab. No?
> > So, is it ever useful to specify '-o nouser' on the command line?
>
> No, it would be better to remove it from the example
Will submit a patch later.
> > Something else. On the man page of umount, shouldn't it say that
> > the -O and -t options are only effective in combination with -a?
>
> The -t is generic and it's usable in more case (for example to
> specify filesystem that should be tried for the device).
Ehm... I was talking about umount here, not mount. :)
Benno
--
http://www.fastmail.fm - A no graphics, no pop-ups email service
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: mount: what is the point of 'nouser' on the command line?
2014-07-14 15:24 ` Benno Schulenberg
@ 2014-07-15 8:02 ` Karel Zak
2014-07-15 9:02 ` umount: --types does not limit Benno Schulenberg
0 siblings, 1 reply; 6+ messages in thread
From: Karel Zak @ 2014-07-15 8:02 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: Util-Linux
On Mon, Jul 14, 2014 at 05:24:27PM +0200, Benno Schulenberg wrote:
>
> On Mon, Jul 14, 2014, at 16:57, Karel Zak wrote:
> > The "user" option is alias to "noexec,nosuid,nodev" mount flags.
>
> Ehm... Not quite. It *implies* those options, to lightly protect
> the user from some dangers, but its main purpose is to allow
> ordinary users to mount the filesystem so marked in fstab. No?
Sure, I have talked about the options and how the options are
evaluated.
> > > So, is it ever useful to specify '-o nouser' on the command line?
> >
> > No, it would be better to remove it from the example
>
> Will submit a patch later.
Thanks.
> > > Something else. On the man page of umount, shouldn't it say that
> > > the -O and -t options are only effective in combination with -a?
> >
> > The -t is generic and it's usable in more case (for example to
> > specify filesystem that should be tried for the device).
>
> Ehm... I was talking about umount here, not mount. :)
Oh... sorry :-) Anyway, it's the same, the "-t" is usable without -a
too.
umount -a -t <type, ...>
the <type> is interpreted as pattern.
umount -t <type>
the <type> is filesystem type (so you can force umount to use for
example /sbin/umount.<type>).
The -O is usable with -a only.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 6+ messages in thread* umount: --types does not limit
2014-07-15 8:02 ` Karel Zak
@ 2014-07-15 9:02 ` Benno Schulenberg
2014-07-15 9:56 ` Karel Zak
0 siblings, 1 reply; 6+ messages in thread
From: Benno Schulenberg @ 2014-07-15 9:02 UTC (permalink / raw)
To: Karel Zak; +Cc: Util-Linux
On Tue, Jul 15, 2014, at 10:02, Karel Zak wrote:
> umount -t <type>
>
> the <type> is filesystem type (so you can force umount to use for
> example /sbin/umount.<type>).
Hmm. But it's not working for me, the --types option does not limit
umount in any way. In the man page it says: "Indicate that the
actions should *only* be taken on filesystems of the specified type."
But, for example, here Suse is of type ext4 and gets mounted:
# ./mount -t ext4 /suse
# ./mount | grep suse
/dev/sda2 on /suse type ext4 (rw,noatime,noexec,nosuid,nodev,user)
Now I want to unmount all btrfs systems:
# ./umount -t btrfs /suse /zero /other
# ./mount | grep suse
It just unmounts everything that is mentioned, the -t has no
limiting effect. So it is useful only with -a.
Benno
--
http://www.fastmail.fm - Faster than the air-speed velocity of an
unladen european swallow
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: umount: --types does not limit
2014-07-15 9:02 ` umount: --types does not limit Benno Schulenberg
@ 2014-07-15 9:56 ` Karel Zak
0 siblings, 0 replies; 6+ messages in thread
From: Karel Zak @ 2014-07-15 9:56 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: Util-Linux
On Tue, Jul 15, 2014 at 11:02:04AM +0200, Benno Schulenberg wrote:
>
> On Tue, Jul 15, 2014, at 10:02, Karel Zak wrote:
> > umount -t <type>
> >
> > the <type> is filesystem type (so you can force umount to use for
> > example /sbin/umount.<type>).
>
> Hmm. But it's not working for me, the --types option does not limit
> umount in any way. In the man page it says: "Indicate that the
> actions should *only* be taken on filesystems of the specified type."
>
> But, for example, here Suse is of type ext4 and gets mounted:
>
> # ./mount -t ext4 /suse
> # ./mount | grep suse
> /dev/sda2 on /suse type ext4 (rw,noatime,noexec,nosuid,nodev,user)
>
> Now I want to unmount all btrfs systems:
>
> # ./umount -t btrfs /suse /zero /other
> # ./mount | grep suse
>
> It just unmounts everything that is mentioned, the -t has no
> limiting effect. So it is useful only with -a.
grrr... you're right, I see.. libmount always overwrites the setting
by stuff from mtab.
IMHO it would be nice to restrict the all the umount actions (like
--recursive, --all-targets or when more mountpoints specified) by the
pattern. I'll add this to the TODO file for v2.26.
Thanks!
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-15 9:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-14 9:57 mount: what is the point of 'nouser' on the command line? Benno Schulenberg
2014-07-14 14:57 ` Karel Zak
2014-07-14 15:24 ` Benno Schulenberg
2014-07-15 8:02 ` Karel Zak
2014-07-15 9:02 ` umount: --types does not limit Benno Schulenberg
2014-07-15 9:56 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox