diff options
author | Niels de Vos <ndevos@redhat.com> | 2018-09-28 10:46:46 +0200 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-10-01 04:26:45 +0000 |
commit | 1f2aa9acb78f6d004c0ea36f9827087484871344 (patch) | |
tree | 1f1b796219e7692e328b4256abd4259163f114ae /xlators/mount/fuse | |
parent | baeb5fb5cad8ec7158cd7afb36aa7476f081aee7 (diff) |
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 <server>:<volume/subdir> <mountpoint> -o<options>
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 <alexander.zimmermann96@gmail.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/mount/fuse')
-rwxr-xr-x | xlators/mount/fuse/utils/mount.glusterfs.in | 6 |
1 files changed, 3 insertions, 3 deletions
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 <volumeserver>:<volumeid/volumeport> -o<options> <mountpoint> +Usage: $0 <server>:<volume/subdir> <mountpoint> -o<options> 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 |