From 1f2aa9acb78f6d004c0ea36f9827087484871344 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 28 Sep 2018 10:46:46 +0200 Subject: fuse: prevent error message "can't shift that many" On systems where /bin/sh is not Bash, running plain mount.glusterfs gives the unhelpful error "can't shift that many". The argument parsing can be a little improved. Adding a check for the number of arguments, minimal two (Gluster ip:/volume, and mountpoint), but possibly more (-o, -v etc.). With the additional check, running 'mount.glusterfs -h' now shows the following messags: Usage: /sbin/mount.glusterfs : -o Options: man 8 mount.glusterfs To display the version number of the mount helper: /sbin/mount.glusterfs -V Change-Id: I50e3ade0c6217fab4155f35ad8cb35d99d52e133 Fixes: bz#1564890 Reported-by: Alexander Zimmermann Signed-off-by: Niels de Vos --- xlators/mount/fuse/utils/mount.glusterfs.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xlators/mount/fuse/utils') diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 959f2272e2f..122c4f2892e 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -366,9 +366,9 @@ start_glusterfs () print_usage () { cat << EOF -Usage: $0 : -o +Usage: $0 : -o Options: -man 8 $0 +man 8 $(basename $0) To display the version number of the mount helper: $0 -V EOF } @@ -670,7 +670,7 @@ update_updatedb() main () { - if [ "x${uname_s}" = "xLinux" ] ; then + if [ "x${uname_s}" = "xLinux" -a $# -ge 2 ] ; then volfile_loc=$1 mount_point=$2 -- cgit