Description of problem: mount.glusterfs fails to correctly parse autofs mount options Version-Release number of selected component (if applicable): v3.6.2 How reproducible: Invoke mount.glusterfs with -n -o $mountoptions e.g. mount $host:volume /mnt/volume -n -o acl Steps to Reproduce: 1. 2. 3. Actual results: volume is mounted without acls enabled (depending upon $mountoptions, the mount may fail silently instead). Expected results: Mount with acls enabled Additional info: The issue is in mount.glusterfs parsing the line using getopts: under the -n and -o cases, there are "shift" statements. These confuse getopts as getopts expects the argument list unchanged unless $OPTIND is also chagned - after parsing "-n", $OPTIND = 2, $1='-n', $2='-o', $3='acl', but the shift removes $1, causing $1='-o' and $2='acl'. The next call to getopts returns garbage as getopts tries to parse 'acl', not '-o'. The patch below fixes the issue: commit ede617d738c38a0c45275dadcfefa414574dfac0 Author: Mark Levedahl <mark.levedahl> Date: Mon Feb 9 13:15:50 2015 -0500 mount.glusterfs - remove "shift" statements getopts takes care of the command line arguments, adding "shift" in the loop causes getopt to skip when it should not. diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 68d452c..924b98f 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -556,10 +556,8 @@ main () case "${opt}" in o) parse_options ${OPTARG}; - shift 2; ;; n) - shift 1; ;; V) ${cmd_line} -V; @@ -575,6 +573,10 @@ main () ;; esac done + if test $OPTIND -gt 1 + then + shift $((OPTIND - 1)) + fi if [ "x${uname_s}" = "xNetBSD" ] ; then volfile_loc=$1
This is fixed in latest releases. (https://review.gluster.org/#/c/glusterfs/+/21295/)