[OxLUG] accessing name service switch info

Top Page
Delete this message
Reply to this message
Author: Greg Matthews
Date:  
To: Oxfordshire Linux User Group Discussion List
Subject: [OxLUG] accessing name service switch info
anyone here know how I can access NSS information from a script?

I am trying to write some portable code (perl) which needs to identify
the LDAP server(s) that a particular client is using for NSS services
(passwd, hosts, etc.)

The problem is that nss and pam are configured by different files on
different platforms:

redhat:        /etc/ldap.conf
sles:        /etc/ldap.conf
debian:     /etc/libnss-ldap.conf /etc/pam_ldap.conf
ubuntu:        /etc/ldap.conf
irix:         /etc/openldap/ldap.conf
solaris:    /var/ldap/ldap_client_file (root access only)

I made an effort to figure out which os was running and parsing the
appropriate config file but was tripped up by the fact that debian and
ubuntu use different files (both have /etc/debian_version) and it doesnt
help with solaris.

Can I query nss directly?

GREG
-- 
Greg Matthews           01491 692445
Head of UNIX/Linux, iTSS Wallingford


-- 
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.