Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1246387

Summary: Can mount a sub-directory disregarding the IP-restrict when the export has a wildcard and an IP-restricted submount export
Product: Red Hat Enterprise Linux 7 Reporter: Yongcheng Yang <yoyang>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED WONTFIX QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: steved, xzhou
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1198900 Environment:
Last Closed: 2020-12-15 07:35:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 2 Steve Dickson 2015-07-27 17:39:06 UTC
The reason the mount server:/export/2 works is because 
/export is exported to the world but /export/2 is
not so if do an ls on the mount point (/mnt/mnt_export.2/)
you will notice the '2' directory does not exist on the
client. 

I believe this is the way it should work.

Comment 3 Yongcheng Yang 2015-07-28 02:32:21 UTC
(In reply to Steve Dickson from comment #2)
> The reason the mount server:/export/2 works is because 
> /export is exported to the world but /export/2 is
> not 
Yes, that is the testing scenario.

> so if do an ls on the mount point (/mnt/mnt_export.2/)
> you will notice the '2' directory does not exist on the
> client. 
Not quite understand what the "not exist" means, client can access everything under that subdirectory, as the following log shows.

> 
> I believe this is the way it should work.

So if the directory is exported to the world, it means that all its subdirectories are actually exported to world? Even if they are exported to a single host?

Image that I have a Dir used to contain all the things exported with others. And then I will generate several subdirectory which stores different files to export to different single host, how can I do that currently?

(Server)
[root@hp-dl580g7-04 ~]# cat /etc/exports
/export *(rw,subtree_check)
/export/10.66.86.70 10.66.86.70(rw)
/export/10.66.86.88 10.66.86.88(rw)
[root@hp-dl580g7-04 ~]# service nfs restart
Redirecting to /bin/systemctl restart  nfs.service
[root@hp-dl580g7-04 ~]# cat /export/10.66.86.70/testfile 
This is private message of 10.66.87.70
[root@hp-dl580g7-04 ~]# cat /export/10.66.86.88/testfile 
This is private message of 10.66.86.88
[root@hp-dl580g7-04 ~]# 

(Client)
[root@ibm-x3550m3-06 ~]# showmount -e hp-dl580g7-04.rhts.eng.nay.redhat.com
Export list for hp-dl580g7-04.rhts.eng.nay.redhat.com:
/export             *
/export/10.66.86.88 10.66.86.88
/export/10.66.86.70 10.66.86.70
[root@ibm-x3550m3-06 ~]# mount 10.66.87.145:/export/10.66.86.70/ /mnt/mnt_export.1/
[root@ibm-x3550m3-06 ~]# mount 10.66.87.145:/export/10.66.86.88/ /mnt/mnt_export.2/
[root@ibm-x3550m3-06 ~]# cat /mnt/mnt_export.1/testfile 
This is private message of 10.66.87.70
[root@ibm-x3550m3-06 ~]# cat /mnt/mnt_export.2/testfile 
This is private message of 10.66.86.88
[root@ibm-x3550m3-06 ~]#

Comment 4 Steve Dickson 2015-07-28 14:19:41 UTC
(In reply to Yongcheng Yang from comment #3)
> (In reply to Steve Dickson from comment #2)
> > The reason the mount server:/export/2 works is because 
> > /export is exported to the world but /export/2 is
> > not 
> Yes, that is the testing scenario.
> 
> > so if do an ls on the mount point (/mnt/mnt_export.2/)
> > you will notice the '2' directory does not exist on the
> > client. 
> Not quite understand what the "not exist" means, client can access
> everything under that subdirectory, as the following log shows.
Do an ls on the mount point on the client. The '2' directory
will not show up. 

> 
> > 
> > I believe this is the way it should work.
> 
> So if the directory is exported to the world, it means that all its
> subdirectories are actually exported to world? Even if they are exported to
> a single host?
No. that's the point. The subdirectories will not be seen.

Comment 5 Yongcheng Yang 2015-07-29 00:31:15 UTC
(In reply to Steve Dickson from comment #4)
> (In reply to Yongcheng Yang from comment #3)
> > (In reply to Steve Dickson from comment #2)
> > > The reason the mount server:/export/2 works is because 
> > > /export is exported to the world but /export/2 is
> > > not 
> > Yes, that is the testing scenario.
> > 
> > > so if do an ls on the mount point (/mnt/mnt_export.2/)
> > > you will notice the '2' directory does not exist on the
> > > client. 
> > Not quite understand what the "not exist" means, client can access
> > everything under that subdirectory, as the following log shows.
> Do an ls on the mount point on the client. The '2' directory
> will not show up. 
But it shows up on the client mountpoint.

[root@ibm-x3550m3-06 ~]# showmount -e 10.66.87.145
Export list for 10.66.87.145:
/export             *
/export/10.66.86.88 10.66.86.88
/export/10.66.86.70 10.66.86.70
[root@ibm-x3550m3-06 ~]# mount 10.66.87.145:/export/ /mnt/mnt_export/
[root@ibm-x3550m3-06 ~]# ls /mnt/mnt_export/
10.66.86.70  10.66.86.88
[root@ibm-x3550m3-06 ~]# cat /mnt/mnt_export/10.66.86.70/testfile 
This is private message of 10.66.87.70
[root@ibm-x3550m3-06 ~]# cat /mnt/mnt_export/10.66.86.88/testfile 
This is private message of 10.66.86.88
[root@ibm-x3550m3-06 ~]# 
> 
> > 
> > > 
> > > I believe this is the way it should work.
> > 
> > So if the directory is exported to the world, it means that all its
> > subdirectories are actually exported to world? Even if they are exported to
> > a single host?
> No. that's the point. The subdirectories will not be seen.

Comment 6 Steve Dickson 2015-07-29 15:53:07 UTC
(In reply to Yongcheng Yang from comment #5)
> (In reply to Steve Dickson from comment #4)
> > (In reply to Yongcheng Yang from comment #3)
> > > (In reply to Steve Dickson from comment #2)
> > > > The reason the mount server:/export/2 works is because 
> > > > /export is exported to the world but /export/2 is
> > > > not 
> > > Yes, that is the testing scenario.
> > > 
> > > > so if do an ls on the mount point (/mnt/mnt_export.2/)
> > > > you will notice the '2' directory does not exist on the
> > > > client. 
> > > Not quite understand what the "not exist" means, client can access
> > > everything under that subdirectory, as the following log shows.
> > Do an ls on the mount point on the client. The '2' directory
> > will not show up. 
> But it shows up on the client mountpoint.
> 
> [root@ibm-x3550m3-06 ~]# showmount -e 10.66.87.145
> Export list for 10.66.87.145:
> /export             *
> /export/10.66.86.88 10.66.86.88
> /export/10.66.86.70 10.66.86.70
> [root@ibm-x3550m3-06 ~]# mount 10.66.87.145:/export/ /mnt/mnt_export/
> [root@ibm-x3550m3-06 ~]# ls /mnt/mnt_export/
> 10.66.86.70  10.66.86.88
> [root@ibm-x3550m3-06 ~]# cat /mnt/mnt_export/10.66.86.70/testfile 
> This is private message of 10.66.87.70
> [root@ibm-x3550m3-06 ~]# cat /mnt/mnt_export/10.66.86.88/testfile 
> This is private message of 10.66.86.88
> [root@ibm-x3550m3-06 ~]# 
make sure the export cache clear

exportfs -uav
exportfs -arv 

then retry the mounts

Comment 7 Yongcheng Yang 2015-07-30 05:29:11 UTC
(In reply to Steve Dickson from comment #6)
> make sure the export cache clear
> 
> exportfs -uav
> exportfs -arv 
> 
> then retry the mounts

Still can be reproduced.

(Server)
[root@hp-dl580g7-04 ~]# cat /etc/exports
/export *(rw,subtree_check)
/export/10.66.86.70 10.66.86.70(rw)
/export/10.66.86.88 10.66.86.88(rw)
[root@hp-dl580g7-04 ~]# exportfs -uav
                       ^^^^^^^^^^^^^^^
[root@hp-dl580g7-04 ~]# exportfs -arv 
                       ^^^^^^^^^^^^^^^
exporting 10.66.86.88:/export/10.66.86.88
exporting 10.66.86.70:/export/10.66.86.70
exporting *:/export
[root@hp-dl580g7-04 ~]# 

(Client)
[root@ibm-x3550m3-06 ~]# exportfs -uav
[root@ibm-x3550m3-06 ~]# mount 10.66.87.145:/export/ /mnt/mnt_export/
[root@ibm-x3550m3-06 ~]# cat /mnt/mnt_export/10.66.86.88/testfile 
This is private message of 10.66.86.88
[root@ibm-x3550m3-06 ~]# cat /mnt/mnt_export/10.66.86.70/testfile 
This is private message of 10.66.87.70
[root@ibm-x3550m3-06 ~]# mount 10.66.87.145:/export/10.66.86.70 /mnt/mnt_export.1/
[root@ibm-x3550m3-06 ~]# mount 10.66.87.145:/export/10.66.86.88 /mnt/mnt_export.2
[root@ibm-x3550m3-06 ~]# nfsstat -m
/mnt/mnt_export from 10.66.87.145:/export
 Flags:	rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.66.86.70,local_lock=none,addr=10.66.87.145

/mnt/mnt_export.1 from 10.66.87.145:/export/10.66.86.70
 Flags:	rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.66.86.70,local_lock=none,addr=10.66.87.145

/mnt/mnt_export.2 from 10.66.87.145:/export/10.66.86.88
 Flags:	rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.66.86.70,local_lock=none,addr=10.66.87.145

[root@ibm-x3550m3-06 ~]# showmount -e 10.66.87.145
Export list for 10.66.87.145:
/export             *
/export/10.66.86.88 10.66.86.88
/export/10.66.86.70 10.66.86.70
[root@ibm-x3550m3-06 ~]#

Comment 10 RHEL Program Management 2020-12-15 07:35:40 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.