util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* careful with that umount options, Eugene
@ 2019-06-04 11:51 Harald Dunkel
  2019-06-04 13:55 ` Václav Doležal
  2019-06-06 12:59 ` Karel Zak
  0 siblings, 2 replies; 6+ messages in thread
From: Harald Dunkel @ 2019-06-04 11:51 UTC (permalink / raw)
  To: util-linux

Hi folks

by accident I pasted

	umount ls -al /mnt/

into bash. My bad. AFAICT /proc was umounted immediately, the
rest died slowly. Don't try this at home.

Point is, according to the man page this command line should
have triggered an error message. "umount ls -al" doesn't make
sense.

Do you think the command line parser could be fixed?

util-linux is version 2.29.2-1+deb9u1, as included in Debian.
Of course I checked the diff for umount.c between 2.29 and
3.34-rc2. Apparently the getopt code has been improved, but I
did not notice a fix for this particular problem.


Thanx in advance. Keep on your good work
Harri

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: careful with that umount options, Eugene
  2019-06-04 11:51 careful with that umount options, Eugene Harald Dunkel
@ 2019-06-04 13:55 ` Václav Doležal
  2019-06-06 12:59 ` Karel Zak
  1 sibling, 0 replies; 6+ messages in thread
From: Václav Doležal @ 2019-06-04 13:55 UTC (permalink / raw)
  To: Harald Dunkel, util-linux

Hi,
-a (--all) and -l (--lazy) are valid options and GNU getopt
reorders arguments (options first) so umount has seen

    umount --all --lazy ls /mnt/

and because --all mode doesn't take any arguments, it ignored
'ls /mnt/'. Modifying this to error on extra args should be
trivial.

As for the command unmounting /proc when it should be ignored,
it is caused by umounting root dir with --lazy (MNT_DETACH)
option. See umount2(2).

Regards,
Václav Doležal

On 2019-06-04 at 13:51 Harald Dunkel wrote:
> Hi folks
> 
> by accident I pasted
> 
>     umount ls -al /mnt/
> 
> into bash. My bad. AFAICT /proc was umounted immediately, the
> rest died slowly. Don't try this at home.
> 
> Point is, according to the man page this command line should
> have triggered an error message. "umount ls -al" doesn't make
> sense.
> 
> Do you think the command line parser could be fixed?
> 
> util-linux is version 2.29.2-1+deb9u1, as included in Debian.
> Of course I checked the diff for umount.c between 2.29 and
> 3.34-rc2. Apparently the getopt code has been improved, but I
> did not notice a fix for this particular problem.
> 
> 
> Thanx in advance. Keep on your good work
> Harri

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: careful with that umount options, Eugene
  2019-06-04 11:51 careful with that umount options, Eugene Harald Dunkel
  2019-06-04 13:55 ` Václav Doležal
@ 2019-06-06 12:59 ` Karel Zak
  2019-06-06 23:31   ` Theodore Ts'o
  1 sibling, 1 reply; 6+ messages in thread
From: Karel Zak @ 2019-06-06 12:59 UTC (permalink / raw)
  To: Harald Dunkel; +Cc: util-linux

On Tue, Jun 04, 2019 at 01:51:58PM +0200, Harald Dunkel wrote:
> Hi folks
> 
> by accident I pasted
> 
> 	umount ls -al /mnt/
> 
> into bash. My bad. AFAICT /proc was umounted immediately, the
> rest died slowly. Don't try this at home.

Fixed ... new version:

 # umount ls -al /mnt/
 umount: unexpected arguments
 Try 'umount --help' for more information.

Thanks for your report.

   Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: careful with that umount options, Eugene
  2019-06-06 12:59 ` Karel Zak
@ 2019-06-06 23:31   ` Theodore Ts'o
  2019-06-07  7:20     ` Karel Zak
  0 siblings, 1 reply; 6+ messages in thread
From: Theodore Ts'o @ 2019-06-06 23:31 UTC (permalink / raw)
  To: Karel Zak; +Cc: Harald Dunkel, util-linux

On Thu, Jun 06, 2019 at 02:59:47PM +0200, Karel Zak wrote:
> On Tue, Jun 04, 2019 at 01:51:58PM +0200, Harald Dunkel wrote:
> > Hi folks
> > 
> > by accident I pasted
> > 
> > 	umount ls -al /mnt/
> > 
> > into bash. My bad. AFAICT /proc was umounted immediately, the
> > rest died slowly. Don't try this at home.
> 
> Fixed ... new version:
> 
>  # umount ls -al /mnt/
>  umount: unexpected arguments
>  Try 'umount --help' for more information.

Hmm...  Should we also prevent a lazy unmount of the root file system?

	       	       	       	 - Ted

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: careful with that umount options, Eugene
  2019-06-06 23:31   ` Theodore Ts'o
@ 2019-06-07  7:20     ` Karel Zak
  2019-06-07 13:26       ` Theodore Ts'o
  0 siblings, 1 reply; 6+ messages in thread
From: Karel Zak @ 2019-06-07  7:20 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Harald Dunkel, util-linux

On Thu, Jun 06, 2019 at 07:31:47PM -0400, Theodore Ts'o wrote:
> On Thu, Jun 06, 2019 at 02:59:47PM +0200, Karel Zak wrote:
> > On Tue, Jun 04, 2019 at 01:51:58PM +0200, Harald Dunkel wrote:
> > > Hi folks
> > > 
> > > by accident I pasted
> > > 
> > > 	umount ls -al /mnt/
> > > 
> > > into bash. My bad. AFAICT /proc was umounted immediately, the
> > > rest died slowly. Don't try this at home.
> > 
> > Fixed ... new version:
> > 
> >  # umount ls -al /mnt/
> >  umount: unexpected arguments
> >  Try 'umount --help' for more information.
> 
> Hmm...  Should we also prevent a lazy unmount of the root file system?

Not sure if we want to maintain extra rule/restriction in userspace.
Is there any reason why this feature is supported by kernel?

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: careful with that umount options, Eugene
  2019-06-07  7:20     ` Karel Zak
@ 2019-06-07 13:26       ` Theodore Ts'o
  0 siblings, 0 replies; 6+ messages in thread
From: Theodore Ts'o @ 2019-06-07 13:26 UTC (permalink / raw)
  To: Karel Zak; +Cc: Harald Dunkel, util-linux

On Fri, Jun 07, 2019 at 09:20:03AM +0200, Karel Zak wrote:
> > Hmm...  Should we also prevent a lazy unmount of the root file system?
> 
> Not sure if we want to maintain extra rule/restriction in userspace.
> Is there any reason why this feature is supported by kernel?

I certainly can't think of one.  I'll raise on linux-fsdevel; if
there's no good reason ever, I agree that it's probably better to
restrict in the kernel.

					- Ted
					

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-06-07 13:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-04 11:51 careful with that umount options, Eugene Harald Dunkel
2019-06-04 13:55 ` Václav Doležal
2019-06-06 12:59 ` Karel Zak
2019-06-06 23:31   ` Theodore Ts'o
2019-06-07  7:20     ` Karel Zak
2019-06-07 13:26       ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).