On 2/7/20 8:27 AM, Thorsten Kukuk wrote:
On Fri, Feb 07, Roger Oberholtzer wrote:
was a program that could be told a service and add it if it does not
exist, then what you say might be true. But most installers like ours
check if a service is defined, and if not, add it to the services
file. So it needs to know the location. Is there a user command that
tells the name of this file?
So your installer is already broken today if the customer is using
LDAP or NIS?
I'm in the LDAP world for 20+ years now. I don't know any deployment
where services map is delivered via LDAP (even though RFC 2307 defines
the schema and nss_ldap and nss-pam-ldap aka nslcd support services
map). It would also be pretty stupid to do that.
The only correct way to check if an entry exist, and
over 20 years (yes, this was already on Solaris the case) is:
"getent services ...".
Checking /etc/services did never told you if a service exist.
At least not since the day SUN introduced NIS, and especially
no longer when SUN introduced /etc/nsswitch.conf.
So check with "getent services" if the service exist,
In general this is true.
But sometimes a software might want to find out if a NSS map entry is
defined *locally*. You might argue that the software should just use
getent -s usrfiles passwd but that has to be done just like the update
of nsswitch.conf. Which adds more complexity to installers because NSS
module usrfiles is not available on many platforms yet.
Still NSS maps are a fairly easy case because glibc will just try every
module listed for a map in /etc/nsswitch.conf. I have strong doubts for
general handling of config files in /etc/.
To unsubscribe, e-mail: opensuse-factory+unsubscribe(a)opensuse.org
To contact the owner, e-mail: opensuse-factory+owner(a)opensuse.org