20918093 postfix manifests & start method need tweaks
authorJohn Beck <John.Beck@Oracle.COM>
Mon, 20 Apr 2015 20:27:50 -0700
changeset 4153 cac8dc6507e3
parent 4152 b514ec655325
child 4154 d083b59c9f51
20918093 postfix manifests & start method need tweaks
components/postfix/files/postfix.xml
components/postfix/files/start-method
components/postfix/postfix.p5m
--- a/components/postfix/files/postfix.xml	Mon Apr 20 14:56:11 2015 -0700
+++ b/components/postfix/files/postfix.xml	Mon Apr 20 20:27:50 2015 -0700
@@ -1,8 +1,26 @@
 <?xml version="1.0"?>
 <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
 <!--
+    CDDL HEADER START
    
-    Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+    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 (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
 
     NOTE:  This service manifest is not editable; its contents will
     be overwritten by package or patch operations, including
@@ -118,7 +136,7 @@
 			timeout_seconds='120'>
 			<method_context>
 			    <method_credential user='root' group='postfix'
-				privileges='basic,net_privaddr,proc_setid,file_dac_search'/>
+				privileges='basic,net_privaddr,proc_setid,file_dac_read,file_dac_search'/>
 			</method_context>
 		</exec_method>
 
--- a/components/postfix/files/start-method	Mon Apr 20 14:56:11 2015 -0700
+++ b/components/postfix/files/start-method	Mon Apr 20 20:27:50 2015 -0700
@@ -27,7 +27,7 @@
 
 tweak_aliases()
 {
-	aliasprop=$(/usr/bin/svcprop -p config/aliases $SWITCH_FMRI 2>/dev/null)
+	aliasprop=$(/usr/bin/svcprop -p config/alias $SWITCH_FMRI 2>/dev/null)
 
 	# Check the alias configuration. Per
 	# http://www.postfix.org/postconf.5.html
@@ -39,7 +39,7 @@
 	alias_maps=$(/usr/sbin/postconf -h alias_maps)
 	if [[ $alias_maps == "hash:/etc/mail/aliases, nis:mail.aliases" ]]; then
 		# We have the default Postfix setting.
-		if [[ "$aliasprop" == "${aliasprop%nis}" ]]; then
+		if [[ "$aliasprop" == "${aliasprop/nis}" ]]; then
 			# NIS is not configured, so change the Postfix setting.
 			alias_maps="hash:/etc/mail/aliases"
 			/usr/sbin/postconf alias_maps=$alias_maps
@@ -49,7 +49,7 @@
 	# Check for LDAP: if configured via the switch, then (if needed)
 	# create $LDAP_ALIASES and configure in alias_maps.
 	LDAP_ALIASES=/etc/postfix/ldap-aliases.cf
-	if [[ $aliasprop != ${aliasprop%ldap} ]]; then
+	if [[ $aliasprop != ${aliasprop/ldap} ]]; then
 		# LDAP is configured for aliases.
 		if [[ ! -f $LDAP_ALIASES ]]; then
 			# $LDAP_ALIASES does not exist yet, so create it.
@@ -65,7 +65,7 @@
 			    $LDAP_ALIASES
 
 		fi
-		if [[ "$alias_maps" == "${alias_maps%ldap:}" ]]; then
+		if [[ "$alias_maps" == "${alias_maps/ldap:}" ]]; then
 			# No "ldap:" entry yet in alias_maps, so add one.
 			/usr/sbin/postconf \
 			    alias_maps="$alias_maps, ldap:$LDAP_ALIASES"
--- a/components/postfix/postfix.p5m	Mon Apr 20 14:56:11 2015 -0700
+++ b/components/postfix/postfix.p5m	Mon Apr 20 20:27:50 2015 -0700
@@ -43,19 +43,19 @@
 #
 file path=etc/postfix/LICENSE
 file path=etc/postfix/TLS_LICENSE
-file path=etc/postfix/access
-file path=etc/postfix/aliases
+file path=etc/postfix/access mode=0644 preserve=true
+file path=etc/postfix/aliases mode=0644 preserve=true
 file path=etc/postfix/bounce.cf.default
-file path=etc/postfix/canonical
-file path=etc/postfix/generic
-file path=etc/postfix/header_checks
-file path=etc/postfix/main.cf
+file path=etc/postfix/canonical mode=0644 preserve=true
+file path=etc/postfix/generic mode=0644 preserve=true
+file path=etc/postfix/header_checks mode=0644 preserve=true
+file path=etc/postfix/main.cf mode=0644 preserve=true
 file path=etc/postfix/main.cf.default
 file path=etc/postfix/makedefs.out
-file path=etc/postfix/master.cf
-file path=etc/postfix/relocated
-file path=etc/postfix/transport
-file path=etc/postfix/virtual
+file path=etc/postfix/master.cf mode=0644 preserve=true
+file path=etc/postfix/relocated mode=0644 preserve=true
+file path=etc/postfix/transport mode=0644 preserve=true
+file path=etc/postfix/virtual mode=0644 preserve=true
 file postfix.auth_attr path=etc/security/auth_attr.d/postfix group=sys
 file postfix.exec_attr path=etc/security/exec_attr.d/postfix group=sys
 file postfix.prof_attr path=etc/security/prof_attr.d/postfix group=sys