Re: careful with that umount options, Eugene

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux