# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
"""NIS classes used by nscfg."""
#
# NIS Domain class shared by all NIS components.
#
"""Network Information Service (NIS) class. Represents the configuration
of a NIS Domain. See defaultdomain(4) for details."""
# Supported Property groups
# domainname specifics
"""Export from SMF. Re-generate the following configuration file:
domainname, ypservers, securenets
Non-existent or empty domain name means no domain."""
# Get domainname property
try:
except:
# Get ypservers data
ypservers = None
ypservers += '\n'
# securenets single line per smf propval
securenets = None
securenets = ''
continue # wrong number of args
if securenets == '':
securenets = None
# Create domain directory
try:
except:
# Write defaultdomain
# Save to temp file, no header
# Write ypservers if it exists
if ypservers != None:
# Save to temp file, with header
# write securenets if it exists
if securenets != None:
# Save to temp file, with header
If the domainname files does not exists, there is no domain."""
# Check for domainname first
# Import default domain
yserv = []
snet = []
# LOAD ypservers if it exists
# Check for top level yp dir
# Binding dir and domaindir
if lines == None:
lines = []
for s in lines:
s = s.translate(None, '\t ')
if len(s) > 0:
continue
emsg = 'Illegal value (%s): %s' % \
(self.YPHOSTTYPE, s)
continue
if err:
# LOAD securenets if it exists
if lines == None:
lines = []
for s in lines:
if len(s) > 0:
continue
continue
# Exit before write processing
# delete old property group
# Commit the property group
# load property group
# Add domainname
if not ret:
# Commit the property group
# validate
"""Unconfigure SMF. Reset DEFPG."""
# Commit the property group
if pgs != None:
return True
return False
#
# domainname is a single line with no comments. So check to see
# if there is a domainname and it matches the property before
#
"""Is this SMF service configured from SMF data?"""
return True
if pgs == None:
return False
return False
# Must have a domainname
if domain == None:
return False
# First check domainname
if domain == '':
else:
else:
# Unless there is a configured domain, there cannot be anything else
if not dom_is_conf: # [4] unconfigured
return False
# if property is configured but not generated that is ok.
if not has_dom: # [1] or [2]
return True
# Check for other generated configuration files
return False
return False
else:
return False # Missing ypbind tree
# Directory structure is ok.
# Next check ypservers
return False
# Finally check securenets
return False
# Domain name, dirs and optional files are configured
return True
#
# NIS Client class - nsswitch client side component
#
"""Network Information Service (NIS) class. Represents the configuration
of the NIS client. See ypinit(1m) for details."""
# Supported Property groups
ALLPROPS = {
}
"""Unconfigure SMF. Reset DEFPG."""
# Commit the property group
if pgs != None:
return True
return False
"""Is this SMF service configured from SMF data?"""
return True
return True
return False
#
# NIS Server class - For ypserv
#
"""Network Information Service (NIS) class. Represents the configuration
of the NIS server. See ypserv(1m) for details."""
# Supported Property groups
ALLPROPS = {
'service_dns': False,
}
"""Unconfigure SMF. Reset DEFPG."""
# Commit the property group
if pgs != None:
return True
return False
"""Is this SMF service configured from SMF data?"""
return True
return True
return False
#
# NIS Xfr class - For ypxfrd
#
"""Network Information Service (NIS) class. Represents the configuration
of the NIS transfer daemon (ypxfrd). See ypxfrd(1m) for details."""
# Supported Property groups
ALLPROPS = {
}
"""Unconfigure SMF. Do nothing. No configuration files."""
"""Is SMF populated with this service? Yes. (no SMF config)"""
return True
"""Is this SMF service configured from SMF data?"""
return True
#
# NIS Passwd class - for rpc.yppasswdd
#
"""Network Information Service (NIS) class. Represents the configuration
of the NIS Passwd daemon. See rpc.yppasswdd(1m) for details."""
# Supported Property groups
ALLPROPS = {
}
"""Unconfigure SMF. Do nothing. No configuration files."""
"""Is SMF populated with this service? Yes. (no SMF config)"""
return True
"""Is this SMF service configured from SMF data?"""
return True
#
# NIS Update class - for rpc.ypupdated
#
"""Network Information Service (NIS) class. Represents the configuration
of the NIS Update daemon. See rpc.ypupdated(1m) for details."""
# Supported Property groups
ALLPROPS = {
}
"""Unconfigure SMF. Do nothing. No configuration files."""
"""Is SMF populated with this service? Yes. (no SMF config)"""
return True
"""Is this SMF service configured from SMF data?"""
return True