util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Václav Doležal" <vdolezal@redhat.com>
To: Harald Dunkel <harald.dunkel@aixigo.com>, util-linux@vger.kernel.org
Subject: Re: careful with that umount options, Eugene
Date: Tue, 4 Jun 2019 15:55:40 +0200	[thread overview]
Message-ID: <717bc7fe-3179-98d3-ae2c-c0ab705a75c1@redhat.com> (raw)
In-Reply-To: <6c72d034-e172-9beb-e61b-bb74807ded0a@aixigo.com>

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

  reply	other threads:[~2019-06-04 13:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04 11:51 careful with that umount options, Eugene Harald Dunkel
2019-06-04 13:55 ` Václav Doležal [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=717bc7fe-3179-98d3-ae2c-c0ab705a75c1@redhat.com \
    --to=vdolezal@redhat.com \
    --cc=harald.dunkel@aixigo.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).