From bf0a0e3e2aad599919536a9e3244686fd4292e10 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 6 Jun 2019 14:52:40 +0200 Subject: umount: be more strict about --all If you by accident execute umount ls -al /mnt/ then umount --all is executed and another arguments silently ignored. It seems better to be more strict in this case. Reported-by: Harald Dunkel Signed-off-by: Karel Zak --- sys-utils/umount.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys-utils') diff --git a/sys-utils/umount.c b/sys-utils/umount.c index e3734b0ec..397e0ebfc 100644 --- a/sys-utils/umount.c +++ b/sys-utils/umount.c @@ -573,6 +573,10 @@ int main(int argc, char **argv) argv += optind; if (all) { + if (argc) { + warnx(_("unexpected number of arguments")); + errtryhelp(MNT_EX_USAGE); + } if (!types) types = "noproc,nodevfs,nodevpts,nosysfs,norpc_pipefs,nonfsd,noselinuxfs"; -- cgit v1.2.3-55-g7522