unix-privesc-check/lib/misc/nis

61 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

2012-12-20 22:42:13 +00:00
#!/bin/sh
# $Revision: 340 $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# (c) Tim Brown, 2012
# <mailto:timb@nth-dimension.org.uk>
# <http://www.nth-dimension.org.uk/> / <http://www.machine.org.uk/>
#
# Supports: AIX, Linux
if [ -z "${nisincluded}" ]
then
nisincluded=1
. lib/misc/file
nis_authentication_in_use () {
# ldap_nis Uses LDAP NIS services for resolving names
# nis4 Uses NIS services for resolving only IPv4 addresses
# nis6 Uses NIS services for resolving only IPv6 addresses
# nis+4 Uses NIS plus services for resolving only IPv4 addresses
# nis+6 Uses NIS plus services for resolving only IPv6 addresses
# ldap_nis4 Uses NIS LDAP services for resolving only IPv4 addresses
# ldap_nis6 Uses NIS LDAP services for resolving only IPv6 addresses
if [ "`uname`" = "AIX" -a "`file_is_readable_file \"/etc/netsvc.conf\"`" -eq 1 ]
then
if [ -n "`egrep -- \"^host\" \"/etc/netsvc.conf\" | egrep -- \"nis\"`" ]
then
printf -- "1\n"
else
printf -- "0\n"
fi
elif [ "`file_is_readable_file \"/etc/nsswitch.conf\"`" -eq 1 ]
then
if [ -n "`egrep -- \"^passwd\" \"/etc/nsswitch.conf\" | egrep -- \"nis\"`" ]
then
printf -- "1\n"
else
printf -- "0\n"
fi
else
printf -- "0\n"
fi
}
fi