Bug 1357835 - Gluster/NFS does not accept dashes in hostnames in exports/netgroups files
Summary: Gluster/NFS does not accept dashes in hostnames in exports/netgroups files
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: nfs
Version: 3.7.13
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
Assignee: Niels de Vos
QA Contact:
URL:
Whiteboard:
Depends On: 1350237
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-19 10:39 UTC by Niels de Vos
Modified: 2016-09-01 09:32 UTC (History)
1 user (show)

Fixed In Version: glusterfs-3.7.15
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1350237
Environment:
Last Closed: 2016-09-01 09:20:35 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Niels de Vos 2016-07-19 10:39:43 UTC
+++ This bug was initially created as a clone of Bug #1350237 +++

Description of problem:
Hostnames with dashes (like "vagrant-testVM") are not correctly parsed when reading the exports/netgroups files. This causes tests/basic/mount-nfs-auth.t and tests/basic/netgroup_parsing.t to fail.

Version-Release number of selected component (if applicable):
all

How reproducible:
100%

Steps to Reproduce:
1. configure a system with a hostname containing a dash
2. run: ./run-tests.sh tests/basic/netgroup_parsing.t
3. see the test fail

Actual results:
netgroup_parsing.t fails

Expected results:
netgroup_parsing.t should pass

Additional info:

--- Additional comment from Niels de Vos on 2016-06-26 22:53:23 CEST ---

Testing with a resolvable hostname can be done like this:

- edit /etc/hostname, /etc/sysconfig/network and run 'hostname <new-hostname>'
- edit /etc/hosts and add a new line with the external IP and hostname

- copy /etc/resolv.conf to a backup location for further reference
- statically configure DNS (in /etc/sysconfig/network add DNS1=127.0.0.1)
- restart NetworkManager or the network service
- /etc/resolve.conf should now contain 'nameserver 127.0.0.1'

- install dnsmasq on the system (make sure libvirtd is not running)
- find the nameserver from the original resolv.conf (8.8.8.8 in the example)
- create the file /etc/dnsmasq.d/upstream-dns.conf with 'server=8.8.8.8'
- start dnsmasq and verify it is running

- verify with 'host <new-hostname>' that the hostname is in DNS
- verify with 'host <public-ip>' that the hostname is in DNS

--- Additional comment from Vijay Bellur on 2016-06-26 22:53:55 CEST ---

REVIEW: http://review.gluster.org/14809 (nfs: allow hostnames with dashes in exports/netgroups files) posted (#1) for review on master by Niels de Vos (ndevos)

--- Additional comment from Vijay Bellur on 2016-06-28 11:54:45 CEST ---

REVIEW: http://review.gluster.org/14809 (nfs: allow hostnames with dashes in exports/netgroups files) posted (#2) for review on master by Niels de Vos (ndevos)

--- Additional comment from Vijay Bellur on 2016-06-28 22:29:17 CEST ---

COMMIT: http://review.gluster.org/14809 committed in master by Jeff Darcy (jdarcy) 
------
commit e5221d288e41d29d89d52f8deab657d2285a852c
Author: Niels de Vos <ndevos>
Date:   Sun Jun 26 18:50:27 2016 +0200

    nfs: allow hostnames with dashes in exports/netgroups files
    
    Hostnames with dashes (like "vagrant-testVM") are not correctly parsed
    when reading the exports/netgroups files. This bacomes obvious when
    running ./run-tests-in-vagrant.sh because it causes
    tests/basic/mount-nfs-auth.t and tests/basic/netgroup_parsing.t to fail.
    
    The regex for hostname (in exports) and the entry and hostname
    (netgroups) parsing does not include the "-" sign, and hence the
    hostnames are splitted at it.
    
    BUG: 1350237
    Change-Id: I38146a283561e1fa386cc841c43fd3b1e30a87ad
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/14809
    Smoke: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Jeff Darcy <jdarcy>

Comment 1 Vijay Bellur 2016-07-19 10:42:59 UTC
REVIEW: http://review.gluster.org/14956 (nfs: allow hostnames with dashes in exports/netgroups files) posted (#1) for review on release-3.7 by Niels de Vos (ndevos)

Comment 2 Vijay Bellur 2016-08-02 10:34:33 UTC
REVIEW: http://review.gluster.org/14956 (nfs: allow hostnames with dashes in exports/netgroups files) posted (#2) for review on release-3.7 by Niels de Vos (ndevos)

Comment 3 Worker Ant 2016-08-25 21:03:15 UTC
COMMIT: http://review.gluster.org/14956 committed in release-3.7 by Niels de Vos (ndevos) 
------
commit ace4ff98991660c516e84590ce59054c042be4d1
Author: Niels de Vos <ndevos>
Date:   Tue Jul 19 12:42:07 2016 +0200

    nfs: allow hostnames with dashes in exports/netgroups files
    
    Hostnames with dashes (like "vagrant-testVM") are not correctly parsed
    when reading the exports/netgroups files. This bacomes obvious when
    running ./run-tests-in-vagrant.sh because it causes
    tests/basic/mount-nfs-auth.t and tests/basic/netgroup_parsing.t to fail.
    
    The regex for hostname (in exports) and the entry and hostname
    (netgroups) parsing does not include the "-" sign, and hence the
    hostnames are splitted at it.
    
    Cherry picked from commit e5221d288e41d29d89d52f8deab657d2285a852c:
    > BUG: 1350237
    > Change-Id: I38146a283561e1fa386cc841c43fd3b1e30a87ad
    > Signed-off-by: Niels de Vos <ndevos>
    > Reviewed-on: http://review.gluster.org/14809
    > Smoke: Gluster Build System <jenkins.org>
    > NetBSD-regression: NetBSD Build System <jenkins.org>
    > CentOS-regression: Gluster Build System <jenkins.org>
    > Reviewed-by: Jeff Darcy <jdarcy>
    
    Change-Id: I38146a283561e1fa386cc841c43fd3b1e30a87ad
    BUG: 1357835
    Signed-off-by: Niels de Vos <ndevos>
    Reviewed-on: http://review.gluster.org/14956
    CentOS-regression: Gluster Build System <jenkins.org>
    NetBSD-regression: NetBSD Build System <jenkins.org>
    Smoke: Gluster Build System <jenkins.org>
    Reviewed-by: jiffin tony Thottan <jthottan>

Comment 4 Kaushal 2016-09-01 09:20:35 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.15, please open a new bug report.

glusterfs-3.7.15 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] https://www.gluster.org/pipermail/gluster-devel/2016-September/050714.html
[2] https://www.gluster.org/pipermail/gluster-users/

Comment 5 Kaushal 2016-09-01 09:32:51 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.7.15, please open a new bug report.

glusterfs-3.7.15 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] https://www.gluster.org/pipermail/gluster-devel/2016-September/050714.html
[2] https://www.gluster.org/pipermail/gluster-users/


Note You need to log in before you can comment on or make changes to this bug.