From: "Hilliard, Jay" <Jay.Hilliard(a)disney.com>
> I have the following nis map (auto.facvs)
> * -vers=3 &:/disk1
> Which allows hosts that have /disk1 exported to be mounted to
> /facvs/$hostname
> It works fine, but on Centos4, it allows me to
> cd /facvs/foo (where foo isn't a real host out there)
> I find it has mounted my local /disk1 as /facvs/foo. It seems to be
> ignoring the key in the map pertaining to the host if it's not a valid host.
> Does anyone know of a way to make it restrictive again and fail the
> mount if the hostname match isn't valid?
Hmmm, interesting.
Normally if you don't have anything front of the ":", it assumes localhost.
In your case, are you saying this didn't happen before when you have it
an invalid hostname?
Also, are you sure it's not DNS?
Sometimes your local resolver automatically appends domainnames
in your search. And some admins setup a "default" IN A record to be
127.0.0.1 on any lookup for a domain that doesn't properly resolve.
I know that's kinda outside of your issue, but it's still something to
check "just-in-case."
Anyhoo, my typical "Golden Rule of Thumb" is to always export
with the system name as part of the share. I find it avoids a lot of
issues for myself, and it would in this case as well. I.e., only the
system with the sharename that has the systemname could be
mounted, and anything else would fail.
Especially when it comes to systems with NFS automounts that
host home directories that also share via Samba. I _avoid_ the
default "homes" share, and explicitly setup a share that points to
only an specific local path where user home directories could be
located on that specific system. Now Samba does have good
automounter support, and newer SMB has a DFS renaming
approach, but it's still a nice option that works with any legacy
setup (even when you have automounter and/or DFS in your Samba
config).
See page 1101 of "Appendix A" in "Samba Unleashed" on this --
as well as pages 1100-1102 for a general discussion of integration
of NIS Automounter maps with Samba (non-DFS). It's circa 2000,
but is still my recommended approach, even when Samba has been
built with automounter and/or SMB DFS capability.
--
Bryan J. Smith mailto:b.j.smith@ieee.org