diff options
Diffstat (limited to 'usr/src')
48 files changed, 1475 insertions, 798 deletions
diff --git a/usr/src/Makefile.lint b/usr/src/Makefile.lint index 35250a419f..8e3a183ae2 100644 --- a/usr/src/Makefile.lint +++ b/usr/src/Makefile.lint @@ -249,6 +249,7 @@ COMMON_SUBDIRS = \ cmd/sync \ cmd/syseventadm \ cmd/syseventd \ + cmd/syslogd \ cmd/tabs \ cmd/tee \ cmd/th_tools \ diff --git a/usr/src/cmd/agents/snmp/snmprelayd/Makefile b/usr/src/cmd/agents/snmp/snmprelayd/Makefile index 285b84c032..af0e29b0a7 100644 --- a/usr/src/cmd/agents/snmp/snmprelayd/Makefile +++ b/usr/src/cmd/agents/snmp/snmprelayd/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -13,13 +12,13 @@ # # 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 +# 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 # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -143,6 +142,13 @@ PARSER= $(PARSER_HOME)/$(BIN)/mibcodegen # all # +MANIFEST = snmpdx.xml +ROOTMANIFESTDIR = $(ROOTSVCAPPLICATIONMANAGEMENT) +SVCMETHOD = svc-snmpdx + +$(ROOTMANIFEST) := FILEMODE = 0444 +$(ROOTSVCMETHOD) := FILEMODE = 0555 + FILEMODE = 0644 $(CONFLOC)/snmpdx.acl := FILEMODE = 0600 GROUP = sys @@ -151,8 +157,7 @@ CLOBBERFILES= y.tab.c all: $(SOURCES.h) $(BINPROG) $(CONFIG_FILES) -install: all $(OPTPROG) $(CONFRULE) - +install: all $(OPTPROG) $(CONFRULE) $(ROOTMANIFEST) $(ROOTSVCMETHOD) $(BINPROG): $(BIN) $(OBJECTS) $(BIN)/config.o $(MYLIBS) $(CC) -o $(BINPROG) $(LDFLAGS) $(OBJECTS) $(BIN)/config.o \ diff --git a/usr/src/cmd/agents/snmp/snmprelayd/snmpdx.xml b/usr/src/cmd/agents/snmp/snmprelayd/snmpdx.xml new file mode 100644 index 0000000000..fa872522ec --- /dev/null +++ b/usr/src/cmd/agents/snmp/snmprelayd/snmpdx.xml @@ -0,0 +1,99 @@ +<?xml version="1.0"?> +<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> +<!-- + 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 + or http://www.opensolaris.org/os/licensing. + 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 + + Copyright 2006 Sun Microsystems, Inc. All rights reserved. + Use is subject to license terms. + + ident "%Z%%M% %I% %E% SMI" + + Service manifest for the Sun Solstice Enterprise Master Agent +--> + +<service_bundle type='manifest' name='SUNWsasnm:snmpdx'> + +<service + name='application/management/snmpdx' + type='service' + version='1'> + + <create_default_instance enabled='false' /> + + <single_instance /> + + <!-- + seaport needs to run before we do in order to pick an + available port for us to bind on + --> + <dependency + name='seaport' + grouping='require_all' + restart_on='none' + type='service'> + <service_fmri + value='svc:/application/management/seaport' /> + </dependency> + + <!-- conversion from rc3.d script: extending multi-user-server mode --> + <dependent + name='snmpdx_multi-user-server' + grouping='optional_all' + restart_on='none'> + <service_fmri value='svc:/milestone/multi-user-server' /> + </dependent> + + <exec_method + type='method' + name='start' + exec='/lib/svc/method/svc-snmpdx' + timeout_seconds='60'> + </exec_method> + + <exec_method + type='method' + name='stop' + exec=':kill' + timeout_seconds='10'> + </exec_method> + + <property_group name='general' type='framework'> + <!-- to stop/start snmpdx --> + <propval name='action_authorization' type='astring' + value='solaris.smf.manage.snmpdx' /> + </property_group> + + <template> + <common_name> + <loctext xml:lang='C'> + Sun Solstice Enterprise Master Agent + </loctext> + </common_name> + + <documentation> + <manpage title='snmpdx' section='1M' + manpath='/usr/share/man/' /> + </documentation> + + </template> + +</service> + +</service_bundle> diff --git a/usr/src/cmd/agents/snmp/snmprelayd/svc-snmpdx b/usr/src/cmd/agents/snmp/snmprelayd/svc-snmpdx new file mode 100755 index 0000000000..c4d2b57579 --- /dev/null +++ b/usr/src/cmd/agents/snmp/snmprelayd/svc-snmpdx @@ -0,0 +1,57 @@ +#!/sbin/sh +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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 +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# +# Start method script for the Sun Solstice Enterprise Master Agent +# + +. /lib/svc/share/smf_include.sh + +SNMP_CONFDIR=/etc/snmp/conf + +SNMP_RSRC=${SNMP_CONFDIR}/snmpdx.rsrc +SNMP_BIN=/usr/lib/snmp/snmpdx + +if [ ! -f $SNMP_RSRC ]; then + echo "Configuration file $SNMP_RSRC does not exist. Not starting snmpdx" + exit $SMF_EXIT_ERR_CONFIG +fi + +if [ ! -x $SNMP_BIN ]; then + echo "$SNMP_BIN not found. Not starting snmpdx" + exit $SMF_EXIT_ERR_CONFIG +fi + +if /usr/bin/egrep -sv '^[ ]*(#|$)' ${SNMP_RSRC} 2> /dev/null ; then + : +else + # Do not start snmpdx if snmpdx.rsrc contents are + # trivial. + echo "$SNMP_RSRC contains no definitions. Not starting snmpdx." + exit $SMF_EXIT_ERR_CONFIG +fi + +${SNMP_BIN} -y -c ${SNMP_CONFDIR} +exit $SMF_EXIT_OK diff --git a/usr/src/cmd/initpkg/init.d/init.snmpdx b/usr/src/cmd/initpkg/init.d/init.snmpdx index 0e3bee28d7..933facec4b 100644 --- a/usr/src/cmd/initpkg/init.d/init.snmpdx +++ b/usr/src/cmd/initpkg/init.d/init.snmpdx @@ -3,9 +3,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -20,34 +19,18 @@ # # CDDL HEADER END # -# -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" -SNMP_RSRC=/etc/snmp/conf/snmpdx.rsrc - case "$1" in 'start') - if [ -f ${SNMP_RSRC} -a -x /usr/lib/snmp/snmpdx ]; then - if /usr/bin/egrep -v '^[ ]*(#|$)' ${SNMP_RSRC} > \ - /dev/null 2>&1; then - /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf - else - # - # Do not start snmpdx if snmpdx.rsrc contents are - # trivial. - # - exit 0 - fi - - fi + svcadm enable -t svc:/application/management/snmpdx:default ;; 'stop') - /usr/bin/pkill -9 -x -u 0 -z ${_INIT_ZONENAME:=`/sbin/zonename`} \ - '(snmpdx|snmpv2d|mibiisa)' + svcadm disable -t svc:/application/management/snmpdx:default ;; *) diff --git a/usr/src/cmd/initpkg/rc0.d/mk.rc0.d.sh b/usr/src/cmd/initpkg/rc0.d/mk.rc0.d.sh index 6f1ac0473b..fda0fd5559 100644 --- a/usr/src/cmd/initpkg/rc0.d/mk.rc0.d.sh +++ b/usr/src/cmd/initpkg/rc0.d/mk.rc0.d.sh @@ -21,8 +21,6 @@ # # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T # All Rights Reserved - - # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -32,8 +30,6 @@ COMMON_STOPLST="27boot.server" -INIT_STOPLST="07snmpdx" - INSDIR=${ROOT}/etc/rc0.d if [ ! -d ${INSDIR} ] @@ -49,9 +45,3 @@ do rm -f ${INSDIR}/K$f ln ${ROOT}/etc/init.d/${name} ${INSDIR}/K$f done -for f in ${INIT_STOPLST} -do - name=`echo $f | sed -e 's/^..//'` - rm -f ${INSDIR}/K$f - ln ${ROOT}/etc/init.d/init.${name} ${INSDIR}/K$f -done diff --git a/usr/src/cmd/initpkg/rc1.d/mk.rc1.d.sh b/usr/src/cmd/initpkg/rc1.d/mk.rc1.d.sh index 0f6188e6d2..19119df66c 100644 --- a/usr/src/cmd/initpkg/rc1.d/mk.rc1.d.sh +++ b/usr/src/cmd/initpkg/rc1.d/mk.rc1.d.sh @@ -21,8 +21,6 @@ # # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T # All rights reserved - - # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -32,8 +30,6 @@ COMMON_STOPLST="27boot.server" -INIT_STOPLST="07snmpdx" - INSDIR=${ROOT}/etc/rc1.d if [ ! -d ${INSDIR} ] @@ -49,9 +45,3 @@ do rm -f ${INSDIR}/K$f ln ${ROOT}/etc/init.d/${name} ${INSDIR}/K$f done -for f in ${INIT_STOPLST} -do - name=`echo $f | sed -e 's/^..//'` - rm -f ${INSDIR}/K$f - ln ${ROOT}/etc/init.d/init.${name} ${INSDIR}/K$f -done diff --git a/usr/src/cmd/initpkg/rc2.d/mk.rc2.d.sh b/usr/src/cmd/initpkg/rc2.d/mk.rc2.d.sh index de66cc1174..9f76efdd90 100644 --- a/usr/src/cmd/initpkg/rc2.d/mk.rc2.d.sh +++ b/usr/src/cmd/initpkg/rc2.d/mk.rc2.d.sh @@ -21,8 +21,6 @@ # # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T # All Rights Reserved - - # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -39,8 +37,6 @@ COMMON_STARTLST="\ STOPLST="27boot.server" -INIT_STOPLST="07snmpdx" - INSDIR=${ROOT}/etc/rc2.d if [ ! -d ${INSDIR} ] @@ -56,12 +52,6 @@ do rm -f ${INSDIR}/K$f ln ${ROOT}/etc/init.d/${name} ${INSDIR}/K$f done -for f in ${INIT_STOPLST} -do - name=`echo $f | sed -e 's/^..//'` - rm -f ${INSDIR}/K$f - ln ${ROOT}/etc/init.d/init.${name} ${INSDIR}/K$f -done for f in ${COMMON_STARTLST} do name=`echo $f | sed -e 's/^..//'` diff --git a/usr/src/cmd/initpkg/rc3.d/mk.rc3.d.sh b/usr/src/cmd/initpkg/rc3.d/mk.rc3.d.sh index 22193635ce..0510e25c2f 100644 --- a/usr/src/cmd/initpkg/rc3.d/mk.rc3.d.sh +++ b/usr/src/cmd/initpkg/rc3.d/mk.rc3.d.sh @@ -21,8 +21,6 @@ # # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T # All Rights Reserved - - # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -31,8 +29,6 @@ STARTLST="16boot.server" -INIT_STARTLST="76snmpdx" - INSDIR=${ROOT}/etc/rc3.d if [ ! -d ${INSDIR} ] @@ -48,9 +44,3 @@ do rm -f ${INSDIR}/S$f ln ${ROOT}/etc/init.d/${name} ${INSDIR}/S$f done -for f in ${INIT_STARTLST} -do - name=`echo $f | sed -e 's/^..//'` - rm -f ${INSDIR}/S$f - ln ${ROOT}/etc/init.d/init.${name} ${INSDIR}/S$f -done diff --git a/usr/src/cmd/initpkg/rcS.d/mk.rcS.d.sh b/usr/src/cmd/initpkg/rcS.d/mk.rcS.d.sh index 5fff1cf855..0787bbf60e 100644 --- a/usr/src/cmd/initpkg/rcS.d/mk.rcS.d.sh +++ b/usr/src/cmd/initpkg/rcS.d/mk.rcS.d.sh @@ -19,23 +19,17 @@ # # CDDL HEADER END # -# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T # All rights reserved. # -# # ident "%Z%%M% %I% %E% SMI" -COMMON_STARTLST="" - COMMON_STOPLST="\ 27boot.server" -INIT_STOPLST="07snmpdx" - INSDIR=${ROOT}/etc/rcS.d if [ ! -d ${INSDIR} ] @@ -51,15 +45,3 @@ do rm -f ${INSDIR}/K$f ln ${ROOT}/etc/init.d/${name} ${INSDIR}/K$f done -for f in ${INIT_STOPLST} -do - name=`echo $f | sed -e 's/^..//' | sed -e 's/\.sh$//'` - rm -f ${INSDIR}/K$f - ln ${ROOT}/etc/init.d/init.${name} ${INSDIR}/K$f -done -for f in ${COMMON_STARTLST} -do - name=`echo $f | sed -e 's/^..//' | sed -e 's/\.sh$//` - rm -f ${INSDIR}/S$f - ln ${ROOT}/etc/init.d/${name} ${INSDIR}/S$f -done diff --git a/usr/src/cmd/rpcbind/bind.xml b/usr/src/cmd/rpcbind/bind.xml index 5ddf2592e4..687ce1d12d 100644 --- a/usr/src/cmd/rpcbind/bind.xml +++ b/usr/src/cmd/rpcbind/bind.xml @@ -2,38 +2,36 @@ <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <!-- - Copyright 2006 Sun Microsystems, Inc. All rights reserved. - Use is subject to license terms. - - - 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 - or http://www.opensolaris.org/os/licensing. - 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 - - - ident "%Z%%M% %I% %E% SMI" - - NOTE: This service manifest is not editable; its contents will - be overwritten by package or patch operations, including - operating system upgrade. Make customizations in a different - file. - - Service manifest for rpcbind + 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 + or http://www.opensolaris.org/os/licensing. + 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 + + Copyright 2006 Sun Microsystems, Inc. All rights reserved. + Use is subject to license terms. + + ident "%Z%%M% %I% %E% SMI" + + Service manifest for rpcbind + + NOTE: This service manifest is not editable; its contents will + be overwritten by package or patch operations, including + operating system upgrade. Make customizations in a different + file. --> <service_bundle type='manifest' name='SUNWcsr:rpcbind'> @@ -152,8 +150,31 @@ name='allow_indirect' type='boolean' value='true' /> + + <!-- local_only specifies whether rpcbind should allow + calls from hosts other than the localhost. + Setting local_only to true will make rpcbind serve + only those requests that come in from the local machine. + the default value is false, i.e. allow connections + from other systems too. + --> + <propval + name='local_only' + type='boolean' + value='false' /> + + <!-- to configure rpc/bind --> + <propval name='value_authorization' type='astring' + value='solaris.smf.value.rpc.bind' /> </property_group> + <!-- Authorization --> + <property_group name='general' type='framework'> + <!-- to enable/disable rpc/bind --> + <propval name='action_authorization' type='astring' + value='solaris.smf.manage.rpc.bind' /> + </property_group> + <stability value='Unstable' /> <template> diff --git a/usr/src/cmd/rpcbind/rpcb_check.c b/usr/src/cmd/rpcbind/rpcb_check.c index 7cda44f93a..10aade0b12 100644 --- a/usr/src/cmd/rpcbind/rpcb_check.c +++ b/usr/src/cmd/rpcbind/rpcb_check.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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 * or http://www.opensolaris.org/os/licensing. @@ -43,7 +42,7 @@ * Single function for pmap* and rpcb*; * Local transport checks made using localxprt(). * - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -220,7 +219,8 @@ rpcb_check(SVCXPRT *transp, rpcproc_t procnum, boolean_t ispmap) const char *addr_string = sgen_toa(svc_getgencaller(transp)); if (!localxprt(transp, ispmap) && - hosts_ctl("rpcbind", addr_string, addr_string, "") == 0) { + (local_only || + hosts_ctl("rpcbind", addr_string, addr_string, "") == 0)) { res = B_FALSE; } } diff --git a/usr/src/cmd/rpcbind/rpcbind.c b/usr/src/cmd/rpcbind/rpcbind.c index 89d2d5714d..c0048484f0 100644 --- a/usr/src/cmd/rpcbind/rpcbind.c +++ b/usr/src/cmd/rpcbind/rpcbind.c @@ -118,6 +118,7 @@ char *loopback_vc_ord; /* COTS_ORD loopback transport, for set and unset */ boolean_t verboselog = B_FALSE; boolean_t wrap_enabled = B_FALSE; boolean_t allow_indirect = B_TRUE; +boolean_t local_only = B_FALSE; /* Local Variable */ static int warmstart = 0; /* Grab a old copy of registrations */ @@ -945,58 +946,41 @@ logthread(void *arg) /* NOTREACHED */ } -/* - * Initialize: read the configuration parameters from the default file. - */ -static void -rpcb_check_init(void) +static boolean_t +get_smf_prop(const char *var, boolean_t def_val) { - thread_t tid; scf_simple_prop_t *prop; - uint8_t *bool; - - if ((prop = scf_simple_prop_get(NULL, NULL, "config", - "enable_tcpwrappers")) != NULL) { + uint8_t *val; + boolean_t res = def_val; - if ((bool = scf_simple_prop_next_boolean(prop)) != NULL) { - wrap_enabled = (*bool == 0) ? B_FALSE : B_TRUE; - } else { - syslog(LOG_ALERT, "enable_tcpwrappers no value %s", - scf_strerror(scf_error())); - } + prop = scf_simple_prop_get(NULL, NULL, "config", var); + if (prop) { + if ((val = scf_simple_prop_next_boolean(prop)) != NULL) + res = (*val == 0) ? B_FALSE : B_TRUE; scf_simple_prop_free(prop); - } else { - syslog(LOG_ALERT, "unable to get enable_tcpwrappers %s", - scf_strerror(scf_error())); } - if ((prop = scf_simple_prop_get(NULL, NULL, "config", - "verbose_logging")) != NULL) { - if ((bool = scf_simple_prop_next_boolean(prop)) != NULL) { - verboselog = (*bool == 0) ? B_FALSE : B_TRUE; - } else { - syslog(LOG_ALERT, "verboselog no value %s", - scf_strerror(scf_error())); - } - scf_simple_prop_free(prop); - } else { - syslog(LOG_ALERT, "unable to get verbose_logging %s", - scf_strerror(scf_error())); + if (prop == NULL || val == NULL) { + syslog(LOG_ALERT, "no value for config/%s (%s). " + "Using default \"%s\"", var, scf_strerror(scf_error()), + def_val ? "true" : "false"); } - if ((prop = scf_simple_prop_get(NULL, NULL, "config", - "allow_indirect")) != NULL) { - if ((bool = scf_simple_prop_next_boolean(prop)) != NULL) { - allow_indirect = (*bool == 0) ? B_FALSE : B_TRUE; - } else { - syslog(LOG_ALERT, "allow_indirect no value %s", - scf_strerror(scf_error())); - } - scf_simple_prop_free(prop); - } else { - syslog(LOG_ALERT, "unable to get allow_indirect %s", - scf_strerror(scf_error())); - } + return (res); +} + +/* + * Initialize: read the configuration parameters from SMF + */ +static void +rpcb_check_init(void) +{ + thread_t tid; + + wrap_enabled = get_smf_prop("enable_tcpwrappers", B_FALSE); + verboselog = get_smf_prop("verbose_logging", B_FALSE); + allow_indirect = get_smf_prop("allow_indirect", B_TRUE); + local_only = get_smf_prop("local_only", B_FALSE); if (wrap_enabled) (void) thr_create(NULL, 0, logthread, NULL, THR_DETACHED, &tid); diff --git a/usr/src/cmd/rpcbind/rpcbind.h b/usr/src/cmd/rpcbind/rpcbind.h index 7762af3bf9..477079a00f 100644 --- a/usr/src/cmd/rpcbind/rpcbind.h +++ b/usr/src/cmd/rpcbind/rpcbind.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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 * or http://www.opensolaris.org/os/licensing. @@ -18,9 +17,8 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - */ -/* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ @@ -82,21 +80,24 @@ extern boolean_t localxprt(SVCXPRT *, boolean_t); extern void qsyslog(int pri, const char *fmt, ...); extern boolean_t rpcb_check(SVCXPRT *, rpcproc_t, boolean_t); extern void rpcb_log(boolean_t, SVCXPRT *, rpcproc_t, rpcprog_t, boolean_t); -extern boolean_t allow_indirect, wrap_enabled, verboselog; +extern boolean_t allow_indirect, wrap_enabled, verboselog, local_only; #define svc_getgencaller(transp) \ ((struct sockaddr_gen *)svc_getrpccaller((transp))->buf) #define RPCB_CHECK(xprt, proc) \ - if (wrap_enabled && !rpcb_check((xprt), (proc), B_FALSE)) \ + if ((wrap_enabled || local_only) && \ + !rpcb_check((xprt), (proc), B_FALSE)) \ return #define PMAP_CHECK(xprt, proc) \ - if (wrap_enabled && !rpcb_check((xprt), (proc), B_TRUE)) \ + if ((wrap_enabled || local_only) && \ + !rpcb_check((xprt), (proc), B_TRUE)) \ return #define PMAP_CHECK_RET(xprt, proc, ret) \ - if (wrap_enabled && !rpcb_check((xprt), (proc), B_TRUE)) \ + if ((wrap_enabled || local_only) && \ + !rpcb_check((xprt), (proc), B_TRUE)) \ return (ret) #define RPCB_LOG(xprt, proc, prog) \ diff --git a/usr/src/cmd/sendmail/cf/Makefile b/usr/src/cmd/sendmail/cf/Makefile index fc2cfcfcd9..a9e5c995e1 100644 --- a/usr/src/cmd/sendmail/cf/Makefile +++ b/usr/src/cmd/sendmail/cf/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -30,9 +29,9 @@ include ../../Makefile.cmd -CFS= sendmail.cf submit.cf +CFS= sendmail.cf submit.cf local.cf -SUBCFS= cf/sendmail.cf cf/submit.cf +SUBCFS= cf/sendmail.cf cf/submit.cf cf/local.cf COMMONM4FILES= m4/version.m4 m4/cf.m4 m4/cfhead.m4 m4/proto.m4 \ ostype/solaris8.m4 domain/solaris-generic.m4 \ @@ -46,6 +45,8 @@ ROOTETCMAILCF = $(ROOTETCMAIL)/cf BUILDPARTS = $(ROOTETCMAILCF)/README \ $(ROOTETCMAILCF)/cf/Makefile \ + $(ROOTETCMAILCF)/cf/local.cf \ + $(ROOTETCMAILCF)/cf/local.mc \ $(ROOTETCMAILCF)/cf/sendmail.cf \ $(ROOTETCMAILCF)/cf/sendmail.mc \ $(ROOTETCMAILCF)/cf/submit.cf \ diff --git a/usr/src/cmd/sendmail/cf/cf/Makefile b/usr/src/cmd/sendmail/cf/cf/Makefile index af7576171a..dc4c535dc7 100644 --- a/usr/src/cmd/sendmail/cf/cf/Makefile +++ b/usr/src/cmd/sendmail/cf/cf/Makefile @@ -2,7 +2,7 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, (the "License"). +# 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 @@ -48,7 +48,7 @@ RM= /usr/bin/rm -f test ! -f $@ || $(MV) $@ $@.prev $(M4) ${CFDIR}/m4/cf.m4 $*.mc > $@ -ALL= sendmail.cf submit.cf +ALL= sendmail.cf submit.cf local.cf all: $(ALL) diff --git a/usr/src/cmd/sendmail/cf/cf/local.mc b/usr/src/cmd/sendmail/cf/cf/local.mc new file mode 100644 index 0000000000..80b05c8851 --- /dev/null +++ b/usr/src/cmd/sendmail/cf/cf/local.mc @@ -0,0 +1,44 @@ +divert(-1) +# +# Copyright (c) 1983 Eric P. Allman +# Copyright (c) 1988, 1993 +# The Regents of the University of California. All rights reserved. +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# +# This is a configuration file for SunOS 5.8 (a.k.a. Solaris 8) and later +# subsidiary machines. It has support for local and SMTP mail. The +# confFALLBACK_SMARTHOST macro is enabled, which means that messages will +# be sent to that host (which is set to mailhost.$m [$m is the local domain]) +# if MX records are unavailable. A short-cut rule is also defined, which +# says if the recipient host is in the local domain, send to it directly +# instead of the smart host. +# +# Furthermore, this configuration file defines IPv4 localhost-binding +# addresses for the MTA and MSA daemons causing the daemons to listen to +# traffic from the local-host only. +# +# This configuration file will be chosen by the sendmail start method if +# the config/local_only property of svc:/network/smtp:sendmail is set to +# "true". To have the daemons listen to external connections, set +# config/local_only to "false" and restart sendmail. +# +# If you want to customize this file in any other way, copy it to a name +# appropriate for your environment and do the modifications there. + +divert(0)dnl +VERSIONID(`%W% (Sun) %G%') +OSTYPE(`solaris8')dnl +DOMAIN(`solaris-generic')dnl +define(`confFALLBACK_SMARTHOST', `mailhost$?m.$m$.')dnl +MAILER(`local')dnl +MAILER(`smtp')dnl +FEATURE(`no_default_msa')dnl +DAEMON_OPTIONS(`NAME=NoMTA4, Family=inet, Addr=127.0.0.1')dnl +DAEMON_OPTIONS(`Name=MSA4, Family=inet, Addr=127.0.0.1, Port=587, M=E')dnl + +LOCAL_NET_CONFIG +R$* < @ $* .$m. > $* $#esmtp $@ $2.$m $: $1 < @ $2.$m. > $3 diff --git a/usr/src/cmd/sendmail/lib/smtp-sendmail b/usr/src/cmd/sendmail/lib/smtp-sendmail index 346851075a..4811c9d06e 100644 --- a/usr/src/cmd/sendmail/lib/smtp-sendmail +++ b/usr/src/cmd/sendmail/lib/smtp-sendmail @@ -3,9 +3,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -20,8 +19,7 @@ # # CDDL HEADER END # -# -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -93,8 +91,15 @@ case "$1" in fi check_queue_interval_syntax $CLIENTQUEUEINTERVAL CLIENTQUEUEINTERVAL=$answer + + local=`/usr/bin/svcprop -p config/local_only $SMF_FMRI 2>/dev/null` + if [ $? = 0 -a "$local" = "true" ]; then + OPTIONS="$OPTIONS -C /etc/mail/local.cf" + fi + /usr/lib/sendmail $MODE -q$QUEUEOPTION$QUEUEINTERVAL $OPTIONS & /usr/lib/sendmail -Ac -q$CLIENTQUEUEINTERVAL $CLIENTOPTIONS & + # # ETRN_HOSTS should be of the form # "s1:c1.1,c1.2 s2:c2.1 s3:c3.1,c3.2,c3.3" diff --git a/usr/src/cmd/sendmail/lib/smtp-sendmail.xml b/usr/src/cmd/sendmail/lib/smtp-sendmail.xml index 0f400a9936..4246ff654d 100644 --- a/usr/src/cmd/sendmail/lib/smtp-sendmail.xml +++ b/usr/src/cmd/sendmail/lib/smtp-sendmail.xml @@ -1,35 +1,34 @@ <?xml version="1.0"?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <!-- - Copyright 2005 Sun Microsystems, Inc. All rights reserved. - Use is subject to license terms. - - CDDL HEADER START - - The contents of this file are subject to the terms of the - Common Development and Distribution License, Version 1.0 only - (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 - or http://www.opensolaris.org/os/licensing. - 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 - - ident "%Z%%M% %I% %E% SMI" - - NOTE: This service manifest is not editable; its contents will - be overwritten by package or patch operations, including - operating system upgrade. Make customizations in a different - file. + 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 + or http://www.opensolaris.org/os/licensing. + 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 + + Copyright 2006 Sun Microsystems, Inc. All rights reserved. + Use is subject to license terms. + + ident "%Z%%M% %I% %E% SMI" + + NOTE: This service manifest is not editable; its contents will + be overwritten by package or patch operations, including + operating system upgrade. Make customizations in a different + file. --> <service_bundle type='manifest' name='SUNWsndmr:sendmail'> @@ -156,6 +155,15 @@ value='solaris.smf.manage.sendmail' /> </property_group> + <property_group name='config' type='application'> + <propval + name='local_only' + type='boolean' + value='false' /> + <propval name='value_authorization' type='astring' + value='solaris.smf.value.sendmail' /> + </property_group> + <template> <common_name> <loctext xml:lang='C'> diff --git a/usr/src/cmd/svc/profile/Makefile b/usr/src/cmd/svc/profile/Makefile index 1c86ca7681..4ceafed84e 100644 --- a/usr/src/cmd/svc/profile/Makefile +++ b/usr/src/cmd/svc/profile/Makefile @@ -55,8 +55,6 @@ PROFILESRCS = \ PROFILES = $(PROFILESRCS:%=$(ROOTPROFILE)/%) install: $(PROFILES) - $(RM) $(ROOTPROFILE)/generic.xml - $(LN) -s generic_open.xml $(ROOTPROFILE)/generic.xml $(RM) $(ROOTPROFILE)/platform.xml # SUNW,Sun-Fire-V890 $(RM) $(ROOTPROFILE)/platform_SUNW,Sun-Fire-V890.xml diff --git a/usr/src/cmd/svc/profile/generic_limited_net.xml b/usr/src/cmd/svc/profile/generic_limited_net.xml index faa6b56d05..509d46b4c7 100644 --- a/usr/src/cmd/svc/profile/generic_limited_net.xml +++ b/usr/src/cmd/svc/profile/generic_limited_net.xml @@ -1,37 +1,35 @@ <?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <!-- - Copyright 2005 Sun Microsystems, Inc. All rights reserved. - Use is subject to license terms. - - CDDL HEADER START - - The contents of this file are subject to the terms of the - Common Development and Distribution License, Version 1.0 only - (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 - or http://www.opensolaris.org/os/licensing. - 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 + 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 + or http://www.opensolaris.org/os/licensing. + 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 + + Copyright 2006 Sun Microsystems, Inc. All rights reserved. + Use is subject to license terms. ident "%Z%%M% %I% %E% SMI" - The purpose of the limited_net profile is to provide a set of active - services that allow one to connect to the machine via ssh (requires - sshd,) to be authenticated (requires rpc,) and to access network - filesystems (requires nfs.) The services which are deactivated here - are those that are at odds with this goal. Those which are activated - are explicit requirements for the goal's satisfaction. + The purpose of the limited_net profile is to provide a set of + active services that allow one to connect to the machine via ssh + (requires sshd). The services which are deactivated here are those + that are at odds with this goal. Those which are activated are + explicit requirements for the goal's satisfaction. NOTE: Service profiles delivered by this package are not editable, and their contents will be overwritten by package or patch @@ -93,20 +91,27 @@ <instance name='default' enabled='true'/> </service> <service name='network/nfs/status' version='1' type='service'> - <instance name='default' enabled='true'/> + <instance name='default' enabled='false'/> </service> <service name='network/nfs/nlockmgr' version='1' type='service'> - <instance name='default' enabled='true'/> + <instance name='default' enabled='false'/> </service> <service name='network/nfs/client' version='1' type='service'> - <instance name='default' enabled='true'/> + <instance name='default' enabled='false'/> </service> <service name='network/nfs/server' version='1' type='service'> - <instance name='default' enabled='true'/> + <instance name='default' enabled='false'/> </service> <service name='network/nfs/rquota' version='1' type='service'> - <instance name='default' enabled='true'/> + <instance name='default' enabled='false'/> + </service> + <service name='network/nfs/cbd' version='1' type='service'> + <instance name='default' enabled='false'/> </service> + <service name='network/nfs/mapid' version='1' type='service'> + <instance name='default' enabled='false'/> + </service> + <service name='network/ssh' version='1' type='service'> <instance name='default' enabled='true'/> </service> @@ -132,9 +137,6 @@ <instance name='default' enabled='true' /> </service> - <!-- - non-default svc.startd(1M) services disabled - --> <service name='network/dhcp-server' version='1' type='service'> <instance name='default' enabled='false' /> </service> @@ -157,8 +159,27 @@ <instance name='default' enabled='false' /> </service> + <service name='application/management/sma' version='1' type='service'> + <instance name='default' enabled='false' /> + </service> + <service name='application/management/seaport' version='1' type='service'> + <instance name='default' enabled='false' /> + </service> + <service name='application/management/snmpdx' version='1' type='service'> + <instance name='default' enabled='false' /> + </service> + <service name='application/management/wbem' version='1' type='service'> + <instance name='default' enabled='false' /> + </service> + <service name='application/print/rfc1179' version='1' type='service'> + <instance name='default' enabled='true' /> + </service> + <service name='application/print/ipp-listener' version='1' type='service'> + <instance name='default' enabled='false' /> + </service> + <!-- - default inetd(1M) services disabled + default inetd(1M) services --> <service name='network/finger' version='1' type='service'> <instance name='default' enabled='false'/> @@ -167,26 +188,20 @@ <instance name='default' enabled='false'/> </service> <service name='network/login' version='1' type='service'> - <instance name='rlogin' enabled='false'/> - <!-- - non-default inetd(1M) instances disabled - --> - <instance name='klogin' enabled='false'/> + <instance name='rlogin' enabled='false'/> + <instance name='klogin' enabled='false'/> <instance name='eklogin' enabled='false'/> </service> <service name='network/shell' version='1' type='service'> <instance name='default' enabled='false'/> - <!-- - non-default inetd(1M) instance disabled - --> - <instance name='kshell' enabled='false'/> + <instance name='kshell' enabled='false'/> </service> <service name='network/telnet' version='1' type='service'> <instance name='default' enabled='false'/> </service> <!-- - non-default inetd(1M) services disabled + non-default inetd(1M) services --> <service name='network/tname' version='1' type='service'> <instance name='default' enabled='false'/> @@ -223,6 +238,9 @@ <service name='network/talk' version='1' type='service'> <instance name='default' enabled='false'/> </service> + <service name='application/x11/xfs' version='1' type='service'> + <instance name='default' enabled='false'/> + </service> <!-- default inetd(1M) RPC services enabled @@ -231,16 +249,7 @@ <instance name='default' enabled='true'/> </service> <service name='network/rpc/mdcomm' version='1' type='service'> - <instance name='default' enabled='true'/> - </service> - <service name='network/rpc/meta' version='1' type='service'> - <instance name='default' enabled='true'/> - </service> - <service name='network/rpc/metamed' version='1' type='service'> - <instance name='default' enabled='true'/> - </service> - <service name='network/rpc/metamh' version='1' type='service'> - <instance name='default' enabled='true'/> + <instance name='default' enabled='false'/> </service> <service name='network/rpc/smserver' version='1' type='service'> <instance name='default' enabled='true'/> @@ -258,6 +267,15 @@ <service name='network/rpc/rusers' version='1' type='service'> <instance name='default' enabled='false'/> </service> + <service name='network/rpc/meta' version='1' type='service'> + <instance name='default' enabled='false'/> + </service> + <service name='network/rpc/metamed' version='1' type='service'> + <instance name='default' enabled='false'/> + </service> + <service name='network/rpc/metamh' version='1' type='service'> + <instance name='default' enabled='false'/> + </service> <!-- non-default inetd(1M) RPC services disabled @@ -275,4 +293,25 @@ <instance name='default' enabled='false'/> </service> + <!-- + Enable CDE services. + --> + <service name='application/cde-printinfo' version='1' type='service'> + <instance name='default' enabled='true' /> + </service> + <service name='application/graphical-login/cde-login' version='1' + type='service'> + <instance name='default' enabled='true' /> + </service> + <service name='network/rpc/cde-calendar-manager' version='1' type='service'> + <instance name='default' enabled='true'/> + </service> + + <!-- + Disabled CDE services. + --> + <service name='network/cde-spc' version='1' type='service'> + <instance name='default' enabled='false' /> + </service> + </service_bundle> diff --git a/usr/src/cmd/svc/profile/generic_open.xml b/usr/src/cmd/svc/profile/generic_open.xml index d2b826648b..cbd9df9c0f 100644 --- a/usr/src/cmd/svc/profile/generic_open.xml +++ b/usr/src/cmd/svc/profile/generic_open.xml @@ -1,28 +1,27 @@ <?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <!-- - Copyright 2005 Sun Microsystems, Inc. All rights reserved. - Use is subject to license terms. - - CDDL HEADER START - - The contents of this file are subject to the terms of the - Common Development and Distribution License, Version 1.0 only - (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 - or http://www.opensolaris.org/os/licensing. - 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 + 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 + or http://www.opensolaris.org/os/licensing. + 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 + + Copyright 2006 Sun Microsystems, Inc. All rights reserved. + Use is subject to license terms. ident "%Z%%M% %I% %E% SMI" @@ -100,6 +99,12 @@ <service name='network/nfs/server' version='1' type='service'> <instance name='default' enabled='true'/> </service> + <service name='network/nfs/cbd' version='1' type='service'> + <instance name='default' enabled='true'/> + </service> + <service name='network/nfs/mapid' version='1' type='service'> + <instance name='default' enabled='true'/> + </service> <service name='network/ssh' version='1' type='service'> <instance name='default' enabled='true'/> </service> @@ -122,6 +127,23 @@ <instance name='default' enabled='true' /> </service> + <service name='application/management/sma' version='1' type='service'> + <instance name='default' enabled='true' /> + </service> + <service name='application/management/seaport' version='1' type='service'> + <instance name='default' enabled='true' /> + </service> + <service name='application/management/snmpdx' version='1' type='service'> + <instance name='default' enabled='true' /> + </service> + <service name='application/management/wbem' version='1' type='service'> + <instance name='default' enabled='true' /> + </service> + + <service name='application/print/ipp-listener' version='1' type='service'> + <instance name='default' enabled='true' /> + </service> + <!-- Enable CDE services. --> @@ -133,6 +155,10 @@ <instance name='default' enabled='true' /> </service> + <service name='application/x11/xfs' version='1' type='service'> + <instance name='default' enabled='true'/> + </service> + <!-- Include inetd(1M) services profile. --> diff --git a/usr/src/cmd/svc/profile/inetd_generic.xml b/usr/src/cmd/svc/profile/inetd_generic.xml index c667c3d3f5..b5ecbb85be 100644 --- a/usr/src/cmd/svc/profile/inetd_generic.xml +++ b/usr/src/cmd/svc/profile/inetd_generic.xml @@ -1,28 +1,27 @@ <?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <!-- - Copyright 2005 Sun Microsystems, Inc. All rights reserved. - Use is subject to license terms. - - CDDL HEADER START - - The contents of this file are subject to the terms of the - Common Development and Distribution License, Version 1.0 only - (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 - or http://www.opensolaris.org/os/licensing. - 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 + 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 + or http://www.opensolaris.org/os/licensing. + 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 + + Copyright 2006 Sun Microsystems, Inc. All rights reserved. + Use is subject to license terms. ident "%Z%%M% %I% %E% SMI" @@ -98,7 +97,7 @@ </service> <service name='network/rpc/cde-calendar-manager' version='1' type='service'> - <instance name='udp' enabled='true' /> + <instance name='default' enabled='true' /> </service> </service_bundle> diff --git a/usr/src/cmd/svc/seed/Makefile b/usr/src/cmd/svc/seed/Makefile index 262a2c835c..5d6a2e5a04 100644 --- a/usr/src/cmd/svc/seed/Makefile +++ b/usr/src/cmd/svc/seed/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,7 @@ # # CDDL HEADER END # -# -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -171,6 +169,22 @@ miniroot.db: common.db $(MINIROOT_DESCRIPTIONS) $(CONFIGD) $(SVCCFG) SVCCFG_CONFIGD_PATH=$(CONFIGD) \ $(SVCCFG) import $$m; \ done + # + # Make sure the miniroot's syslogd and rpcbind do not respond + # to packets from outside the machine. Since we cannot set property + # values by applying a profile yet, we need to set them explicitly + # with svccfg commands. + # + SVCCFG_DTD=../dtd/service_bundle.dtd.1 \ + SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/miniroot.db \ + SVCCFG_CONFIGD_PATH=$(CONFIGD) \ + $(SVCCFG) -s svc:/system/system-log \ + setprop config/log_from_remote = false + # + SVCCFG_DTD=../dtd/service_bundle.dtd.1 \ + SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/miniroot.db \ + SVCCFG_CONFIGD_PATH=$(CONFIGD) \ + $(SVCCFG) -s svc:/network/rpc/bind setprop config/local_only = true install: install_global install_nonglobal install_miniroot diff --git a/usr/src/cmd/svc/shell/Makefile b/usr/src/cmd/svc/shell/Makefile index b127962cf5..b2ae130142 100644 --- a/usr/src/cmd/svc/shell/Makefile +++ b/usr/src/cmd/svc/shell/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,7 @@ # # CDDL HEADER END # -# -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -39,9 +37,17 @@ SRCS = \ SCRIPTS = $(SRCS:%=$(ROOT)/lib/svc/share/%) -install: $(SCRIPTS) +PROG = netservices +$(ROOTUSRSBINPROG) := FILEMODE= 0555 + +install: all $(SCRIPTS) $(ROOTUSRSBINPROG) $(ROOT)/lib/svc/share/%: % $(INS.file) -all lint clobber clean _msg: +all: $(PROG) + +lint _msg: + +clobber clean: + $(RM) $(PROG) diff --git a/usr/src/cmd/svc/shell/netservices.sh b/usr/src/cmd/svc/shell/netservices.sh new file mode 100644 index 0000000000..162a282737 --- /dev/null +++ b/usr/src/cmd/svc/shell/netservices.sh @@ -0,0 +1,312 @@ +#!/bin/sh +# +# 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 +# or http://www.opensolaris.org/os/licensing. +# 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 +# +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# + +# ident "%Z%%M% %I% %E% SMI" + +DT_CHANGED=0 + +LOG_FMRI=svc:/system/system-log +CMSD_FMRI=svc:/network/rpc/cde-calendar-manager +INETD_FMRI=svc:/network/inetd +BIND_FMRI=svc:/network/rpc/bind +XSERVER_FMRI=svc:/application/x11/x11-server +SENDMAIL_FMRI=svc:/network/smtp:sendmail +RFC1179_FMRI=svc:/application/print/rfc1179 +TTDB_FMRI=svc:/network/rpc/cde-ttdbserver +DTLOGIN_FMRI=svc:/application/graphical-login/cde-login +WEBCONSOLE_FMRI=svc:/system/webconsole +SMCWBEM_FMRI=svc:/application/smcwbem + +usage() +{ + prog=`basename $0` + echo "$prog: usage: $prog [ open | limited ]" >&2 + exit 2 +} + +# +# set_property fmri group property value +# +# sets the specified property in the specified property-group, creating +# the group and or property if necessary. +# +set_property() +{ + fmri=$1 + group=$2 + prop=$3 + val=$4 + + if svcprop -qp $group $fmri; then :; else + if svccfg -s $fmri addpg $group application; then :; else + echo "Failed to create property group \"$group\" \c" + echo "for $fmri." + exit 1 + fi + fi + + if svccfg -s $fmri setprop $group/$prop = boolean: $val; then :; else + echo "Failed to set property $group/$prop for $fmri" + exit 1 + fi +} + +set_system_log() +{ + svcprop -q $LOG_FMRI || return + if [ "$1" = "local" ]; then + val=false + else + val=true + fi + + set_property $LOG_FMRI config log_from_remote $val + svcadm refresh $LOG_FMRI +} + +set_cmsd() +{ + svcprop -q $CMSD_FMRI:default || return + if [ "$1" = "local" ]; then + proto="ticlts" + else + proto="udp" + fi + + inetadm -m $CMSD_FMRI:default proto=$proto + svcadm refresh $CMSD_FMRI:default +} + +set_rpcbind() +{ + svcprop -q $BIND_FMRI || return + if [ "$1" = "local" ]; then + val=true + else + val=false + fi + + set_property $BIND_FMRI config local_only $val + svcadm refresh $BIND_FMRI +} + +set_xserver() { + svcprop -q $XSERVER_FMRI || return + if [ "$1" = "local" ]; then + val=false + else + val=true + fi + + set_property $XSERVER_FMRI options tcp_listen $val + # don't need refresh since x11-server is not an actual service +} + +set_sendmail() +{ + svcprop -q $SENDMAIL_FMRI || return + if [ "$1" = "local" ]; then + val=true + else + val=false + fi + + set_property $SENDMAIL_FMRI config local_only $val + svcadm refresh $SENDMAIL_FMRI +} + +set_rfc1179() +{ + svcprop -q $RFC1179_FMRI:default || return + if [ "$1" = "local" ]; then + val=localhost + else + val= + fi + inetadm -m $RFC1179_FMRI:default bind_addr="$val" 2>/dev/null + svcadm refresh $RFC1179_FMRI:default +} + +set_ttdbserver() +{ + svcprop -q $TTDB_FMRI:tcp || return + if [ "$1" = "local" ]; then + val=ticotsord + else + val=tcp + fi + inetadm -m $TTDB_FMRI:tcp proto="$val" + svcadm refresh $TTDB_FMRI:tcp +} + +set_dtlogin() +{ + svcprop -q $DTLOGIN_FMRI || return + + eval args=`svcprop -p dtlogin/args $DTLOGIN_FMRI` + + if echo $args | egrep -s udpPort + then + old_port=`echo $args | + sed 's/.*-udpPort [ ]*\([0-9][0-9]*\).*/\1/'` + new_args=`echo $args | + sed 's/\(.*\)-udpPort [0-9][0-9]*\(.*\)/\1\2/'` + else + old_port=-1 + new_args=$args + fi + + if [ "$1" = "local" ]; then + args="$new_args -udpPort 0" + DT_CHANGED=1 + else + # remove '-udpPort 0' argument. Leave intact if port != 0. + if [ $old_port -eq 0 ]; then + args="$new_args" + DT_CHANGED=1 + fi + fi + + svccfg -s $DTLOGIN_FMRI setprop dtlogin/args = "\"$args\"" + svcadm refresh $DTLOGIN_FMRI +} + +set_webconsole() { + svcprop -q $WEBCONSOLE_FMRI:console || return + if [ "$1" = "local" ]; then + val=false + else + val=true + fi + + set_property $WEBCONSOLE_FMRI options tcp_listen $val + svcadm refresh $WEBCONSOLE_FMRI +} + +set_smcwbem() { + svcprop -q $SMCWBEM_FMRI:default || return + if [ "$1" = "local" ]; then + val=false + else + val=true + fi + + set_property $SMCWBEM_FMRI options tcp_listen $val + svcadm refresh $SMCWBEM_FMRI +} + +if [ $# -ne 1 ]; then + usage +fi + +case $1 in + "open") + profile=generic_open.xml + keyword="open" + ;; + "limited") + profile=generic_limited_net.xml + keyword="local" + ;; + *) + usage + ;; +esac + +if [ ! -f /var/svc/profile/$profile ]; then + echo "/var/svc/profile/$profile nonexistent. Exiting." + exit 1 +fi + +# +# set services +# +set_system_log $keyword +set_cmsd $keyword +set_rpcbind $keyword +set_xserver $keyword +set_sendmail $keyword +set_rfc1179 $keyword +set_ttdbserver $keyword +set_dtlogin $keyword +set_webconsole $keyword +set_smcwbem $keyword + +# +# put the new profile into place, and apply it +# +ln -sf ./$profile /var/svc/profile/generic.xml +svccfg apply /var/svc/profile/generic.xml + +# +# Make the services aware of the new property values +# +if [ "`svcprop -p restarter/state $LOG_FMRI:default`" = "online" ] +then + # need restart since refresh won't reread properties + echo "restarting syslogd" + svcadm restart $LOG_FMRI:default +fi + +if [ "`svcprop -p restarter/state $SENDMAIL_FMRI`" = "online" ] +then + # need restart since refresh won't pick up new command-line + echo "restarting sendmail" + svcadm restart $SENDMAIL_FMRI +fi + +if [ "`svcprop -p restarter/state $BIND_FMRI:default`" = "online" ] +then + # since inetd won't successfully re-register RPC-services after + # rpcbind restarts, we need to stop/start inetd too (and serialize + # these state-transitions) + svcadm disable -s $INETD_FMRI:default + svcadm disable -s $BIND_FMRI:default + echo "restarting rpcbind" + svcadm enable -s $BIND_FMRI:default + echo "restarting inetd" + svcadm enable -s $INETD_FMRI:default +fi + +if [ $DT_CHANGED -eq 1 ]; then + if [ "`svcprop -p restarter/state $DTLOGIN_FMRI:default`" = "online" ] + then + r="y" + if tty -s ; then + printf \ + "dtlogin needs to be restarted. Restart now? [Y] " + read r + fi + if [ "$r" = "" -o "$r" = "y" -o "$r" = "Y" ]; then + # Make sure we survive killing dtlogin... + trap "" 15 + svcadm restart $DTLOGIN_FMRI + echo "restarting dtlogin" + else + printf "dtlogin not restarted. " + printf "Restart it to put it in ${keyword}-mode.\n" + fi + fi +fi diff --git a/usr/src/cmd/syslogd/Makefile.com b/usr/src/cmd/syslogd/Makefile.com index 275796b9b2..952fdfea9e 100644 --- a/usr/src/cmd/syslogd/Makefile.com +++ b/usr/src/cmd/syslogd/Makefile.com @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,7 @@ # # CDDL HEADER END # -# -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -37,10 +35,13 @@ LLOBJS= $(OBJS:%.o=%.ll) include ../../Makefile.cmd -$(PROG) := LDLIBS += -lcmd -lnsl +$(PROG) lint := LDLIBS += -lscf -lnsl CCVERBOSE = CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -CPPFLAGS += -DNDEBUG +CFLAGS += -DNDEBUG + +# there's some extra utility code defined but not used. +LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2 VARSYSLOG= syslog VARAUTHLOG= authlog diff --git a/usr/src/cmd/syslogd/conf.c b/usr/src/cmd/syslogd/conf.c index 2e60db8529..385b5443d6 100644 --- a/usr/src/cmd/syslogd/conf.c +++ b/usr/src/cmd/syslogd/conf.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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 * or http://www.opensolaris.org/os/licensing. @@ -20,8 +19,8 @@ * CDDL HEADER END */ /* - * Copyright (c) 1997-2000 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -41,8 +40,6 @@ #define CF_DEFSIZE 32 /* Starting table size */ #define CF_GROW 2 /* Table size multiplier on grow */ -extern void logerror(char *); - static FILE * open_conf_pipe(const char *cmd, char *argv[], pid_t *pidp) { diff --git a/usr/src/cmd/syslogd/conf.h b/usr/src/cmd/syslogd/conf.h index d531e85ae5..342db61093 100644 --- a/usr/src/cmd/syslogd/conf.h +++ b/usr/src/cmd/syslogd/conf.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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 * or http://www.opensolaris.org/os/licensing. @@ -20,8 +19,8 @@ * CDDL HEADER END */ /* - * Copyright (c) 1997 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ #ifndef _CONF_H @@ -45,6 +44,8 @@ void conf_close(conf_t *); void conf_rewind(conf_t *); char *conf_read(conf_t *); +extern void logerror(const char *, ...); + #ifdef __cplusplus } #endif diff --git a/usr/src/cmd/syslogd/i386/Makefile b/usr/src/cmd/syslogd/i386/Makefile index fb447ff91d..b1d75f5f51 100644 --- a/usr/src/cmd/syslogd/i386/Makefile +++ b/usr/src/cmd/syslogd/i386/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -21,7 +20,7 @@ # #ident "%Z%%M% %I% %E% SMI" # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # @@ -29,6 +28,9 @@ include ../Makefile.com +# don't need the LINTED directives to surpress E_BAD_PTR_CAST_ALIGN in queue.c +LINTFLAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED + all: $(PROG) $(VARSYSLOG) $(VARAUTHLOG) install: all $(ROOTUSRSBINPROG) $(ROOTETCCONFIG) $(ROOTLIBROTATE) logfiles diff --git a/usr/src/cmd/syslogd/list.c b/usr/src/cmd/syslogd/list.c index a69d9cc899..06368d3d17 100644 --- a/usr/src/cmd/syslogd/list.c +++ b/usr/src/cmd/syslogd/list.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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 * or http://www.opensolaris.org/os/licensing. @@ -20,8 +19,8 @@ * CDDL HEADER END */ /* - * Copyright (c) 1996-1999 by Sun Microsystems, Inc. - * All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -54,8 +53,8 @@ ll_enqueue(llh_t *head, ll_t *data) void ll_mapf(llh_t *head, void (*func)(void *)) { - ll_t * t = head->front; - ll_t * n; + ll_t *t = head->front; + ll_t *n; while (t) { n = t->n; diff --git a/usr/src/cmd/syslogd/queue.c b/usr/src/cmd/syslogd/queue.c index e546605e40..e285f83a26 100644 --- a/usr/src/cmd/syslogd/queue.c +++ b/usr/src/cmd/syslogd/queue.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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 * or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 1996-2002 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -49,7 +48,7 @@ dataq_init(dataq_t *ptr) ptr->num_waiters = 0; ll_init(&ptr->data); ll_init(&ptr->waiters); - pthread_mutex_init(&ptr->lock, NULL); + (void) pthread_mutex_init(&ptr->lock, NULL); assert((pthread_mutex_lock(&ptr->lock) == 0) && (dataq_check(ptr) == 1) && (pthread_mutex_unlock(&ptr->lock) == 0)); @@ -65,7 +64,7 @@ dataq_enqueue(dataq_t *dataq, void *in) if (ptr == NULL) return (-1); ptr->data = in; - pthread_mutex_lock(&dataq->lock); + (void) pthread_mutex_lock(&dataq->lock); assert(dataq_check(dataq)); ll_enqueue(&dataq->data, &ptr->list); dataq->num_data++; @@ -73,10 +72,10 @@ dataq_enqueue(dataq_t *dataq, void *in) /*LINTED*/ sleeper = (dataq_waiter_t *)ll_peek(&dataq->waiters); sleeper->wakeup = 1; - pthread_cond_signal(&sleeper->cv); + (void) pthread_cond_signal(&sleeper->cv); } assert(dataq_check(dataq)); - pthread_mutex_unlock(&dataq->lock); + (void) pthread_mutex_unlock(&dataq->lock); return (0); } @@ -86,23 +85,23 @@ dataq_dequeue(dataq_t *dataq, void **outptr, int try) dataq_data_t *dptr; dataq_waiter_t *sleeper; - pthread_mutex_lock(&dataq->lock); + (void) pthread_mutex_lock(&dataq->lock); if ((dataq->num_waiters > 0) || ((dptr = (dataq_data_t *)ll_dequeue(&dataq->data)) == NULL)) { dataq_waiter_t wait; if (try) { - pthread_mutex_unlock(&dataq->lock); + (void) pthread_mutex_unlock(&dataq->lock); return (1); } wait.wakeup = 0; - pthread_cond_init(&wait.cv, NULL); + (void) pthread_cond_init(&wait.cv, NULL); dataq->num_waiters++; ll_enqueue(&dataq->waiters, &wait.list); while (wait.wakeup == 0) - pthread_cond_wait(&wait.cv, &dataq->lock); - ll_dequeue(&dataq->waiters); + (void) pthread_cond_wait(&wait.cv, &dataq->lock); + (void) ll_dequeue(&dataq->waiters); dataq->num_waiters--; - pthread_cond_destroy(&wait.cv); + (void) pthread_cond_destroy(&wait.cv); dptr = (dataq_data_t *)ll_dequeue(&dataq->data); } dataq->num_data--; @@ -110,9 +109,9 @@ dataq_dequeue(dataq_t *dataq, void **outptr, int try) /*LINTED*/ sleeper = (dataq_waiter_t *)ll_peek(&dataq->waiters); sleeper->wakeup = 1; - pthread_cond_signal(&sleeper->cv); + (void) pthread_cond_signal(&sleeper->cv); } - pthread_mutex_unlock(&dataq->lock); + (void) pthread_mutex_unlock(&dataq->lock); *outptr = dptr->data; free(dptr); return (0); @@ -130,14 +129,14 @@ static void dataq_waiters_destroy(void * p) { dataq_waiter_t *d = (dataq_waiter_t *)p; - pthread_cond_destroy(&d->cv); + (void) pthread_cond_destroy(&d->cv); free(d); } int dataq_destroy(dataq_t *dataq) { - pthread_mutex_destroy(&dataq->lock); + (void) pthread_mutex_destroy(&dataq->lock); ll_mapf(&dataq->data, dataq_data_destroy); ll_mapf(&dataq->waiters, dataq_waiters_destroy); return (0); diff --git a/usr/src/cmd/syslogd/syslogd.c b/usr/src/cmd/syslogd/syslogd.c index 69e8f693f4..1356f7b6ec 100644 --- a/usr/src/cmd/syslogd/syslogd.c +++ b/usr/src/cmd/syslogd/syslogd.c @@ -70,7 +70,7 @@ #include <signal.h> #include <string.h> #include <strings.h> -#include <deflt.h> +#include <libscf.h> #include <netconfig.h> #include <netdir.h> #include <pwd.h> @@ -117,7 +117,6 @@ static char *Version = "%I%"; static char *LogName = "/dev/log"; static char *ConfFile = "/etc/syslog.conf"; -static char *DflFile = "/etc/default/syslogd"; static char ctty[] = "/dev/console"; static char sysmsg[] = "/dev/sysmsg"; static int DoorFd = -1; @@ -321,7 +320,7 @@ main(int argc, char **argv) PidFileName = OLD_PIDFILE; } - defaults(); + properties(); while ((i = getopt(argc, argv, "df:p:m:tT")) != EOF) { switch (i) { @@ -840,14 +839,14 @@ net_poll(void *ap) if (!shutting_down) { logerror("t_rcvuderr"); } - t_close(Nfd[i].fd); + (void) t_close(Nfd[i].fd); Nfd[i].fd = -1; } } else { if (!shutting_down) { logerror("t_rcvudata"); } - t_close(Nfd[i].fd); + (void) t_close(Nfd[i].fd); Nfd[i].fd = -1; } nfds--; @@ -930,7 +929,8 @@ net_poll(void *ap) continue; } DPRINT3(5, "net_poll(%u): enqueued msg %p " - "on queue %p\n", mythreadno, mp, &hnlq); + "on queue %p\n", mythreadno, (void *)mp, + (void *)&hnlq); } } /*NOTREACHED*/ @@ -988,7 +988,7 @@ logmymsg(int pri, char *msg, int flags, int pending) } DPRINT3(5, "logmymsg(%u): enqueued msg %p on queue %p\n", - mythreadno, mp, qptr); + mythreadno, (void *)mp, (void *)qptr); DPRINT2(5, "logmymsg(%u): Message content: %s\n", mythreadno, msg); return (0); } @@ -1020,7 +1020,7 @@ shutdown_msg(void) } DPRINT3(5, "shutdown_msg(%u): enqueued msg %p on queue %p\n", - mythreadno, mp, &inputq); + mythreadno, (void *)mp, (void *)&inputq); return (0); } @@ -1053,7 +1053,7 @@ flushmsg(int flags) } DPRINT4(5, "flush_msg(%u): enqueued msg %p on queue %p, flags " - "0x%x\n", mythreadno, mp, &inputq, flags); + "0x%x\n", mythreadno, (void *)mp, (void *)&inputq, flags); } /* @@ -1070,7 +1070,8 @@ formatnet(struct netbuf *nbp, log_message_t *mp) mythreadno = pthread_self(); } - DPRINT2(5, "formatnet(%u): called for msg %p\n", mythreadno, mp); + DPRINT2(5, "formatnet(%u): called for msg %p\n", mythreadno, + (void *)mp); mp->flags = NETWORK; (void) time(&mp->ts); @@ -1185,7 +1186,8 @@ formatsys(struct log_ctl *lp, char *msg, int sync) } DPRINT3(5, "formatsys(%u): sys_thread enqueued msg " - "%p on queue %p\n", mythreadno, mp, &inputq); + "%p on queue %p\n", mythreadno, (void *)mp, + (void *)&inputq); } else free_msg(mp); } @@ -1227,7 +1229,8 @@ logmsg(void *ap) } _NOTE(NOW_INVISIBLE_TO_OTHER_THREADS(*mp)) DPRINT3(5, "logmsg(%u): msg dispatcher dequeued %p from " - "queue %p\n", mythreadno, mp, &inputq); + "queue %p\n", mythreadno, (void *)mp, + (void *)&inputq); /* * In most cases, if the message traffic is low, logmsg() wakes @@ -1281,12 +1284,12 @@ logmsg(void *ap) * is it a shutdown or flush message ? */ if ((mp->flags & SHUTDOWN) || (mp->flags & FLUSHMSG)) { - pthread_mutex_lock(&mp->msg_mutex); + (void) pthread_mutex_lock(&mp->msg_mutex); if ((mp->flags & SHUTDOWN) && !fake_shutdown && skip_shutdown > 0) { skip_shutdown--; - pthread_mutex_unlock(&mp->msg_mutex); + (void) pthread_mutex_unlock(&mp->msg_mutex); free_msg(mp); DPRINT2(3, "logmsg(%u): released late " "arrived SHUTDOWN. pending %d\n", @@ -1295,10 +1298,11 @@ logmsg(void *ap) } for (f = Files; f < &Files[nlogs]; f++) { - pthread_mutex_lock(&f->filed_mutex); + (void) pthread_mutex_lock(&f->filed_mutex); if (f->f_type == F_UNUSED) { - pthread_mutex_unlock(&f->filed_mutex); + (void) pthread_mutex_unlock( + &f->filed_mutex); continue; } @@ -1309,7 +1313,8 @@ logmsg(void *ap) (void *)mp) == -1) { f->f_queue_count--; mp->refcnt--; - pthread_mutex_unlock(&f->filed_mutex); + (void) pthread_mutex_unlock( + &f->filed_mutex); MALLOC_FAIL("dropping message"); if (mp->flags & SHUTDOWN) { @@ -1321,9 +1326,9 @@ logmsg(void *ap) continue; } DPRINT3(5, "logmsg(%u): enqueued msg %p " - "on queue %p\n", mythreadno, mp, - &f->f_queue); - pthread_mutex_unlock(&f->filed_mutex); + "on queue %p\n", mythreadno, + (void *)mp, (void *)&f->f_queue); + (void) pthread_mutex_unlock(&f->filed_mutex); } /* @@ -1333,12 +1338,12 @@ logmsg(void *ap) flags = mp->flags; refcnt = mp->refcnt; - pthread_mutex_unlock(&mp->msg_mutex); + (void) pthread_mutex_unlock(&mp->msg_mutex); if (refcnt == 0) free_msg(mp); if (flags & SHUTDOWN) { - pthread_mutex_lock(&hup_lock); + (void) pthread_mutex_lock(&hup_lock); while (hup_state != HUP_COMPLETED) { hup_state |= HUP_LOGMSG_SUSPENDED; (void) pthread_cond_wait(&hup_done, @@ -1346,7 +1351,7 @@ logmsg(void *ap) hup_state &= ~HUP_LOGMSG_SUSPENDED; } hup_state = HUP_ACCEPTABLE; - pthread_mutex_unlock(&hup_lock); + (void) pthread_mutex_unlock(&hup_lock); fake_shutdown = 0; } continue; @@ -1378,7 +1383,7 @@ logmsg(void *ap) */ _NOTE(NOW_VISIBLE_TO_OTHER_THREADS(*mp)) _NOTE(COMPETING_THREADS_NOW) - pthread_mutex_lock(&mp->msg_mutex); + (void) pthread_mutex_lock(&mp->msg_mutex); for (f = Files; f < &Files[nlogs]; f++) { /* skip messages that are incorrect priority */ @@ -1388,7 +1393,7 @@ logmsg(void *ap) if (f->f_queue_count > Q_HIGHWATER_MARK) { DPRINT4(5, "logmsg(%u): Dropping message " "%p on file %p, count = %d\n", - mythreadno, mp, f, + mythreadno, (void *)mp, (void *)f, f->f_queue_count); continue; } @@ -1399,13 +1404,13 @@ logmsg(void *ap) * below, and start pulling out the pending messages. */ - pthread_mutex_lock(&f->filed_mutex); + (void) pthread_mutex_lock(&f->filed_mutex); if (f->f_type == F_UNUSED || (f->f_type == F_FILE && (mp->flags & IGN_FILE)) || (f->f_type == F_CONSOLE && (mp->flags & IGN_CONS))) { - pthread_mutex_unlock(&f->filed_mutex); + (void) pthread_mutex_unlock(&f->filed_mutex); continue; } @@ -1415,17 +1420,18 @@ logmsg(void *ap) if (dataq_enqueue(&f->f_queue, (void *)mp) == -1) { f->f_queue_count--; mp->refcnt--; - pthread_mutex_unlock(&f->filed_mutex); + (void) pthread_mutex_unlock(&f->filed_mutex); MALLOC_FAIL("dropping message"); continue; } DPRINT3(5, "logmsg(%u): enqueued msg %p on queue " - "%p\n", mythreadno, mp, &f->f_queue); - pthread_mutex_unlock(&f->filed_mutex); + "%p\n", mythreadno, (void *)mp, + (void *)&f->f_queue); + (void) pthread_mutex_unlock(&f->filed_mutex); } refcnt = mp->refcnt; - pthread_mutex_unlock(&mp->msg_mutex); + (void) pthread_mutex_unlock(&mp->msg_mutex); if (refcnt == 0) free_msg(mp); } @@ -1444,34 +1450,34 @@ logit(void *ap) struct filed *f = ap; log_message_t *mp; int forwardingloop = 0; - char *errmsg = "logit(%u): %s to %s forwarding loop detected\n"; + const char *errmsg = "logit(%u): %s to %s forwarding loop detected\n"; int i, currofst, prevofst, refcnt; host_list_t *hlp; assert(f != NULL); DPRINT4(5, "logit(%u): logger started for \"%s\" (queue %p, filed " - "%p)\n", f->f_thread, f->f_un.f_fname, &f->f_queue, f); + "%p)\n", f->f_thread, f->f_un.f_fname, (void *)&f->f_queue, + (void *)f); _NOTE(COMPETING_THREADS_NOW); while (f->f_type != F_UNUSED) { (void) dataq_dequeue(&f->f_queue, (void **)&mp, 0); DPRINT3(5, "logit(%u): logger dequeued msg %p from queue " - "%p\n", - f->f_thread, mp, &f->f_queue); - pthread_mutex_lock(&f->filed_mutex); + "%p\n", f->f_thread, (void *)mp, (void *)&f->f_queue); + (void) pthread_mutex_lock(&f->filed_mutex); assert(f->f_queue_count > 0); f->f_queue_count--; - pthread_mutex_unlock(&f->filed_mutex); + (void) pthread_mutex_unlock(&f->filed_mutex); assert(mp->refcnt > 0); /* * is it a shutdown message ? */ if (mp->flags & SHUTDOWN) { - pthread_mutex_lock(&mp->msg_mutex); + (void) pthread_mutex_lock(&mp->msg_mutex); refcnt = --mp->refcnt; - pthread_mutex_unlock(&mp->msg_mutex); + (void) pthread_mutex_unlock(&mp->msg_mutex); if (refcnt == 0) free_msg(mp); break; @@ -1504,7 +1510,7 @@ logit(void *ap) if (f->f_type == F_FILE) { DPRINT2(5, "logit(%u): got FLUSH|SYNC " "for filed %p\n", f->f_thread, - f); + (void *)f); (void) fsync(f->f_file); } goto out; @@ -1589,7 +1595,7 @@ logit(void *ap) f->f_current.host) == 0)) { /* a dup */ DPRINT2(2, "logit(%u): msg is dup - %p\n", - f->f_thread, mp); + f->f_thread, (void *)mp); if (currofst == 16) { (void) strncpy(f->f_prevmsg.msg, f->f_current.msg, 15); /* update time */ @@ -1613,18 +1619,18 @@ logit(void *ap) copy_msg(f); if (f->f_current.flags & MARK) { DPRINT2(2, "logit(%u): msg is " - "mark - %p)\n", - f->f_thread, mp); + "mark - %p)\n", f->f_thread, + (void *)mp); f->f_msgflag &= ~OLD_VALID; } else { DPRINT2(2, "logit(%u): saving " - "message - %p\n", - f->f_thread, mp); + "message - %p\n", f->f_thread, + (void *)mp); } f->f_stat.total++; } else { /* new message */ DPRINT2(2, "logit(%u): msg is new " - "- %p\n", f->f_thread, mp); + "- %p\n", f->f_thread, (void *)mp); writemsg(CURRENT, f); if (!(mp->flags & NOCOPY)) copy_msg(f); @@ -1639,9 +1645,9 @@ logit(void *ap) * zero so another thread doesn't beat us to it. */ out: - pthread_mutex_lock(&mp->msg_mutex); + (void) pthread_mutex_lock(&mp->msg_mutex); refcnt = --mp->refcnt; - pthread_mutex_unlock(&mp->msg_mutex); + (void) pthread_mutex_unlock(&mp->msg_mutex); if (refcnt == 0) free_msg(mp); } @@ -1651,22 +1657,22 @@ out: * Pull out all pending messages, if they exist. */ - pthread_mutex_lock(&f->filed_mutex); + (void) pthread_mutex_lock(&f->filed_mutex); while (f->f_queue_count > 0) { (void) dataq_dequeue(&f->f_queue, (void **)&mp, 0); DPRINT3(5, "logit(%u): logger dequeued msg %p from queue " "%p\n", - f->f_thread, mp, &f->f_queue); - pthread_mutex_lock(&mp->msg_mutex); + f->f_thread, (void *)mp, (void *)&f->f_queue); + (void) pthread_mutex_lock(&mp->msg_mutex); refcnt = --mp->refcnt; - pthread_mutex_unlock(&mp->msg_mutex); + (void) pthread_mutex_unlock(&mp->msg_mutex); if (refcnt == 0) free_msg(mp); f->f_queue_count--; } - pthread_mutex_unlock(&f->filed_mutex); + (void) pthread_mutex_unlock(&f->filed_mutex); if (f->f_type != F_USERS && f->f_type != F_WALL && f->f_type != F_UNUSED) { @@ -1685,9 +1691,9 @@ out: } f->f_type = F_UNUSED; - pthread_mutex_lock(&cft); + (void) pthread_mutex_lock(&cft); --conf_threads; - pthread_mutex_unlock(&cft); + (void) pthread_mutex_unlock(&cft); DPRINT1(5, "logit(%u): logging thread exited\n", f->f_thread); return (NULL); } @@ -1707,8 +1713,9 @@ set_flush_msg(struct filed *f) else (void) strncpy(tbuf, "times", sizeof (tbuf)); - (void) sprintf(f->f_prevmsg.msg+prevofst, - "last message repeated %d %s", f->f_prevcount, tbuf); + (void) snprintf(f->f_prevmsg.msg+prevofst, + sizeof (f->f_prevmsg.msg) - prevofst, + "last message repeated %d %s", f->f_prevcount, tbuf); f->f_prevcount = 0; f->f_msgflag |= OLD_VALID; } @@ -1875,7 +1882,7 @@ writemsg(int selection, struct filed *f) } DPRINT3(5, "writemsg(%u): " "filtered allocated (%p: %d bytes)\n", - mythreadno, filtered, filter_len); + mythreadno, (void *)filtered, filter_len); /* -3 : we may add "\r\n" to ecomp(filtered) later */ filter_string(cp, filtered, filter_len - 3); @@ -1956,7 +1963,7 @@ writemsg(int selection, struct filed *f) (void) fsync(f->f_file); DPRINT2(5, "writemsg(%u): freeing filtered (%p)\n", - mythreadno, filtered); + mythreadno, (void *)filtered); free(filtered); break; @@ -1992,7 +1999,7 @@ wallmsg(struct filed *f, char *from, char *msg) logerror(UTMPX_FILE); return; } else if (statbuf.st_uid != 0 || (statbuf.st_mode & 07777) != 0644) { - (void) sprintf(line, "%s %s", UTMPX_FILE, + (void) snprintf(line, sizeof (line), "%s %s", UTMPX_FILE, "not owned by root or not mode 644.\n" "This file must be owned by root " "and not writable by\n" @@ -2015,14 +2022,14 @@ wallmsg(struct filed *f, char *from, char *msg) return; } DPRINT3(5, "wallmsg(%u): buf allocated (%p: %d bytes)\n", - mythreadno, buf, len + 1); + mythreadno, (void *)buf, len + 1); (void) strcpy(buf, line); (void) strcat(buf, msg + 16); clen = copy_frwd(cp, sizeof (cp), buf, len); DPRINT2(5, "wallmsg(%u): clen = %d\n", mythreadno, clen); DPRINT2(5, "wallmsg(%u): freeing buf (%p)\n", - mythreadno, buf); + mythreadno, (void *)buf); free(buf); } else { clen = copy_frwd(cp, sizeof (cp), msg, strlen(msg)); @@ -2161,7 +2168,7 @@ writetodev(void *ap) mythreadno, w->dev); } - pthread_attr_destroy(&w->thread_attr); + (void) pthread_attr_destroy(&w->thread_attr); free(w); DPRINT1(1, "writetodev(%u): Device writer thread exiting\n", @@ -2203,7 +2210,7 @@ cvthname(struct netbuf *nbp, struct netconfig *ncp, char *failsafe_addr) if ((h = hnc_lookup(nbp, ncp, &hindex)) != NULL) { DPRINT4(2, "cvthname(%u): Cache found %p for %s (%s)\n", - mythreadno, h, uap ? uap : "<unknown>", + mythreadno, (void *)h, uap ? uap : "<unknown>", h->hl_hosts[0]); return (h); } @@ -2271,6 +2278,7 @@ out: netdir_free((void *)hsp, ND_HOSTSERVLIST); MALLOC_FAIL("host name conversion"); return (NULL); } + /*LINTED*/ (void) sprintf(h->hl_hosts[0], "[%s]", failsafe_addr); DPRINT2(1, "cvthname(%u): Hostname lookup failed " "- using address %s instead\n", @@ -2285,7 +2293,7 @@ out: netdir_free((void *)hsp, ND_HOSTSERVLIST); } hnc_register(nbp, ncp, h, hindex); DPRINT3(2, "cvthname(%u): returning %p for %s\n", - mythreadno, h, h->hl_hosts[0]); + mythreadno, (void *)h, h->hl_hosts[0]); return (h); } @@ -2311,7 +2319,7 @@ logerror(const char *type, ...) va_end(ap); DPRINT2(1, "logerror(%u): %s\n", mythreadno, buf); - pthread_mutex_lock(&logerror_lock); + (void) pthread_mutex_lock(&logerror_lock); if (!interrorlog) { flag = 0; if (logerror_to_console(1, buf) == 0) { @@ -2324,7 +2332,7 @@ logerror(const char *type, ...) (void) logerror_to_console(1, buf); } } - pthread_mutex_unlock(&logerror_lock); + (void) pthread_mutex_unlock(&logerror_lock); errno = 0; t_errno = 0; @@ -2448,25 +2456,25 @@ freehl(host_list_t *h) mythreadno = pthread_self(); } - DPRINT2(2, "freehl(%u): releasing %p\n", mythreadno, h); + DPRINT2(2, "freehl(%u): releasing %p\n", mythreadno, (void *)h); if (h == NULL || h == &LocalHostName || h == &NullHostName) { return; } - pthread_mutex_lock(&h->hl_mutex); + (void) pthread_mutex_lock(&h->hl_mutex); refcnt = --h->hl_refcnt; - pthread_mutex_unlock(&h->hl_mutex); + (void) pthread_mutex_unlock(&h->hl_mutex); if (refcnt != 0) { DPRINT3(5, "freehl(%u): %p has reference %d\n", - mythreadno, h, refcnt); + mythreadno, (void *)h, refcnt); return; } - pthread_mutex_destroy(&h->hl_mutex); + (void) pthread_mutex_destroy(&h->hl_mutex); - DPRINT2(5, "freehl(%u): freeing %p\n", mythreadno, h); + DPRINT2(5, "freehl(%u): freeing %p\n", mythreadno, (void *)h); for (i = 0; i < h->hl_cnt; i++) { free(h->hl_hosts[i]); @@ -2542,8 +2550,9 @@ open_door(void) if ((door = creat(DoorFileName, 0644)) < 0) { err = errno; - (void) sprintf(line, "creat() of %s " - "failed - fatal", DoorFileName); + (void) snprintf(line, sizeof (line), + "creat() of %s failed - fatal", + DoorFileName); DPRINT3(1, "open_door(%u): error: %s, " "errno=%d\n", mythreadno, line, err); @@ -2571,9 +2580,9 @@ open_door(void) OLD_DOORFILE); if (S_ISDIR(buf.st_mode)) { - (void) sprintf(line, "%s is a " - "directory - fatal", - OLD_DOORFILE); + (void) snprintf(line, sizeof (line), + "%s is a directory - fatal", + OLD_DOORFILE); DPRINT2(1, "open_door(%u): error: " "%s\n", mythreadno, line); errno = 0; @@ -2588,8 +2597,9 @@ open_door(void) if (unlink(OLD_DOORFILE) < 0) { err = errno; - (void) sprintf(line, "unlink() of %s " - "failed", OLD_DOORFILE); + (void) snprintf(line, sizeof (line), + "unlink() of %s failed", + OLD_DOORFILE); DPRINT2(5, "open_door(%u): %s\n", mythreadno, line); @@ -2616,9 +2626,9 @@ open_door(void) if (symlink(RELATIVE_DOORFILE, OLD_DOORFILE) < 0) { err = errno; - (void) sprintf(line, "symlink %s -> %s " - "failed", OLD_DOORFILE, - RELATIVE_DOORFILE); + (void) snprintf(line, sizeof (line), + "symlink %s -> %s failed", OLD_DOORFILE, + RELATIVE_DOORFILE); DPRINT2(5, "open_door(%u): %s\n", mythreadno, line); @@ -2664,9 +2674,8 @@ open_door(void) if (fattach(DoorFd, DoorFileName) < 0) { err = errno; - (void) sprintf(line, "fattach() of fd" - " %d to %s failed - fatal", - DoorFd, DoorFileName); + (void) snprintf(line, sizeof (line), "fattach() of fd" + " %d to %s failed - fatal", DoorFd, DoorFileName); DPRINT3(1, "open_door(%u): error: %s, errno=%d\n", mythreadno, line, err); errno = err; @@ -2692,8 +2701,8 @@ open_door(void) if ((pidfd = open(PidFileName, O_RDWR|O_CREAT|O_TRUNC, 0644)) < 0) { err = errno; - (void) sprintf(line, "open() of %s failed", - PidFileName); + (void) snprintf(line, sizeof (line), + "open() of %s failed", PidFileName); DPRINT3(1, "open_door(%u): warning: %s, errno=%d\n", mythreadno, line, err); errno = err; @@ -2706,8 +2715,8 @@ open_door(void) if (write(pidfd, line, strlen(line)) < 0) { err = errno; - (void) sprintf(line, "write to %s on fd %d failed", - PidFileName, pidfd); + (void) snprintf(line, sizeof (line), + "write to %s on fd %d failed", PidFileName, pidfd); DPRINT3(1, "open_door(%u): warning: %s, errno=%d\n", mythreadno, line, err); errno = err; @@ -2726,9 +2735,9 @@ open_door(void) "succeded\n", mythreadno, OLD_PIDFILE); if (S_ISDIR(buf.st_mode)) { - (void) sprintf(line, "file %s is a " - "directory", - OLD_PIDFILE); + (void) snprintf(line, sizeof (line), + "file %s is a directory", + OLD_PIDFILE); DPRINT2(1, "open_door(%u): warning: " "%s\n", mythreadno, line); errno = 0; @@ -2738,8 +2747,9 @@ open_door(void) if (unlink(OLD_PIDFILE) < 0) { err = errno; - (void) sprintf(line, "unlink() " - "of %s failed", OLD_PIDFILE); + (void) snprintf(line, sizeof (line), + "unlink() of %s failed", + OLD_PIDFILE); DPRINT2(5, "open_door(%u): %s\n", mythreadno, line); @@ -2764,8 +2774,8 @@ open_door(void) if (symlink(RELATIVE_PIDFILE, OLD_PIDFILE) < 0) { err = errno; - (void) sprintf(line, "symlink %s -> %s " - "failed", OLD_PIDFILE, + (void) snprintf(line, sizeof (line), + "symlink %s -> %s failed", OLD_PIDFILE, RELATIVE_PIDFILE); DPRINT2(5, "open_door(%u): %s\n", mythreadno, line); @@ -3078,17 +3088,17 @@ dumpstats(int fd) } if (!conversion_printed) { - fprintf(out, "\nFacilities:\n"); + (void) fprintf(out, "\nFacilities:\n"); for (i = 0; FacNames[i].c_val != -1; i++) { - fprintf(out, " [%02d] %s: %3d\n", i, + (void) fprintf(out, " [%02d] %s: %3d\n", i, FacNames[i].c_name, FacNames[i].c_val); } - fprintf(out, "\nPriorities:\n"); + (void) fprintf(out, "\nPriorities:\n"); for (i = 0; PriNames[i].c_val != -1; i++) { - fprintf(out, " [%02d] %s: %3d\n", i, + (void) fprintf(out, " [%02d] %s: %3d\n", i, PriNames[i].c_name, PriNames[i].c_val); } @@ -3263,9 +3273,9 @@ nofile: exit(1); } - pthread_mutex_lock(&cft); + (void) pthread_mutex_lock(&cft); ++conf_threads; - pthread_mutex_unlock(&cft); + (void) pthread_mutex_unlock(&cft); if (f->f_type != F_UNUSED && f->f_pmask[LOG_NFACILITIES] != NOPRI) @@ -3294,7 +3304,7 @@ filed_init(struct filed *f) } DPRINT2(5, "filed_init(%u): dataq_init for queue %p\n", - mythreadno, &f->f_queue); + mythreadno, (void *)&f->f_queue); (void) dataq_init(&f->f_queue); if (pthread_attr_init(&stack_attr) != 0) { @@ -3327,11 +3337,11 @@ filed_init(struct filed *f) if (pthread_create(&f->f_thread, NULL, logit, (void *)f) != 0) { logerror("pthread_create failed"); - pthread_attr_destroy(&stack_attr); + (void) pthread_attr_destroy(&stack_attr); return (-1); } - pthread_attr_destroy(&stack_attr); + (void) pthread_attr_destroy(&stack_attr); return (0); } @@ -3426,7 +3436,7 @@ cfline(char *line, int lineno, struct filed *f) case '@': (void) strlcpy(f->f_un.f_forw.f_hname, ++p, SYS_NMLN); - if (logforward(f, ebuf) != 0) { + if (logforward(f, ebuf, sizeof (ebuf)) != 0) { logerror("line %d: %s", lineno, ebuf); break; } @@ -3681,7 +3691,7 @@ addnet(struct netconfig *ncp, struct netbuf *nbp) Udp[Ninputs] = (struct t_unitdata *)t_alloc(fd, T_UNITDATA, T_ADDR); if (Udp[Ninputs] == NULL) { - t_close(fd); + (void) t_close(fd); return (1); } @@ -3689,17 +3699,17 @@ addnet(struct netconfig *ncp, struct netbuf *nbp) Errp[Ninputs] = (struct t_uderr *)t_alloc(fd, T_UDERROR, T_ADDR); if (Errp[Ninputs] == NULL) { - t_close(fd); - t_free((char *)Udp[Ninputs], T_UNITDATA); + (void) t_close(fd); + (void) t_free((char *)Udp[Ninputs], T_UNITDATA); return (1); } if ((bp = malloc(sizeof (struct netbuf))) == NULL || (bp->buf = malloc(nbp->len)) == NULL) { MALLOC_FAIL("allocating address buffer"); - t_close(fd); - t_free((char *)Udp[Ninputs], T_UNITDATA); - t_free((char *)Errp[Ninputs], T_UDERROR); + (void) t_close(fd); + (void) t_free((char *)Udp[Ninputs], T_UNITDATA); + (void) t_free((char *)Errp[Ninputs], T_UDERROR); if (bp) { free(bp); @@ -3797,7 +3807,7 @@ bindnet(void) if (t_bind(Nfd[cnt].fd, &bind, bound) == 0) { if (same_addr(&bind.addr, &bound->addr)) { - t_free((char *)bound, T_BIND); + (void) t_free((char *)bound, T_BIND); set_udp_buffer(Nfd[cnt].fd); cnt++; continue; @@ -3805,7 +3815,7 @@ bindnet(void) } /* failed to bind port */ - t_free((char *)bound, T_BIND); + (void) t_free((char *)bound, T_BIND); (void) strcpy(ebuf, "Unable to bind syslog port"); @@ -3826,11 +3836,11 @@ bindnet(void) errno = 0; logerror(ebuf); - t_close(Nfd[cnt].fd); + (void) t_close(Nfd[cnt].fd); free(Myaddrs[cnt]->buf); free(Myaddrs[cnt]); - t_free((char *)Udp[cnt], T_UNITDATA); - t_free((char *)Errp[cnt], T_UDERROR); + (void) t_free((char *)Udp[cnt], T_UNITDATA); + (void) t_free((char *)Errp[cnt], T_UDERROR); for (i = cnt; i < (Ninputs-1); i++) { Nfd[i] = Nfd[i + 1]; @@ -3845,7 +3855,7 @@ bindnet(void) } static int -logforward(struct filed *f, char *ebuf) +logforward(struct filed *f, char *ebuf, size_t elen) { struct nd_hostserv hs; struct netbuf *nbp; @@ -3859,8 +3869,8 @@ logforward(struct filed *f, char *ebuf) hs.h_serv = "syslog"; if ((handle = setnetconfig()) == NULL) { - (void) strcpy(ebuf, - "unable to rewind the netconfig database"); + (void) strlcpy(ebuf, + "unable to rewind the netconfig database", elen); errno = 0; return (-1); } @@ -3876,31 +3886,32 @@ logforward(struct filed *f, char *ebuf) } } if (ncp == NULL) { - endnetconfig(handle); - (void) sprintf(ebuf, "WARNING: %s could not be resolved", hp); + (void) endnetconfig(handle); + (void) snprintf(ebuf, elen, + "WARNING: %s could not be resolved", hp); errno = 0; return (-1); } if (nap == (struct nd_addrlist *)NULL) { - endnetconfig(handle); - (void) sprintf(ebuf, "unknown host %s", hp); + (void) endnetconfig(handle); + (void) snprintf(ebuf, elen, "unknown host %s", hp); errno = 0; return (-1); } /* CSTYLED */ if (ismyaddr(nbp)) { /*lint !e644 */ netdir_free((void *)nap, ND_ADDRLIST); - endnetconfig(handle); - (void) sprintf(ebuf, "host %s is this host - logging loop", - hp); + (void) endnetconfig(handle); + (void) snprintf(ebuf, elen, + "host %s is this host - logging loop", hp); errno = 0; return (-1); } f->f_un.f_forw.f_addr.buf = malloc(nbp->len); if (f->f_un.f_forw.f_addr.buf == NULL) { netdir_free((void *)nap, ND_ADDRLIST); - endnetconfig(handle); - (void) strcpy(ebuf, "malloc failed"); + (void) endnetconfig(handle); + (void) strlcpy(ebuf, "malloc failed", elen); return (-1); } bcopy(nbp->buf, f->f_un.f_forw.f_addr.buf, nbp->len); @@ -3908,17 +3919,17 @@ logforward(struct filed *f, char *ebuf) f->f_file = t_open(ncp->nc_device, O_RDWR, NULL); if (f->f_file < 0) { netdir_free((void *)nap, ND_ADDRLIST); - endnetconfig(handle); + (void) endnetconfig(handle); free(f->f_un.f_forw.f_addr.buf); - (void) strcpy(ebuf, "t_open"); + (void) strlcpy(ebuf, "t_open", elen); return (-1); } netdir_free((void *)nap, ND_ADDRLIST); - endnetconfig(handle); + (void) endnetconfig(handle); if (t_bind(f->f_file, NULL, NULL) < 0) { - (void) strcpy(ebuf, "t_bind"); + (void) strlcpy(ebuf, "t_bind", elen); free(f->f_un.f_forw.f_addr.buf); - t_close(f->f_file); + (void) t_close(f->f_file); return (-1); } return (0); @@ -3980,7 +3991,7 @@ amiloghost(void) if (fd < 0) { netdir_free((void *)nap, ND_ADDRLIST); - endnetconfig(handle); + (void) endnetconfig(handle); return (0); } @@ -3990,14 +4001,14 @@ amiloghost(void) bind.qlen = 0; if (t_bind(fd, &bind, bound) == 0) { - t_close(fd); - t_free((char *)bound, T_BIND); + (void) t_close(fd); + (void) t_free((char *)bound, T_BIND); netdir_free((void *)nap, ND_ADDRLIST); - endnetconfig(handle); + (void) endnetconfig(handle); return (1); } else { - t_close(fd); - t_free((char *)bound, T_BIND); + (void) t_close(fd); + (void) t_free((char *)bound, T_BIND); } nbp++; @@ -4006,7 +4017,7 @@ amiloghost(void) netdir_free((void *)nap, ND_ADDRLIST); } - endnetconfig(handle); + (void) endnetconfig(handle); return (0); } @@ -4016,7 +4027,7 @@ same_addr(struct netbuf *na, struct netbuf *nb) char *a, *b; size_t n; - assert(a != NULL && b != NULL); + assert(na->buf != NULL && nb->buf != NULL); if (na->len != nb->len) { return (0); @@ -4063,7 +4074,7 @@ new_msg(void) lm->msg[0] = '\0'; lm->ptr = NULL; - DPRINT2(3, "new_msg(%u): creating msg %p\n", mythreadno, lm); + DPRINT2(3, "new_msg(%u): creating msg %p\n", mythreadno, (void *)lm); return (lm); } @@ -4083,7 +4094,7 @@ free_msg(log_message_t *lm) assert(lm != NULL && lm->refcnt == 0); if (lm->hlp != NULL) freehl(lm->hlp); - DPRINT2(3, "free_msg(%u): freeing msg %p\n", mythreadno, lm); + DPRINT2(3, "free_msg(%u): freeing msg %p\n", mythreadno, (void *)lm); free(lm); } @@ -4126,7 +4137,7 @@ filter_string(char *mbstr, char *filtered, size_t max) * in ASCII format. */ DPRINT2(9, "filter_string(%u): Invalid " - "MB sequence: %d\n", mythreadno, + "MB sequence: %ld\n", mythreadno, wc); if (!putctrlc(*p++, &filtered, &cs, max)) { @@ -4154,7 +4165,7 @@ filter_string(char *mbstr, char *filtered, size_t max) char *q = filtered; DPRINT2(9, "filter_string(%u): MB" - " control character: %d\n", + " control character: %ld\n", mythreadno, wc); while (mlen--) { @@ -4313,7 +4324,7 @@ static void filed_destroy(struct filed *f) { (void) dataq_destroy(&f->f_queue); - pthread_mutex_destroy(&f->filed_mutex); + (void) pthread_mutex_destroy(&f->filed_mutex); } static void @@ -4347,8 +4358,8 @@ delete_doorfiles(void) if (lstat(DoorFileName, &sb) == 0 && !S_ISDIR(sb.st_mode)) { if (unlink(DoorFileName) < 0) { err = errno; - (void) sprintf(line, "unlink() of %s failed - fatal", - DoorFileName); + (void) snprintf(line, sizeof (line), + "unlink() of %s failed - fatal", DoorFileName); errno = err; logerror(line); DPRINT3(1, "delete_doorfiles(%u): error: %s, " @@ -4364,14 +4375,15 @@ delete_doorfiles(void) if (lstat(OLD_DOORFILE, &sb) == 0 && !S_ISDIR(sb.st_mode)) { if (unlink(OLD_DOORFILE) < 0) { err = errno; - (void) sprintf(line, "unlink() of %s " - "failed", OLD_DOORFILE); + (void) snprintf(line, sizeof (line), + "unlink() of %s failed", OLD_DOORFILE); DPRINT2(5, "delete_doorfiles(%u): %s\n", mythreadno, line); if (err != EROFS) { errno = err; - (void) strcat(line, " - fatal"); + (void) strlcat(line, " - fatal", + sizeof (line)); logerror(line); DPRINT3(1, "delete_doorfiles(%u): " "error: %s, errno=%d\n", @@ -4392,8 +4404,8 @@ delete_doorfiles(void) if (lstat(PidFileName, &sb) == 0 && !S_ISDIR(sb.st_mode)) { if (unlink(PidFileName) < 0) { err = errno; - (void) sprintf(line, "unlink() of %s failed" - " - fatal", PidFileName); + (void) snprintf(line, sizeof (line), + "unlink() of %s failed - fatal", PidFileName); errno = err; logerror(line); DPRINT3(1, "delete_doorfiles(%u): error: %s, " @@ -4409,14 +4421,15 @@ delete_doorfiles(void) if (lstat(OLD_PIDFILE, &sb) == 0 && !S_ISDIR(sb.st_mode)) { if (unlink(OLD_PIDFILE) < 0) { err = errno; - (void) sprintf(line, "unlink() of %s failed", - OLD_PIDFILE); + (void) snprintf(line, sizeof (line), + "unlink() of %s failed", OLD_PIDFILE); DPRINT2(5, "delete_doorfiles(%u): %s, \n", mythreadno, line); if (err != EROFS) { errno = err; - (void) strcat(line, " - fatal"); + (void) strlcat(line, " - fatal", + sizeof (line)); logerror(line); DPRINT3(1, "delete_doorfiles(%u): " "error: %s, errno=%d\n", @@ -4776,28 +4789,26 @@ copy_frwd(char *obuf, const size_t obuflen, } /* - * defaults: - * Read defaults from file. + * properties: + * Get properties from SMF framework. */ static void -defaults(void) +properties(void) { - int flags; - char *ptr; - - if (defopen(DflFile) == 0) { - /* - * ignore case - */ - flags = defcntl(DC_GETFLAGS, 0); - TURNOFF(flags, DC_CASE); - defcntl(DC_SETFLAGS, flags); - - if ((ptr = defread("LOG_FROM_REMOTE=")) != NULL) { - turnoff = strcasecmp(ptr, "NO") == 0; + scf_simple_prop_t *prop; + uint8_t *bool; + + if ((prop = scf_simple_prop_get(NULL, NULL, "config", + "log_from_remote")) != NULL) { + if ((bool = scf_simple_prop_next_boolean(prop)) != NULL) { + if (*bool == 0) + turnoff = 1; /* log_from_remote = false */ + else + turnoff = 0; /* log_from_remote = true */ } - - (void) defopen((char *)NULL); + scf_simple_prop_free(prop); + DPRINT1(1, "properties: setting turnoff to %s\n", + turnoff ? "true" : "false"); } } @@ -4845,7 +4856,8 @@ hostname_lookup(void *ap) (void) dataq_dequeue(&hnlq, (void **)&mp, 0); DPRINT3(5, "hostname_lookup(%u): dequeued msg %p" - " from queue %p\n", mythreadno, mp, &hnlq); + " from queue %p\n", mythreadno, (void *)mp, + (void *)&hnlq); hip = (host_info_t *)mp->ptr; if ((uap = taddr2uaddr(hip->ncp, &hip->addr)) != NULL) { @@ -4871,8 +4883,8 @@ hostname_lookup(void *ap) continue; } - DPRINT3(5, "hostname_lookup(%u): enqueued msg %p on queue %p\n", - mythreadno, mp, &inputq); + DPRINT3(5, "hostname_lookup(%u): enqueued msg %p on queue " + "%p\n", mythreadno, (void *)mp, (void *)&inputq); } /*NOTREACHED*/ @@ -5115,9 +5127,9 @@ reconfigure() f->f_type = F_UNUSED; if (f->f_orig_type == F_FORW) - t_close(f->f_file); + (void) t_close(f->f_file); else - close(f->f_file); + (void) close(f->f_file); } if (Debug) { @@ -5170,9 +5182,9 @@ thread_stuck: shutdown_input(); delete_doorfiles(); - uname(&up); + (void) uname(&up); - (void) sprintf(buf, + (void) snprintf(buf, sizeof (buf), "syslogd(%s): some logger thread(s) " "are stuck%s; syslogd is shutting down.", up.nodename, @@ -5182,8 +5194,8 @@ thread_stuck: FILE *m = popen(MAILCMD, "w"); if (m != NULL) { - fprintf(m, "%s\n", buf); - pclose(m); + (void) fprintf(m, "%s\n", buf); + (void) pclose(m); } } @@ -5261,7 +5273,7 @@ hnc_init(int reinit) } if (reinit) { - pthread_mutex_lock(&hnc_mutex); + (void) pthread_mutex_lock(&hnc_mutex); for (i = 0; i < hnc_size; i++) { for (hpp = &hnc_cache[i]; *hpp != NULL; ) { @@ -5269,7 +5281,7 @@ hnc_init(int reinit) } } - pthread_mutex_unlock(&hnc_mutex); + (void) pthread_mutex_unlock(&hnc_mutex); DPRINT1(2, "hnc_init(%u): hostname cache re-configured\n", mythreadno); } else { @@ -5303,18 +5315,19 @@ hnc_lookup(struct netbuf *nbp, struct netconfig *ncp, int *hindex) return (NULL); } - pthread_mutex_lock(&hnc_mutex); + (void) pthread_mutex_lock(&hnc_mutex); now = time(0); *hindex = index = addr_hash(nbp); for (hpp = &hnc_cache[index]; (hp = *hpp) != NULL; ) { DPRINT4(10, "hnc_lookup(%u): check %p on %p for %s\n", - mythreadno, hp->h, hp, hp->h->hl_hosts[0]); + mythreadno, (void *)hp->h, (void *)hp, + hp->h->hl_hosts[0]); if (hp->expire < now) { DPRINT2(9, "hnc_lookup(%u): purge %p\n", - mythreadno, hp); + mythreadno, (void *)hp); hnc_unreg(hpp); continue; } @@ -5333,21 +5346,22 @@ hnc_lookup(struct netbuf *nbp, struct netconfig *ncp, int *hindex) hnc_cache[index] = hp; } - pthread_mutex_lock(&hp->h->hl_mutex); + (void) pthread_mutex_lock(&hp->h->hl_mutex); hp->h->hl_refcnt++; - pthread_mutex_unlock(&hp->h->hl_mutex); + (void) pthread_mutex_unlock(&hp->h->hl_mutex); DPRINT4(9, "hnc_lookup(%u): found %p on %p for %s\n", - mythreadno, hp->h, hp, hp->h->hl_hosts[0]); + mythreadno, (void *)hp->h, (void *)hp, + hp->h->hl_hosts[0]); - pthread_mutex_unlock(&hnc_mutex); + (void) pthread_mutex_unlock(&hnc_mutex); return (hp->h); } hpp = &hp->next; } - pthread_mutex_unlock(&hnc_mutex); + (void) pthread_mutex_unlock(&hnc_mutex); return (NULL); } @@ -5380,7 +5394,7 @@ hnc_register(struct netbuf *nbp, struct netconfig *ncp, return; } - pthread_mutex_lock(&hnc_mutex); + (void) pthread_mutex_lock(&hnc_mutex); i = 0; @@ -5396,7 +5410,7 @@ hnc_register(struct netbuf *nbp, struct netconfig *ncp, if (hp->expire < now) { DPRINT2(9, "hnc_register(%u): discard %p\n", - mythreadno, hp); + mythreadno, (void *)hp); hnc_unreg(hpp); } else { i++; @@ -5430,8 +5444,8 @@ hnc_register(struct netbuf *nbp, struct netconfig *ncp, */ h->hl_refcnt++; DPRINT4(9, "hnc_register(%u): reg %p onto %p for %s\n", - mythreadno, h, hp, hp->h->hl_hosts[0]); - pthread_mutex_unlock(&hnc_mutex); + mythreadno, (void *)h, (void *)hp, hp->h->hl_hosts[0]); + (void) pthread_mutex_unlock(&hnc_mutex); } static void @@ -5445,7 +5459,7 @@ hnc_unreg(struct hostname_cache **hpp) } DPRINT4(9, "hnc_unreg(%u): unreg %p on %p for %s\n", - mythreadno, hp->h, hp, hp->h->hl_hosts[0]); + mythreadno, (void *)hp->h, (void *)hp, hp->h->hl_hosts[0]); free(hp->addr.buf); freehl(hp->h); @@ -5463,11 +5477,11 @@ hnc_unreg(struct hostname_cache **hpp) static void disable_errorlog() { - dataq_init(&tmpq); + (void) dataq_init(&tmpq); - pthread_mutex_lock(&logerror_lock); + (void) pthread_mutex_lock(&logerror_lock); interrorlog = 0; - pthread_mutex_unlock(&logerror_lock); + (void) pthread_mutex_unlock(&logerror_lock); } /* @@ -5480,9 +5494,9 @@ enable_errorlog() { log_message_t *mp; - pthread_mutex_lock(&logerror_lock); + (void) pthread_mutex_lock(&logerror_lock); interrorlog = 1; - pthread_mutex_unlock(&logerror_lock); + (void) pthread_mutex_unlock(&logerror_lock); /* * push all the pending messages into inputq. @@ -5490,7 +5504,7 @@ enable_errorlog() while (dataq_dequeue(&tmpq, (void **)&mp, 1) == 0) { (void) dataq_enqueue(&inputq, mp); } - dataq_destroy(&tmpq); + (void) dataq_destroy(&tmpq); } /* diff --git a/usr/src/cmd/syslogd/syslogd.dfl b/usr/src/cmd/syslogd/syslogd.dfl index 9c98a4028e..3055a926b7 100644 --- a/usr/src/cmd/syslogd/syslogd.dfl +++ b/usr/src/cmd/syslogd/syslogd.dfl @@ -1,14 +1,10 @@ #ident "%Z%%M% %I% %E% SMI" # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -23,14 +19,19 @@ # # CDDL HEADER END # +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# # /etc/default/syslogd # -# syslogd default settings processed via syslogd(1M). +# Legacy configuration file for syslogd(1M). See syslogd(1M). # -# LOG_FROM_REMOTE affects the logging of remote messages, see syslogd(1M) -# for details. The default value is "YES". A value of "NO" (any case) -# results in disabling of remote logging; any other value is ignored. +# This file should no longer be directly used to configure syslogd. +# These settings are kept here for backwards compatibility only. +# Please use svccfg(1M) to modify the properties of syslogd(1M). # -# Copy and uncomment the following default lines to change the values. +# The LOG_FROM_REMOTE setting used to affect the logging of remote +# messages. Its definition here will override the svccfg(1M) settings +# for log_from_remote. # #LOG_FROM_REMOTE=YES diff --git a/usr/src/cmd/syslogd/syslogd.h b/usr/src/cmd/syslogd/syslogd.h index c3020640e6..5606be1a5d 100644 --- a/usr/src/cmd/syslogd/syslogd.h +++ b/usr/src/cmd/syslogd/syslogd.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * 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 * or http://www.opensolaris.org/os/licensing. @@ -20,9 +19,11 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * + */ + +/* * Copyright 1983,1984,1985,1986,1987,1988,1989 AT&T. * All rights reserved. * @@ -255,7 +256,7 @@ static int ismyaddr(struct netbuf *nbp); static void getnets(void); static int addnet(struct netconfig *ncp, struct netbuf *nbp); static void bindnet(void); -static int logforward(struct filed *f, char *ebuf); +static int logforward(struct filed *f, char *ebuf, size_t elen); static int amiloghost(void); static int same_addr(struct netbuf *, struct netbuf *); static void prepare_sys_poll(void); @@ -290,7 +291,7 @@ static size_t copynl_frwd(char *, const size_t, const char *, const size_t); static size_t copy_frwd(char *, const size_t, const char *, const size_t); static void logerror_format(const char *, char *, va_list); static int logerror_to_console(int, const char *); -static void defaults(void); +static void properties(void); static void shutdown_input(void); static void *hostname_lookup(void *); static void reconfigure(void); diff --git a/usr/src/cmd/syslogd/system-log b/usr/src/cmd/syslogd/system-log index 3290b5d47c..b7608219fc 100644 --- a/usr/src/cmd/syslogd/system-log +++ b/usr/src/cmd/syslogd/system-log @@ -19,34 +19,80 @@ # # CDDL HEADER END # -# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" +OLD_CONF=/etc/default/syslogd + . /lib/svc/share/smf_include.sh -if [ -f /etc/syslog.conf -a -f /usr/sbin/syslogd ]; then - if smf_is_globalzone; then - # - # Before syslogd starts, save any messages from - # previous crash dumps so that messages appear - # in chronological order. - # - /usr/bin/savecore -m - if [ -r /etc/dumpadm.conf ]; then - . /etc/dumpadm.conf - [ -n "$DUMPADM_DEVICE" -a \ - "x$DUMPADM_DEVICE" != xswap ] && \ - /usr/bin/savecore -m -f $DUMPADM_DEVICE +convert() +{ + svccfg -s svc:/system/system-log setprop config/log_from_remote = $1 + if [ $? -ne 0 ]; then + svccfg -s svc:/system/system-log addpg config application + svccfg -s svc:/system/system-log \ + addpropvalue config/log_from_remote boolean: $1 + if [ $? -ne 0 ] ; then + echo 'Failed to set remote syslog-logging' + exit $SMF_EXIT_ERR_CONFIG fi fi - if [ ! -f /var/adm/messages ]; then - /usr/bin/cp /dev/null /var/adm/messages - /usr/bin/chmod 0644 /var/adm/messages - fi - /usr/sbin/syslogd >/dev/msglog 2>&1 & -else + echo "Incorporated ${OLD_CONF} settings into SMF. See syslogd(1m)." + awk '{ + if ($1 ~ /^LOG_FROM_REMOTE=/) { + print "# LOG_FROM_REMOTE is now set using " + "svccfg(1m), see syslog(1m)."; + } else { + print $0; + } + }' ${OLD_CONF} >${OLD_CONF}.new && cp ${OLD_CONF}.new ${OLD_CONF} + rm -f ${OLD_CONF}.new +} + +if [ ! -f /etc/syslog.conf ]; then + echo "/etc/syslog.conf is missing. Exiting." + exit $SMF_EXIT_ERR_CONFIG +fi + +if [ ! -x /usr/sbin/syslogd ]; then + echo "Executable /usr/sbin/syslogd not found. Exiting" exit $SMF_EXIT_ERR_CONFIG fi + +if smf_is_globalzone; then + # + # Before syslogd starts, save any messages from + # previous crash dumps so that messages appear + # in chronological order. + # + /usr/bin/savecore -m + if [ -r /etc/dumpadm.conf ]; then + . /etc/dumpadm.conf + [ -n "$DUMPADM_DEVICE" -a \ + "x$DUMPADM_DEVICE" != xswap ] && \ + /usr/bin/savecore -m -f $DUMPADM_DEVICE + fi +fi +if [ ! -f /var/adm/messages ]; then + /usr/bin/cp /dev/null /var/adm/messages + /usr/bin/chmod 0644 /var/adm/messages +fi +remote=`awk -F= ' + /^LOG_FROM_REMOTE=[yY][Ee][Ss]/ {print "true"} + /^LOG_FROM_REMOTE=[Nn][Oo]/ {print "false"}' < ${OLD_CONF}` +case ${remote} in +"") + ;; +"true"|"false") + convert ${remote} + ;; +*) + echo "Unsupported value in for LOG_FROM_REMOTE in ${OLD_CONF}" + exit $SMF_EXIT_ERR_CONFIG + ;; +esac + +/usr/sbin/syslogd >/dev/msglog 2>&1 & diff --git a/usr/src/cmd/syslogd/system-log.xml b/usr/src/cmd/syslogd/system-log.xml index 2ac7bc8140..f52e5f0f84 100644 --- a/usr/src/cmd/syslogd/system-log.xml +++ b/usr/src/cmd/syslogd/system-log.xml @@ -1,35 +1,34 @@ <?xml version="1.0"?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <!-- - Copyright 2005 Sun Microsystems, Inc. All rights reserved. - Use is subject to license terms. - - CDDL HEADER START - - The contents of this file are subject to the terms of the - Common Development and Distribution License, Version 1.0 only - (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 - or http://www.opensolaris.org/os/licensing. - 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 - - ident "%Z%%M% %I% %E% SMI" - - NOTE: This service manifest is not editable; its contents will - be overwritten by package or patch operations, including - operating system upgrade. Make customizations in a different - file. + 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 + or http://www.opensolaris.org/os/licensing. + 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 + + Copyright 2006 Sun Microsystems, Inc. All rights reserved. + Use is subject to license terms. + + ident "%Z%%M% %I% %E% SMI" + + NOTE: This service manifest is not editable; its contents will + be overwritten by package or patch operations, including + operating system upgrade. Make customizations in a different + file. --> <service_bundle type='manifest' name='SUNWcsr:syslog'> @@ -119,6 +118,24 @@ value='solaris.smf.manage.system-log' /> </property_group> + <property_group name='config' type='application'> + <!-- default property settings for syslogd(1m) --> + + <!-- Specifies whether remote messages are logged. + log_from_remote=false is equivalent to the -t + command-line option. The default value for + log_from_remote is true. + --> + <propval + name='log_from_remote' + type='boolean' + value='true' /> + + <!-- authorization to modify the configuration properties --> + <propval name='value_authorization' type='astring' + value='solaris.smf.value.system-log' /> + </property_group> + <stability value='Unstable' /> <template> diff --git a/usr/src/lib/libsecdb/auth_attr.txt b/usr/src/lib/libsecdb/auth_attr.txt index bad6d4e396..b667fa61dc 100644 --- a/usr/src/lib/libsecdb/auth_attr.txt +++ b/usr/src/lib/libsecdb/auth_attr.txt @@ -1,7 +1,4 @@ # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# # CDDL HEADER START # # The contents of this file are subject to the terms of the @@ -21,6 +18,9 @@ # # CDDL HEADER END # +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# # /etc/security/auth_attr # # authorizations. see auth_attr(4) @@ -84,6 +84,7 @@ solaris.smf.manage.bind:::Manage DNS Service States::help=BindStates.html solaris.smf.manage.cron:::Manage Cron Service States::help=SmfCronStates.html solaris.smf.manage.name-service-cache:::Manage Name Service Cache Daemon Service States::help=SmfNscdStates.html solaris.smf.manage.power:::Manage Power Management Service States::help=SmfPowerStates.html +solaris.smf.manage.rpc.bind:::Manage RPC Program number mapper::help=SmfRPCBind.html solaris.smf.manage.sendmail:::Manage Sendmail Service States::help=SmfSendmailStates.html solaris.smf.manage.ssh:::Manage Secure Shell Service States::help=SmfSshStates.html solaris.smf.manage.system-log:::Manage Syslog Service States::help=SmfSyslogStates.html diff --git a/usr/src/pkgdefs/SUNWcsr/postinstall b/usr/src/pkgdefs/SUNWcsr/postinstall index 87d05581b9..ef1292c200 100644 --- a/usr/src/pkgdefs/SUNWcsr/postinstall +++ b/usr/src/pkgdefs/SUNWcsr/postinstall @@ -18,7 +18,6 @@ # # CDDL HEADER END # -# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -200,4 +199,25 @@ if [ $? -eq 0 ]; then fi _ENABLE_AUDIT +if [ -f $BASEDIR/var/SUNWcsr-apply-limited-net ]; then + PROFILEDIR=$BASEDIR/var/svc/profile + UPGRADEFILE=${PROFILEDIR}/upgrade + ln -sf ./generic_limited_net.xml ${PROFILEDIR}/generic.xml + cat >> ${UPGRADEFILE} <<\_ENABLE_LIMITED_NET +# +# apply the generic_limit_net profile selected at install +# time, and set the accompanying properties since they can't +# be readily set in the profile as of yet. +# +apply_limited_net() +{ + /usr/sbin/netservices limited +} + +# apply_limited_net as last action of this upgrade script +trap apply_limited_net 0 + +_ENABLE_LIMITED_NET + rm -f $BASEDIR/var/SUNWcsr-apply-limited-net +fi exit 0 diff --git a/usr/src/pkgdefs/SUNWcsr/preinstall b/usr/src/pkgdefs/SUNWcsr/preinstall index 9c39f8405c..aae76e6b61 100644 --- a/usr/src/pkgdefs/SUNWcsr/preinstall +++ b/usr/src/pkgdefs/SUNWcsr/preinstall @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,7 @@ # # CDDL HEADER END # -# -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -87,4 +85,14 @@ if [ "x$UPDATE" = xyes ]; then fi +# We apply the limited profile on initial installs of the OS and of +# initial installs of zones. We don't apply it on upgrades or patches. + +if [ "x$PKG_INIT_INSTALL" = "xTRUE" ]; then + touch $BASEDIR/var/SUNWcsr-apply-limited-net +elif [ `/sbin/zonename` = "global" -a "x$SUNW_PKG_INSTALL_ZONENAME" != "x" -a \ + "x$SUNW_PKG_INSTALL_ZONENAME" != "xglobal" ]; then + touch $BASEDIR/var/SUNWcsr-apply-limited-net +fi + exit 0 diff --git a/usr/src/pkgdefs/SUNWcsr/prototype_com b/usr/src/pkgdefs/SUNWcsr/prototype_com index abe3f75780..1b1d0bd2be 100644 --- a/usr/src/pkgdefs/SUNWcsr/prototype_com +++ b/usr/src/pkgdefs/SUNWcsr/prototype_com @@ -508,7 +508,6 @@ f manifest var/svc/manifest/system/svc/restarter.xml 0444 root sys d none var/svc/profile 755 root sys f none var/svc/profile/generic_open.xml 0444 root sys f none var/svc/profile/generic_limited_net.xml 0444 root sys -s none var/svc/profile/generic.xml=./generic_open.xml f none var/svc/profile/inetd_generic.xml 0444 root sys f none var/svc/profile/inetd_upgrade.xml 0444 root sys f none var/svc/profile/ns_files.xml 0444 root sys diff --git a/usr/src/pkgdefs/SUNWcsu/prototype_com b/usr/src/pkgdefs/SUNWcsu/prototype_com index f855a12975..3a7234168f 100644 --- a/usr/src/pkgdefs/SUNWcsu/prototype_com +++ b/usr/src/pkgdefs/SUNWcsu/prototype_com @@ -57,8 +57,8 @@ f none usr/bin/auths 555 root bin f none usr/bin/basename 555 root bin l none usr/bin/bg=../../usr/bin/alias f none usr/bin/busstat 555 root bin -s none usr/bin/cachefsstat=../lib/fs/cachefs/cachefsstat s none usr/bin/cachefspack=../lib/fs/cachefs/cachefspack +s none usr/bin/cachefsstat=../lib/fs/cachefs/cachefsstat f none usr/bin/captoinfo 555 root bin f none usr/bin/cat 555 root bin l none usr/bin/cd=../../usr/bin/alias @@ -150,12 +150,12 @@ l none usr/bin/i486=../../usr/bin/i286 l none usr/bin/i860=../../usr/bin/i286 l none usr/bin/i86pc=../../usr/bin/i286 l none usr/bin/iAPX286=../../usr/bin/i286 -f none usr/bin/isainfo 555 root bin -f none usr/bin/isalist 555 root bin f none usr/bin/iconv 555 root bin f none usr/bin/id 555 root bin f none usr/bin/infocmp 555 root bin f none usr/bin/iostat 555 root bin +f none usr/bin/isainfo 555 root bin +f none usr/bin/isalist 555 root bin l none usr/bin/jobs=../../usr/bin/alias f none usr/bin/join 555 root bin s none usr/bin/jsh=../../sbin/sh @@ -191,6 +191,7 @@ f none usr/bin/mkpwdict 555 root bin f none usr/bin/mktemp 555 root bin f none usr/bin/moe 555 root bin f none usr/bin/more 555 root bin +f none usr/bin/mpstat 555 root bin f none usr/bin/mt 555 root bin l none usr/bin/mv=../../usr/bin/cp f none usr/bin/netstat 555 root bin @@ -207,8 +208,8 @@ f none usr/bin/patch 555 root bin f none usr/bin/pathchk 555 root bin f none usr/bin/pax 555 root bin l none usr/bin/pdp11=../../usr/bin/i286 -f none usr/bin/pfexec 4555 root bin l none usr/bin/pfcsh=../../usr/bin/csh +f none usr/bin/pfexec 4555 root bin l none usr/bin/pfksh=../../usr/bin/ksh s none usr/bin/pfsh=../../sbin/sh f none usr/bin/pg 555 root bin @@ -218,9 +219,9 @@ f none usr/bin/pktool 555 root bin f none usr/bin/pr 555 root bin l none usr/bin/prctl=../../usr/lib/isaexec f none usr/bin/priocntl 555 root bin +f none usr/bin/profiles 555 root bin f none usr/bin/projects 555 root bin l none usr/bin/prstat=../../usr/lib/isaexec -f none usr/bin/profiles 555 root bin l none usr/bin/ps=../../usr/lib/isaexec f none usr/bin/putdev 555 root bin f none usr/bin/putdgrp 555 root bin @@ -252,7 +253,6 @@ f none usr/bin/strconf 555 root root s none usr/bin/strerr=../sbin/strerr f none usr/bin/stty 555 root bin f none usr/bin/su 4555 root sys -l none usr/bin/sun=../../usr/bin/i286 l none usr/bin/sun2=../../usr/bin/i286 l none usr/bin/sun3=../../usr/bin/i286 l none usr/bin/sun3x=../../usr/bin/i286 @@ -261,6 +261,7 @@ l none usr/bin/sun4c=../../usr/bin/i286 l none usr/bin/sun4d=../../usr/bin/i286 l none usr/bin/sun4e=../../usr/bin/i286 l none usr/bin/sun4m=../../usr/bin/i286 +l none usr/bin/sun=../../usr/bin/i286 f none usr/bin/svcprop 0555 root bin f none usr/bin/svcs 0555 root bin s none usr/bin/sync=../../sbin/sync @@ -281,10 +282,10 @@ f none usr/bin/tty 555 root bin l none usr/bin/type=../../usr/bin/alias f none usr/bin/tzselect 555 root bin l none usr/bin/u370=../../usr/bin/i286 -l none usr/bin/u3b=../../usr/bin/i286 l none usr/bin/u3b15=../../usr/bin/i286 l none usr/bin/u3b2=../../usr/bin/i286 l none usr/bin/u3b5=../../usr/bin/i286 +l none usr/bin/u3b=../../usr/bin/i286 l none usr/bin/ulimit=../../usr/bin/alias l none usr/bin/umask=../../usr/bin/alias l none usr/bin/unalias=../../usr/bin/alias @@ -332,52 +333,52 @@ d none usr/lib/class 755 root bin d none usr/lib/class/FX 755 root bin f none usr/lib/class/FX/FXdispadmin 555 root bin f none usr/lib/class/FX/FXpriocntl 555 root bin +d none usr/lib/class/IA 755 root bin +f none usr/lib/class/IA/IAdispadmin 555 root bin +f none usr/lib/class/IA/IApriocntl 555 root bin d none usr/lib/class/RT 755 root bin f none usr/lib/class/RT/RTdispadmin 555 root bin f none usr/lib/class/RT/RTpriocntl 555 root bin d none usr/lib/class/TS 755 root bin f none usr/lib/class/TS/TSdispadmin 555 root bin f none usr/lib/class/TS/TSpriocntl 555 root bin -d none usr/lib/class/IA 755 root bin -f none usr/lib/class/IA/IAdispadmin 555 root bin -f none usr/lib/class/IA/IApriocntl 555 root bin s none usr/lib/cron=../../etc/cron.d d none usr/lib/crypto 755 root bin f none usr/lib/crypto/kcfd 555 root bin d none usr/lib/devfsadm 755 root sys -d none usr/lib/devfsadm/linkmod 755 root sys s none usr/lib/devfsadm/devfsadmd=../../sbin/devfsadm +d none usr/lib/devfsadm/linkmod 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_audio_link.so 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_cfg_link.so 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_disk_link.so 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_fssnap_link.so 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_lofi_link.so 755 root sys +f none usr/lib/devfsadm/linkmod/SUNW_md_link.so 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_misc_link.so 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_port_link.so 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_ramdisk_link.so 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_sgen_link.so 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_tape_link.so 755 root sys f none usr/lib/devfsadm/linkmod/SUNW_usb_link.so 755 root sys -f none usr/lib/devfsadm/linkmod/SUNW_md_link.so 755 root sys f none usr/lib/diffh 555 root bin s none usr/lib/embedded_su=../bin/su f none usr/lib/expreserve 555 root bin f none usr/lib/exrecover 555 root bin d none usr/lib/fs 755 root sys d none usr/lib/fs/cachefs 755 root sys -f none usr/lib/fs/cachefs/cfsadmin 555 root bin -f none usr/lib/fs/cachefs/cachefsstat 555 root bin +f none usr/lib/fs/cachefs/cachefsd 555 root bin f none usr/lib/fs/cachefs/cachefslog 555 root bin +f none usr/lib/fs/cachefs/cachefspack 555 root bin +f none usr/lib/fs/cachefs/cachefsstat 555 root bin f none usr/lib/fs/cachefs/cachefswssize 555 root bin +f none usr/lib/fs/cachefs/cfsadmin 555 root bin f none usr/lib/fs/cachefs/cfsfstype 555 root bin f none usr/lib/fs/cachefs/cfstagchk 555 root bin +f none usr/lib/fs/cachefs/dfshares 555 root bin f none usr/lib/fs/cachefs/fsck 555 root bin f none usr/lib/fs/cachefs/mount 555 root bin -f none usr/lib/fs/cachefs/umount 555 root bin -f none usr/lib/fs/cachefs/cachefspack 555 root bin -f none usr/lib/fs/cachefs/cachefsd 555 root bin -f none usr/lib/fs/cachefs/dfshares 555 root bin f none usr/lib/fs/cachefs/share 555 root bin +f none usr/lib/fs/cachefs/umount 555 root bin f none usr/lib/fs/cachefs/unshare 555 root bin d none usr/lib/fs/ctfs 755 root sys f none usr/lib/fs/ctfs/mount 555 root bin @@ -432,39 +433,37 @@ d none usr/lib/help 755 root bin d none usr/lib/help/auths 755 root bin d none usr/lib/help/auths/locale 755 root bin d none usr/lib/help/auths/locale/C 755 root bin +f none usr/lib/help/auths/locale/C/AllSolAuthsHeader.html 444 root bin f none usr/lib/help/auths/locale/C/AuditConfig.html 444 root bin f none usr/lib/help/auths/locale/C/AuditHeader.html 444 root bin f none usr/lib/help/auths/locale/C/AuditRead.html 444 root bin +f none usr/lib/help/auths/locale/C/AuthJobsAdmin.html 444 root bin +f none usr/lib/help/auths/locale/C/AuthJobsUser.html 444 root bin +f none usr/lib/help/auths/locale/C/AuthProfmgrAssign.html 444 root bin +f none usr/lib/help/auths/locale/C/AuthProfmgrDelegate.html 444 root bin +f none usr/lib/help/auths/locale/C/AuthProfmgrExecattrWrite.html 444 root bin +f none usr/lib/help/auths/locale/C/AuthProfmgrRead.html 444 root bin +f none usr/lib/help/auths/locale/C/AuthProfmgrWrite.html 444 root bin +f none usr/lib/help/auths/locale/C/AuthRoleAssign.html 444 root bin +f none usr/lib/help/auths/locale/C/AuthRoleDelegate.html 444 root bin +f none usr/lib/help/auths/locale/C/AuthRoleWrite.html 444 root bin +f none usr/lib/help/auths/locale/C/BindStates.html 444 root bin f none usr/lib/help/auths/locale/C/DevAllocHeader.html 444 root bin f none usr/lib/help/auths/locale/C/DevAllocate.html 444 root bin f none usr/lib/help/auths/locale/C/DevConfig.html 444 root bin f none usr/lib/help/auths/locale/C/DevGrant.html 444 root bin f none usr/lib/help/auths/locale/C/DevRevoke.html 444 root bin +f none usr/lib/help/auths/locale/C/DhcpmgrHeader.html 444 root bin +f none usr/lib/help/auths/locale/C/DhcpmgrWrite.html 444 root bin f none usr/lib/help/auths/locale/C/JobHeader.html 444 root bin -f none usr/lib/help/auths/locale/C/AuthJobsAdmin.html 444 root bin f none usr/lib/help/auths/locale/C/JobsGrant.html 444 root bin -f none usr/lib/help/auths/locale/C/AuthJobsUser.html 444 root bin f none usr/lib/help/auths/locale/C/LoginEnable.html 444 root bin f none usr/lib/help/auths/locale/C/LoginHeader.html 444 root bin f none usr/lib/help/auths/locale/C/LoginRemote.html 444 root bin +f none usr/lib/help/auths/locale/C/NetworkHeader.html 444 root bin f none usr/lib/help/auths/locale/C/PriAdmin.html 444 root bin -f none usr/lib/help/auths/locale/C/AuthProfmgrAssign.html 444 root bin -f none usr/lib/help/auths/locale/C/AuthProfmgrDelegate.html 444 root bin -f none usr/lib/help/auths/locale/C/AuthProfmgrExecattrWrite.html 444 root bin -f none usr/lib/help/auths/locale/C/AuthProfmgrRead.html 444 root bin f none usr/lib/help/auths/locale/C/ProfmgrHeader.html 444 root bin -f none usr/lib/help/auths/locale/C/AuthProfmgrWrite.html 444 root bin -f none usr/lib/help/auths/locale/C/AuthRoleAssign.html 444 root bin -f none usr/lib/help/auths/locale/C/AuthRoleDelegate.html 444 root bin f none usr/lib/help/auths/locale/C/RoleHeader.html 444 root bin -f none usr/lib/help/auths/locale/C/AuthRoleWrite.html 444 root bin -f none usr/lib/help/auths/locale/C/SysDate.html 444 root bin -f none usr/lib/help/auths/locale/C/SysHeader.html 444 root bin -f none usr/lib/help/auths/locale/C/SysShutdown.html 444 root bin -f none usr/lib/help/auths/locale/C/AllSolAuthsHeader.html 444 root bin -f none usr/lib/help/auths/locale/C/DhcpmgrHeader.html 444 root bin -f none usr/lib/help/auths/locale/C/DhcpmgrWrite.html 444 root bin -f none usr/lib/help/auths/locale/C/BindStates.html 444 root bin f none usr/lib/help/auths/locale/C/SmfAutofsStates.html 444 root bin f none usr/lib/help/auths/locale/C/SmfCronStates.html 444 root bin f none usr/lib/help/auths/locale/C/SmfHeader.html 444 root bin @@ -480,7 +479,9 @@ f none usr/lib/help/auths/locale/C/SmfSendmailStates.html 444 root bin f none usr/lib/help/auths/locale/C/SmfSshStates.html 444 root bin f none usr/lib/help/auths/locale/C/SmfSyslogStates.html 444 root bin f none usr/lib/help/auths/locale/C/SmfValueHeader.html 444 root bin -f none usr/lib/help/auths/locale/C/NetworkHeader.html 444 root bin +f none usr/lib/help/auths/locale/C/SysDate.html 444 root bin +f none usr/lib/help/auths/locale/C/SysHeader.html 444 root bin +f none usr/lib/help/auths/locale/C/SysShutdown.html 444 root bin f none usr/lib/help/auths/locale/C/WifiConfig.html 444 root bin f none usr/lib/help/auths/locale/C/WifiWep.html 444 root bin d none usr/lib/help/profiles 755 root bin @@ -489,15 +490,21 @@ d none usr/lib/help/profiles/locale/C 755 root bin f none usr/lib/help/profiles/locale/C/RtAll.html 444 root bin f none usr/lib/help/profiles/locale/C/RtAuditCtrl.html 444 root bin f none usr/lib/help/profiles/locale/C/RtAuditReview.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtDeviceMngmnt.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtPrntAdmin.html 444 root bin f none usr/lib/help/profiles/locale/C/RtContractObserver.html 444 root bin f none usr/lib/help/profiles/locale/C/RtCronMngmnt.html 444 root bin f none usr/lib/help/profiles/locale/C/RtCryptoMngmnt.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtLogMngmnt.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtDHCPMngmnt.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtDatAdmin.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtDefault.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtDeviceMngmnt.html 444 root bin f none usr/lib/help/profiles/locale/C/RtDeviceSecurity.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtFileSysMngmnt.html 444 root bin f none usr/lib/help/profiles/locale/C/RtFTPMngmnt.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtFileSysMngmnt.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtFileSysSecurity.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtIPFilterMngmnt.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtKerberosClntMngmnt.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtKerberosSrvrMngmnt.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtLogMngmnt.html 444 root bin f none usr/lib/help/profiles/locale/C/RtMailMngmnt.html 444 root bin f none usr/lib/help/profiles/locale/C/RtMaintAndRepair.html 444 root bin f none usr/lib/help/profiles/locale/C/RtMediaBkup.html 444 root bin @@ -509,19 +516,13 @@ f none usr/lib/help/profiles/locale/C/RtNetSecure.html 444 root bin f none usr/lib/help/profiles/locale/C/RtNetWifiMngmnt.html 444 root bin f none usr/lib/help/profiles/locale/C/RtNetWifiSecure.html 444 root bin f none usr/lib/help/profiles/locale/C/RtObAccessMngmnt.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtPrntAdmin.html 444 root bin f none usr/lib/help/profiles/locale/C/RtProcManagement.html 444 root bin f none usr/lib/help/profiles/locale/C/RtRightsDelegate.html 444 root bin f none usr/lib/help/profiles/locale/C/RtSoftwareInstall.html 444 root bin +f none usr/lib/help/profiles/locale/C/RtSysEvMngmnt.html 444 root bin f none usr/lib/help/profiles/locale/C/RtUserMngmnt.html 444 root bin f none usr/lib/help/profiles/locale/C/RtUserSecurity.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtDefault.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtFileSysSecurity.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtDHCPMngmnt.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtSysEvMngmnt.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtKerberosClntMngmnt.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtKerberosSrvrMngmnt.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtIPFilterMngmnt.html 444 root bin -f none usr/lib/help/profiles/locale/C/RtDatAdmin.html 444 root bin f none usr/lib/help/profiles/locale/C/RtZFSFileSysMngmnt.html 444 root bin f none usr/lib/help/profiles/locale/C/RtZFSStorageMngmnt.html 444 root bin f none usr/lib/help/profiles/locale/C/RtZoneMngmnt.html 444 root bin @@ -558,8 +559,8 @@ f none usr/lib/kssladm 555 root bin s none usr/lib/ld.so.1=../../lib/ld.so.1 d none usr/lib/locale 755 root bin d none usr/lib/locale/C 755 root bin -d none usr/lib/locale/C/LC_CTYPE 755 root bin d none usr/lib/locale/C/LC_COLLATE 755 root bin +d none usr/lib/locale/C/LC_CTYPE 755 root bin d none usr/lib/locale/C/LC_MESSAGES 755 root bin d none usr/lib/locale/C/LC_MONETARY 755 root bin d none usr/lib/locale/C/LC_NUMERIC 755 root bin @@ -567,11 +568,11 @@ d none usr/lib/locale/C/LC_TIME 755 root bin f none usr/lib/locale/C/locale_description 444 root bin s none usr/lib/locale/POSIX=./C d none usr/lib/localedef 755 root bin -d none usr/lib/localedef/src 755 root bin -f none usr/lib/makekey 555 root bin d none usr/lib/localedef/extensions 755 root bin f none usr/lib/localedef/extensions/generic_eucbc.x 444 root bin f none usr/lib/localedef/extensions/single_byte.x 444 root bin +d none usr/lib/localedef/src 755 root bin +f none usr/lib/makekey 555 root bin f none usr/lib/more.help 644 root bin d none usr/lib/netsvc 755 root sys f none usr/lib/newsyslog 555 root sys @@ -583,14 +584,14 @@ f none usr/lib/platexec 555 root bin f none usr/lib/pt_chmod 4511 root bin d none usr/lib/rcm 755 root bin d none usr/lib/rcm/modules 755 root bin -f none usr/lib/rcm/modules/SUNW_filesys_rcm.so 555 root bin +f none usr/lib/rcm/modules/SUNW_cluster_rcm.so 555 root bin f none usr/lib/rcm/modules/SUNW_dump_rcm.so 555 root bin +f none usr/lib/rcm/modules/SUNW_filesys_rcm.so 555 root bin +f none usr/lib/rcm/modules/SUNW_ip_anon_rcm.so 555 root bin f none usr/lib/rcm/modules/SUNW_ip_rcm.so 555 root bin +f none usr/lib/rcm/modules/SUNW_mpxio_rcm.so 555 root bin f none usr/lib/rcm/modules/SUNW_network_rcm.so 555 root bin f none usr/lib/rcm/modules/SUNW_swap_rcm.so 555 root bin -f none usr/lib/rcm/modules/SUNW_cluster_rcm.so 555 root bin -f none usr/lib/rcm/modules/SUNW_ip_anon_rcm.so 555 root bin -f none usr/lib/rcm/modules/SUNW_mpxio_rcm.so 555 root bin f none usr/lib/rcm/rcm_daemon 555 root bin d none usr/lib/rcm/scripts 755 root bin s none usr/lib/rsh=../../sbin/sh @@ -599,24 +600,24 @@ f none usr/lib/saf/listen 755 root sys f none usr/lib/saf/nlps_server 755 root sys f none usr/lib/saf/sac 555 root sys f none usr/lib/saf/ttymon 555 root sys -d none usr/lib/security 755 root bin d none usr/lib/secure 755 root bin s none usr/lib/secure/32=. +d none usr/lib/security 755 root bin d none usr/lib/sysevent 755 root bin d none usr/lib/sysevent/modules 755 root bin -f none usr/lib/sysevent/syseventd 555 root bin -f none usr/lib/sysevent/syseventconfd 555 root bin f none usr/lib/sysevent/modules/devfsadmd_mod.so 755 root bin f none usr/lib/sysevent/modules/sysevent_conf_mod.so 755 root bin f none usr/lib/sysevent/modules/sysevent_reg_mod.so 755 root bin -d none usr/lib/term 755 root bin +f none usr/lib/sysevent/syseventconfd 555 root bin +f none usr/lib/sysevent/syseventd 555 root bin f none usr/lib/t300 555 root bin f none usr/lib/t300s 555 root bin f none usr/lib/t4014 555 root bin f none usr/lib/t450 555 root bin -f none usr/lib/vplot 555 root bin +d none usr/lib/term 755 root bin f none usr/lib/utmp_update 4555 root bin f none usr/lib/utmpd 555 root bin +f none usr/lib/vplot 555 root bin s none usr/mail=../var/mail d none usr/net 755 root sys d none usr/net/nls 755 root sys @@ -667,14 +668,14 @@ d none usr/sadm/install 755 root bin f none usr/sadm/install/miniroot.db 444 root sys d none usr/sadm/install/scripts 755 root bin f none usr/sadm/install/scripts/i.ipsecalgs 555 root sys -f none usr/sadm/install/scripts/r.ipsecalgs 555 root sys f none usr/sadm/install/scripts/i.kcfconf 555 root sys -f none usr/sadm/install/scripts/r.kcfconf 555 root sys f none usr/sadm/install/scripts/i.manifest 555 root sys -f none usr/sadm/install/scripts/r.manifest 555 root sys f none usr/sadm/install/scripts/i.pkcs11conf 555 root sys -f none usr/sadm/install/scripts/r.pkcs11conf 555 root sys f none usr/sadm/install/scripts/i.rbac 555 root sys +f none usr/sadm/install/scripts/r.ipsecalgs 555 root sys +f none usr/sadm/install/scripts/r.kcfconf 555 root sys +f none usr/sadm/install/scripts/r.manifest 555 root sys +f none usr/sadm/install/scripts/r.pkcs11conf 555 root sys f none usr/sadm/install/scripts/r.rbac 555 root sys d none usr/sadm/sysadm 755 root bin d none usr/sadm/sysadm/add-ons 755 root bin @@ -692,36 +693,24 @@ f none usr/sbin/auditconfig 555 root bin f none usr/sbin/auditd 555 root bin f none usr/sbin/auditreduce 555 root bin f none usr/sbin/auditstat 555 root bin -f none usr/sbin/cfgadm 555 root bin -s none usr/sbin/cfsadmin=../lib/fs/cachefs/cfsadmin -s none usr/sbin/cachefslog=../lib/fs/cachefs/cachefslog -s none usr/sbin/cachefswssize=../lib/fs/cachefs/cachefswssize -f none usr/sbin/clear_locks 555 root bin -f none usr/sbin/cryptoadm 555 root bin -l none usr/sbin/deallocate=../../usr/sbin/allocate -f none usr/sbin/dminfo 555 root bin -s none usr/sbin/fdisk=../../sbin/fdisk -f none usr/sbin/ikeadm 555 root bin -f none usr/sbin/ikecert 555 root bin -f none usr/sbin/ipaddrsel 555 root bin -f none usr/sbin/ipsecalgs 555 root bin -f none usr/sbin/ipsecconf 555 root bin -f none usr/sbin/ipseckey 555 root bin -l none usr/sbin/list_devices=../../usr/sbin/allocate -f none usr/sbin/mkdevalloc 555 root bin -l none usr/sbin/mkdevmaps=../../usr/sbin/mkdevalloc -f none usr/sbin/praudit 555 root bin l none usr/sbin/audlinks=./devfsadm s none usr/sbin/autopush=../../sbin/autopush -f none usr/sbin/bsmrecord 555 root bin s none usr/sbin/bootadm=../../sbin/bootadm +f none usr/sbin/bsmrecord 555 root bin +s none usr/sbin/cachefslog=../lib/fs/cachefs/cachefslog +s none usr/sbin/cachefswssize=../lib/fs/cachefs/cachefswssize +f none usr/sbin/cfgadm 555 root bin +s none usr/sbin/cfsadmin=../lib/fs/cachefs/cfsadmin f none usr/sbin/chroot 555 root bin +f none usr/sbin/clear_locks 555 root bin f none usr/sbin/clinfo 555 root bin f none usr/sbin/clri 555 root bin f none usr/sbin/consadm 555 root sys l none usr/sbin/consadmd=../../usr/sbin/consadm f none usr/sbin/cron 555 root sys +f none usr/sbin/cryptoadm 555 root bin s none usr/sbin/dcopy=./clri +l none usr/sbin/deallocate=../../usr/sbin/allocate f none usr/sbin/devfsadm 755 root sys f none usr/sbin/devinfo 555 root bin l none usr/sbin/devlinks=./devfsadm @@ -732,10 +721,12 @@ l none usr/sbin/dfshares=../../usr/sbin/dfmounts l none usr/sbin/disks=./devfsadm f none usr/sbin/dispadmin 555 root bin s none usr/sbin/dladm=../../sbin/dladm +f none usr/sbin/dminfo 555 root bin l none usr/sbin/drvconfig=./devfsadm f none usr/sbin/dumpadm 555 root bin s none usr/sbin/edquota=../lib/fs/ufs/edquota l none usr/sbin/eeprom=../../usr/lib/platexec +s none usr/sbin/fdisk=../../sbin/fdisk f none usr/sbin/ff 555 root bin f none usr/sbin/fmthard 555 root sys f none usr/sbin/format 555 root bin @@ -753,23 +744,33 @@ f none usr/sbin/groupmod 555 root sys f none usr/sbin/grpck 555 root bin f none usr/sbin/halt 755 root bin s none usr/sbin/hostconfig=../../sbin/hostconfig -s none usr/sbin/ifconfig=../../sbin/ifconfig f none usr/sbin/if_mpadm 555 root bin +s none usr/sbin/ifconfig=../../sbin/ifconfig +f none usr/sbin/ikeadm 555 root bin +f none usr/sbin/ikecert 555 root bin f none usr/sbin/inetadm 555 root bin f none usr/sbin/inetconv 555 root bin s none usr/sbin/inetd=../lib/inet/inetd s none usr/sbin/init=../../sbin/init f none usr/sbin/install 555 root bin +f none usr/sbin/installboot 555 root sys +f none usr/sbin/ipaddrsel 555 root bin +f none usr/sbin/ipsecalgs 555 root bin +f none usr/sbin/ipsecconf 555 root bin +f none usr/sbin/ipseckey 555 root bin f none usr/sbin/keyserv 555 root sys f none usr/sbin/killall 555 root bin f none usr/sbin/ksslcfg 555 root bin s none usr/sbin/labelit=./clri f none usr/sbin/link 555 root bin -s none usr/sbin/lockfs=../lib/fs/ufs/lockfs +l none usr/sbin/list_devices=../../usr/sbin/allocate f none usr/sbin/locator 555 root bin +s none usr/sbin/lockfs=../lib/fs/ufs/lockfs f none usr/sbin/lofiadm 555 root bin f none usr/sbin/logadm 555 root bin f none usr/sbin/makedbm 555 root bin +f none usr/sbin/mkdevalloc 555 root bin +l none usr/sbin/mkdevmaps=../../usr/sbin/mkdevalloc f none usr/sbin/mkfile 555 root bin s none usr/sbin/mkfs=./clri f none usr/sbin/mknod 555 root bin @@ -778,22 +779,23 @@ l none usr/sbin/modload=../../usr/lib/isaexec l none usr/sbin/modunload=../../usr/lib/isaexec s none usr/sbin/mount=../../sbin/mount f none usr/sbin/mountall 555 root sys -f none usr/bin/mpstat 555 root bin f none usr/sbin/msgid 555 root bin f none usr/sbin/mvdir 555 root bin s none usr/sbin/ncheck=./ff f none usr/sbin/ndd 555 root bin +f none usr/sbin/netservices 0555 root sys s none usr/sbin/newfs=../lib/fs/ufs/newfs f none usr/sbin/nlsadmin 755 root adm f none usr/sbin/nscd 555 root bin f none usr/sbin/passmgmt 555 root sys +l none usr/sbin/pbind=../../usr/lib/isaexec f none usr/sbin/pmadm 555 root sys l none usr/sbin/ports=./devfsadm l none usr/sbin/poweroff=./halt +f none usr/sbin/praudit 555 root bin l none usr/sbin/prtconf=../../usr/lib/isaexec -f none usr/sbin/prtvtoc 555 root sys -l none usr/sbin/pbind=../../usr/lib/isaexec l none usr/sbin/prtdiag=../../usr/lib/platexec +f none usr/sbin/prtvtoc 555 root sys f none usr/sbin/psradm 555 root sys f none usr/sbin/psrinfo 555 root sys l none usr/sbin/psrset=../../usr/lib/isaexec @@ -878,16 +880,16 @@ f none usr/share/lib/tabset/wyse-adds 644 root bin f none usr/share/lib/tabset/xerox1720 644 root bin f none usr/share/lib/termcap 644 root bin d none usr/share/lib/terminfo 755 root bin -d none usr/share/lib/terminfo/A 755 root bin -l none usr/share/lib/terminfo/A/AT386-M=../../../../../usr/share/lib/terminfo/a/at386-m -l none usr/share/lib/terminfo/A/AT386=../../../../../usr/share/lib/terminfo/a/at386 -f none usr/share/lib/terminfo/A/AT386-DOS-M 644 root bin -f none usr/share/lib/terminfo/A/AT386-DOS 644 root bin d none usr/share/lib/terminfo/3 755 root bin l none usr/share/lib/terminfo/3/386AT-M=../../../../../usr/share/lib/terminfo/a/at386-m -l none usr/share/lib/terminfo/3/386at-m=../../../../../usr/share/lib/terminfo/a/at386-m l none usr/share/lib/terminfo/3/386AT=../../../../../usr/share/lib/terminfo/a/at386 +l none usr/share/lib/terminfo/3/386at-m=../../../../../usr/share/lib/terminfo/a/at386-m l none usr/share/lib/terminfo/3/386at=../../../../../usr/share/lib/terminfo/a/at386 +d none usr/share/lib/terminfo/A 755 root bin +f none usr/share/lib/terminfo/A/AT386-DOS 644 root bin +f none usr/share/lib/terminfo/A/AT386-DOS-M 644 root bin +l none usr/share/lib/terminfo/A/AT386-M=../../../../../usr/share/lib/terminfo/a/at386-m +l none usr/share/lib/terminfo/A/AT386=../../../../../usr/share/lib/terminfo/a/at386 d none usr/share/lib/terminfo/a 755 root bin f none usr/share/lib/terminfo/a/ansi 644 root bin f none usr/share/lib/terminfo/a/ansi+arrows 644 root bin @@ -908,8 +910,8 @@ f none usr/share/lib/terminfo/a/ansi+sgrdim 644 root bin f none usr/share/lib/terminfo/a/ansi+sgrso 644 root bin f none usr/share/lib/terminfo/a/ansi+sgrul 644 root bin f none usr/share/lib/terminfo/a/ansi+tabs 644 root bin -f none usr/share/lib/terminfo/a/at386-m 644 root bin f none usr/share/lib/terminfo/a/at386 644 root bin +f none usr/share/lib/terminfo/a/at386-m 644 root bin d none usr/share/lib/terminfo/s 755 root bin f none usr/share/lib/terminfo/s/sun 644 root bin f none usr/share/lib/terminfo/s/sun-1 644 root bin @@ -1423,12 +1425,12 @@ l none usr/share/lib/zoneinfo/Europe/Zagreb=../../../../../usr/share/lib/zoneinf f none usr/share/lib/zoneinfo/Europe/Zaporozhye 644 root bin f none usr/share/lib/zoneinfo/Europe/Zurich 644 root bin f none usr/share/lib/zoneinfo/Factory 644 root bin -l none usr/share/lib/zoneinfo/GB=../../../../usr/share/lib/zoneinfo/Europe/London l none usr/share/lib/zoneinfo/GB-Eire=../../../../usr/share/lib/zoneinfo/Europe/London -l none usr/share/lib/zoneinfo/GMT=../../../../usr/share/lib/zoneinfo/Etc/GMT +l none usr/share/lib/zoneinfo/GB=../../../../usr/share/lib/zoneinfo/Europe/London l none usr/share/lib/zoneinfo/GMT+0=../../../../usr/share/lib/zoneinfo/Etc/GMT l none usr/share/lib/zoneinfo/GMT-0=../../../../usr/share/lib/zoneinfo/Etc/GMT l none usr/share/lib/zoneinfo/GMT0=../../../../usr/share/lib/zoneinfo/Etc/GMT +l none usr/share/lib/zoneinfo/GMT=../../../../usr/share/lib/zoneinfo/Etc/GMT l none usr/share/lib/zoneinfo/Greenwich=../../../../usr/share/lib/zoneinfo/Etc/GMT f none usr/share/lib/zoneinfo/HST 644 root bin l none usr/share/lib/zoneinfo/Hongkong=../../../../usr/share/lib/zoneinfo/Asia/Hong_Kong @@ -1462,8 +1464,8 @@ d none usr/share/lib/zoneinfo/Mideast 755 root bin l none usr/share/lib/zoneinfo/Mideast/Riyadh87=../../../../../usr/share/lib/zoneinfo/Asia/Riyadh87 l none usr/share/lib/zoneinfo/Mideast/Riyadh88=../../../../../usr/share/lib/zoneinfo/Asia/Riyadh88 l none usr/share/lib/zoneinfo/Mideast/Riyadh89=../../../../../usr/share/lib/zoneinfo/Asia/Riyadh89 -l none usr/share/lib/zoneinfo/NZ=../../../../usr/share/lib/zoneinfo/Pacific/Auckland l none usr/share/lib/zoneinfo/NZ-CHAT=../../../../usr/share/lib/zoneinfo/Pacific/Chatham +l none usr/share/lib/zoneinfo/NZ=../../../../usr/share/lib/zoneinfo/Pacific/Auckland l none usr/share/lib/zoneinfo/Navajo=../../../../usr/share/lib/zoneinfo/America/Denver l none usr/share/lib/zoneinfo/PRC=../../../../usr/share/lib/zoneinfo/Asia/Shanghai f none usr/share/lib/zoneinfo/PST8PDT 644 root bin @@ -1525,8 +1527,8 @@ l none usr/share/lib/zoneinfo/US/Hawaii=../../../../../usr/share/lib/zoneinfo/Pa l none usr/share/lib/zoneinfo/US/Indiana-Starke=../../../../../usr/share/lib/zoneinfo/America/Indiana/Knox l none usr/share/lib/zoneinfo/US/Michigan=../../../../../usr/share/lib/zoneinfo/America/Detroit l none usr/share/lib/zoneinfo/US/Mountain=../../../../../usr/share/lib/zoneinfo/America/Denver -l none usr/share/lib/zoneinfo/US/Pacific=../../../../../usr/share/lib/zoneinfo/America/Los_Angeles l none usr/share/lib/zoneinfo/US/Pacific-New=../../../../../usr/share/lib/zoneinfo/America/Los_Angeles +l none usr/share/lib/zoneinfo/US/Pacific=../../../../../usr/share/lib/zoneinfo/America/Los_Angeles l none usr/share/lib/zoneinfo/US/Samoa=../../../../../usr/share/lib/zoneinfo/Pacific/Pago_Pago l none usr/share/lib/zoneinfo/UTC=../../../../usr/share/lib/zoneinfo/Etc/UTC l none usr/share/lib/zoneinfo/Universal=../../../../usr/share/lib/zoneinfo/Etc/UTC @@ -1551,14 +1553,13 @@ f none usr/share/lib/zoneinfo/src/solar89 644 root bin f none usr/share/lib/zoneinfo/src/southamerica 644 root bin f none usr/share/lib/zoneinfo/src/systemv 644 root bin d none usr/share/lib/zoneinfo/tab 755 root bin -f none usr/share/lib/zoneinfo/tab/zone_sun.tab 644 root bin -f none usr/share/lib/zoneinfo/tab/country.tab 644 root bin f none usr/share/lib/zoneinfo/tab/continent.tab 644 root bin +f none usr/share/lib/zoneinfo/tab/country.tab 644 root bin +f none usr/share/lib/zoneinfo/tab/zone_sun.tab 644 root bin d none usr/share/src 755 root sys s none usr/spool=../var/spool s none usr/src=./share/src s none usr/tmp=../var/tmp -f none usr/sbin/installboot 555 root sys d none usr/xpg4 755 root bin d none usr/xpg4/bin 755 root bin f none usr/xpg4/bin/sh 555 root bin diff --git a/usr/src/pkgdefs/SUNWsacom/Makefile b/usr/src/pkgdefs/SUNWsacom/Makefile index 59e40a0f91..bf7bccc628 100644 --- a/usr/src/pkgdefs/SUNWsacom/Makefile +++ b/usr/src/pkgdefs/SUNWsacom/Makefile @@ -28,7 +28,7 @@ include ../Makefile.com -DATAFILES += depend i.initd i.preserve +DATAFILES += depend i.initd i.preserve i.manifest r.manifest CHKINSTALLSRC=checkinstall.initd ACTION_all=grep SUNWter depend > /dev/null || \ diff --git a/usr/src/pkgdefs/SUNWsacom/pkginfo.tmpl b/usr/src/pkgdefs/SUNWsacom/pkginfo.tmpl index 3f1ab746b7..ea9a42ab36 100644 --- a/usr/src/pkgdefs/SUNWsacom/pkginfo.tmpl +++ b/usr/src/pkgdefs/SUNWsacom/pkginfo.tmpl @@ -35,7 +35,7 @@ ARCH="ISA" BASEDIR=/ SUNW_PKGVERS="1.0" CATEGORY="system" -CLASSES="none initd preserve" +CLASSES="none initd preserve manifest" DESC="Solstice Enterprise Agents 1.0.3 files for root file system" MAXINST="1000" NAME="Solstice Enterprise Agents 1.0.3 files for root file system" diff --git a/usr/src/pkgdefs/SUNWsacom/postinstall b/usr/src/pkgdefs/SUNWsacom/postinstall index 8795e25e3f..3ff7df6242 100644 --- a/usr/src/pkgdefs/SUNWsacom/postinstall +++ b/usr/src/pkgdefs/SUNWsacom/postinstall @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -19,11 +18,10 @@ # # CDDL HEADER END # -# -# Copyright 1996-1997, 2001-2002 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" +# ident "%Z%%M% %I% %E% SMI" # # pkgdefs/SUNWsacom/postinstall @@ -78,4 +76,15 @@ SNMPEOF installf -f $PKGINST +# +# check if snmpdx should be enabled (snmpdx.tmp was set in preinstall) +if [ -f $BASEDIR/var/snmpdx.tmp ]; then + cat >> $BASEDIR/var/svc/profile/upgrade <<\_SNMPDX +if [ `/sbin/zonename` = global ]; then + /usr/sbin/svcadm enable svc:/application/management/snmpdx:default +fi +_SNMPDX + rm -f $BASEDIR/var/snmpdx.tmp +fi + exit 0 diff --git a/usr/src/pkgdefs/SUNWsacom/preinstall b/usr/src/pkgdefs/SUNWsacom/preinstall index 675d737292..3cad82d887 100644 --- a/usr/src/pkgdefs/SUNWsacom/preinstall +++ b/usr/src/pkgdefs/SUNWsacom/preinstall @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -19,8 +18,10 @@ # # CDDL HEADER END # -# Copyright %G% Sun Microsystems, Inc. All Rights Reserved. -#pragma ident "%Z%%M% %I% %E% SMI" +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" # SUNWsacom preinstall @@ -114,5 +115,16 @@ if [ -f $BASEDIR/etc/opt/SUNWconn/SSA/dmi/conf/dmispd.conf ] ; then rc=$? fi +rm -f $BASEDIR/var/snmpdx.tmp > /dev/null 2>&1 + +# +# make sure the enabled/disabled state is maintained over upgrades +# On initial installs, the SMF profile takes care of enabling snmpdx. +# +if [ "$UPDATE" = yes ]; then + if [ -f $BASEDIR/etc/rc3.d/S76snmpdx ]; then + touch $BASEDIR/var/snmpdx.tmp + fi +fi exit $rc diff --git a/usr/src/pkgdefs/SUNWsacom/prototype_com b/usr/src/pkgdefs/SUNWsacom/prototype_com index 30a3b92c02..c0d8fbb48a 100644 --- a/usr/src/pkgdefs/SUNWsacom/prototype_com +++ b/usr/src/pkgdefs/SUNWsacom/prototype_com @@ -48,14 +48,12 @@ i postinstall i space i i.initd i i.preserve +i i.manifest +i r.manifest # d none etc 0755 root sys d none etc/init.d 0755 root sys -d none etc/rc0.d 0755 root sys -d none etc/rcS.d 0755 root sys -d none etc/rc1.d 0755 root sys -d none etc/rc2.d 0755 root sys -d none etc/rc3.d 0755 root sys +f initd etc/init.d/init.snmpdx 744 root sys # d none etc/snmp 0755 root sys d none etc/snmp/conf 0755 root sys @@ -64,12 +62,16 @@ d none var 0755 root sys d none var/snmp 0755 root sys d none var/snmp/mib 0755 root sys # -e initd etc/init.d/init.snmpdx 744 root sys -l initd etc/rc3.d/S76snmpdx=../../etc/init.d/init.snmpdx -l initd etc/rc2.d/K07snmpdx=../../etc/init.d/init.snmpdx -l initd etc/rc1.d/K07snmpdx=../../etc/init.d/init.snmpdx -l initd etc/rcS.d/K07snmpdx=../../etc/init.d/init.snmpdx -l initd etc/rc0.d/K07snmpdx=../../etc/init.d/init.snmpdx +d none var/svc 0755 root sys +d none var/svc/manifest 0755 root sys +d none var/svc/manifest/application 0755 root sys +d none var/svc/manifest/application/management 0755 root sys +f manifest var/svc/manifest/application/management/snmpdx.xml 0444 root sys +# +d none lib 0755 root bin +d none lib/svc 0755 root bin +d none lib/svc/method 0755 root bin +f none lib/svc/method/svc-snmpdx 0555 root bin # e preserve etc/snmp/conf/snmpdx.rsrc 644 root sys v none etc/snmp/conf/snmpdx.reg 644 root sys diff --git a/usr/src/pkgdefs/SUNWsndmr/prototype_com b/usr/src/pkgdefs/SUNWsndmr/prototype_com index a5496b03f5..35ff902eb3 100644 --- a/usr/src/pkgdefs/SUNWsndmr/prototype_com +++ b/usr/src/pkgdefs/SUNWsndmr/prototype_com @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# 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 # or http://www.opensolaris.org/os/licensing. @@ -20,7 +19,7 @@ # CDDL HEADER END # # -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. +# Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -63,6 +62,8 @@ d none etc/mail/cf 755 root mail f none etc/mail/cf/README 444 root mail d none etc/mail/cf/cf 755 root mail f none etc/mail/cf/cf/Makefile 444 root mail +f none etc/mail/cf/cf/local.cf 444 root mail +f none etc/mail/cf/cf/local.mc 444 root mail s none etc/mail/cf/cf/main.cf=sendmail.cf s none etc/mail/cf/cf/main.mc=sendmail.mc f none etc/mail/cf/cf/sendmail.cf 444 root mail @@ -149,6 +150,7 @@ f none etc/mail/cf/sh/makeinfo.sh 444 root mail s none etc/mail/cf/sh/check-hostname=../../../../usr/sbin/check-hostname s none etc/mail/cf/sh/check-permissions=../../../../usr/sbin/check-permissions f none etc/mail/helpfile 644 root bin +e renameold etc/mail/local.cf 444 root bin e sendmail etc/mail/local-host-names 644 root bin s none etc/mail/main.cf=sendmail.cf e renameold etc/mail/sendmail.cf 444 root bin |