[PC-BSD Commits] r20142 - in pcbsd/current/src-sh/pc-adctl: bin rc scripts

svn at pcbsd.org svn at pcbsd.org
Wed Nov 7 15:44:01 PST 2012


Author: johnh
Date: 2012-11-07 23:44:01 +0000 (Wed, 07 Nov 2012)
New Revision: 20142

Modified:
   pcbsd/current/src-sh/pc-adctl/bin/pc-adctl
   pcbsd/current/src-sh/pc-adctl/bin/pc-ldapctl
   pcbsd/current/src-sh/pc-adctl/rc/rc.activedirectory
   pcbsd/current/src-sh/pc-adctl/rc/rc.ldap
   pcbsd/current/src-sh/pc-adctl/scripts/pc-activedirectory
   pcbsd/current/src-sh/pc-adctl/scripts/pc-directory
   pcbsd/current/src-sh/pc-adctl/scripts/pc-kerberos
   pcbsd/current/src-sh/pc-adctl/scripts/pc-kinit
   pcbsd/current/src-sh/pc-adctl/scripts/pc-ldap
   pcbsd/current/src-sh/pc-adctl/scripts/pc-nssldap
   pcbsd/current/src-sh/pc-adctl/scripts/pc-nsswitch
   pcbsd/current/src-sh/pc-adctl/scripts/pc-pam
   pcbsd/current/src-sh/pc-adctl/scripts/pc-samba
Log:
By golly I think I've got it.



Modified: pcbsd/current/src-sh/pc-adctl/bin/pc-adctl
===================================================================
--- pcbsd/current/src-sh/pc-adctl/bin/pc-adctl	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/bin/pc-adctl	2012-11-07 23:44:01 UTC (rev 20142)
@@ -5,6 +5,7 @@
 
 # PROVIDE: pc_adctl
 
+. /etc/rc.conf
 . /usr/local/etc/rc.activedirectory
 
 pc_adctl_enable=${pc_activedirectory_enable-"NO"}
@@ -64,7 +65,6 @@
 		adctl_cmd service pc-activedirectory start
 		adctl_cmd service pc-activedirectory status
 		adctl_cmd service samba restart
-		adctl_cmd service pc-ad-ldap start
 	fi
 	
 	return 0
@@ -96,8 +96,6 @@
 		else
 			adctl_cmd service samba start
 		fi
-
-		adctl_cmd service pc-ad-ldap stop
 	fi
 }
 

Modified: pcbsd/current/src-sh/pc-adctl/bin/pc-ldapctl
===================================================================
--- pcbsd/current/src-sh/pc-adctl/bin/pc-ldapctl	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/bin/pc-ldapctl	2012-11-07 23:44:01 UTC (rev 20142)
@@ -5,6 +5,7 @@
 
 # PROVIDE: pc_ldapctl
 
+. /etc/rc.conf
 . /usr/local/etc/rc.ldap
 
 pc_ldapctl_enable=${pc_ldap_enable-"NO"}
@@ -45,8 +46,6 @@
 		ldapctl_assert service pc-ldap start
 		ldapctl_assert service pc-nssldap start
 		ldapctl_assert service pc-ldap status
-
-		ldapctl_assert service pc-ad-ldap start
 	fi
 	
 	return 0
@@ -76,8 +75,6 @@
 		else
 			ldapctl_assert service samba start
 		fi
-
-		ldapctl_assert service pc-ad-ldap stop
 	fi
 }
 

Modified: pcbsd/current/src-sh/pc-adctl/rc/rc.activedirectory
===================================================================
--- pcbsd/current/src-sh/pc-adctl/rc/rc.activedirectory	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/rc/rc.activedirectory	2012-11-07 23:44:01 UTC (rev 20142)
@@ -29,6 +29,7 @@
 #
 #	Active Directory config
 #
+: ${pc_activedirectory_enable:="NO"}
 : ${AD_CONF:="/usr/local/etc/pc-activedirectory.conf"}
 : ${AD_NET_CONF:="/usr/local/etc/pc-activedirectory-net.conf"}
 : ${AD_VAR_FILE:="/var/run/activedirectory"}

Modified: pcbsd/current/src-sh/pc-adctl/rc/rc.ldap
===================================================================
--- pcbsd/current/src-sh/pc-adctl/rc/rc.ldap	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/rc/rc.ldap	2012-11-07 23:44:01 UTC (rev 20142)
@@ -3,6 +3,7 @@
 #
 #	LDAP config
 #
+: ${pc_ldap_enable:="NO"}
 : ${PC_LDAP_CONF:="/usr/local/etc/pc-ldap.conf"}
 : ${PC_LDAP_VAR_FILE:="/var/run/pcldap"}
 

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-activedirectory
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-activedirectory	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-activedirectory	2012-11-07 23:44:01 UTC (rev 20142)
@@ -7,6 +7,7 @@
 # REQUIRE: pc_samba pc_kinit
 # BEFORE: winbindd
 
+. /etc/rc.conf
 . /usr/local/etc/rc.activedirectory
 
 pc_activedirectory_join_enable=${pc_activedirectory_enable-"NO"}
@@ -47,6 +48,7 @@
 }
 
 
+extra_commands="status"
 start_cmd='activedirectory_start'
 status_cmd='activedirectory_status'
 stop_cmd='activedirectory_stop'

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-directory
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-directory	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-directory	2012-11-07 23:44:01 UTC (rev 20142)
@@ -6,20 +6,12 @@
 # PROVIDE: pc_directory
 # REQUIRE: samba
 
+. /etc/rc.conf
 . /usr/local/etc/rc.ldap
 . /usr/local/etc/rc.activedirectory
 
 : ${pc_directory_enable:="NO"}
 
-if [ "${pc_ldap_enable}" = "YES" ]
-then
-	pc_directory_enable="YES"
-
-elif [ "${pc_activedirectory_enable}" = "YES" ]
-then
-	pc_directory_enable="YES"
-fi
-
 name="pc_directory"
 rcvar="pc_directory_enable"
 
@@ -67,4 +59,14 @@
 stop_cmd='pc_directory_stop'
         
 load_rc_config $name
+
+if [ "${pc_ldap_enable}" = "YES" ]
+then
+	pc_directory_enable="YES"
+
+elif [ "${pc_activedirectory_enable}" = "YES" ]
+then
+	pc_directory_enable="YES"
+fi
+
 run_rc_command "$1"

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-kerberos
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-kerberos	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-kerberos	2012-11-07 23:44:01 UTC (rev 20142)
@@ -6,7 +6,8 @@
 # PROVIDE: pc_kerberos
 # BEFORE: kerberos
 
-. /usr/local/etc/rc.active-directory
+. /etc/rc.conf
+. /usr/local/etc/rc.activedirectory
 
 pc_kerberos_enable=${pc_activedirectory_enable-"NO"}
 

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-kinit
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-kinit	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-kinit	2012-11-07 23:44:01 UTC (rev 20142)
@@ -8,6 +8,7 @@
 # REQUIRE: pc_samba
 # REQUIRE: ntpd
 
+. /etc/rc.conf
 . /usr/local/etc/rc.activedirectory
 
 pc_kinit_enable=${pc_activedirectory_enable-"NO"}
@@ -98,6 +99,7 @@
 	return 0
 }
 
+extra_commands="status"
 start_cmd='kinit_start'
 status_cmd='kinit_status'
 stop_cmd='kinit_stop'

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-ldap
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-ldap	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-ldap	2012-11-07 23:44:01 UTC (rev 20142)
@@ -7,6 +7,7 @@
 # REQUIRE: root
 # BEFORE: NETWORK
 
+. /etc/rc.conf
 . /usr/local/etc/rc.ldap
 
 pc_ldapconf_enable=${pc_ldap_enable-"NO"}
@@ -212,7 +213,7 @@
 
 }
 
-
+extra_commands="status"
 start_cmd='ldapconf_start'
 status_cmd='ldapconf_status'
 stop_cmd='ldapconf_stop'

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-nssldap
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-nssldap	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-nssldap	2012-11-07 23:44:01 UTC (rev 20142)
@@ -7,20 +7,12 @@
 # REQUIRE: root
 # BEFORE: NETWORK
 
+. /etc/rc.conf
 . /usr/local/etc/rc.ldap
 . /usr/local/etc/rc.activedirectory
 
 : ${pc_nssldapconf_enable:="NO"}
 
-if [ "${pc_ldap_enable}" = "YES" ]
-then
-	pc_nssldapconf_enable="YES"
-
-elif [ "${pc_activedirectory_enable}" = "YES" ]
-then
-	pc_nssldapconf_enable="YES"
-fi
-
 name="pc_nssldapconf"
 rcvar="pc_nssldapconf_enable"
     
@@ -387,9 +379,20 @@
 	return 0
 }
 
+extra_commands="status"
 start_cmd='nssldapconf_start'
 status_cmd=':'
 stop_cmd='nssldapconf_stop'
             
 load_rc_config $name
+
+if [ "${pc_ldap_enable}" = "YES" ]
+then
+	pc_nssldapconf_enable="YES"
+
+elif [ "${pc_activedirectory_enable}" = "YES" ]
+then
+	pc_nssldapconf_enable="YES"
+fi
+
 run_rc_command "$1"

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-nsswitch
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-nsswitch	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-nsswitch	2012-11-07 23:44:01 UTC (rev 20142)
@@ -7,20 +7,12 @@
 # REQUIRE: root
 # BEFORE: nsswitch
 
+. /etc/rc.conf
 . /usr/local/etc/rc.ldap
 . /usr/local/etc/rc.activedirectory
 
 : ${pc_nsswitch_enable:="NO"}
 
-if [ "${pc_ldap_enable}" = "YES" ]
-then
-	pc_nsswitch_enable="YES"
-
-elif [ "${pc_activedirectory_enable}" = "YES" ]
-then
-	pc_nsswitch_enable="YES"
-fi
-
 name="pc_nsswitch"
 rcvar="pc_nsswitch_enable"
 
@@ -141,4 +133,14 @@
 stop_cmd='nsswitch_conf_stop'
         
 load_rc_config $name
+
+if [ "${pc_ldap_enable}" = "YES" ]
+then
+	pc_nsswitch_enable="YES"
+
+elif [ "${pc_activedirectory_enable}" = "YES" ]
+then
+	pc_nsswitch_enable="YES"
+fi
+
 run_rc_command "$1"

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-pam
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-pam	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-pam	2012-11-07 23:44:01 UTC (rev 20142)
@@ -8,20 +8,12 @@
 # REQUIRE: pc_nsswitch
 # BEFORE: NETWORK
 
+. /etc/rc.conf
 . /usr/local/etc/rc.ldap
 . /usr/local/etc/rc.activedirectory
 
 : ${pc_pam_enable:="NO"}
 
-if [ "${pc_ldap_enable}" = "YES" ]
-then
-	pc_pam_enable="YES"
-
-elif [ "${pc_activedirectory_enable}" = "YES" ]
-then
-	pc_pam_enable="YES"
-fi
-
 name="pc_pam"
 rcvar="pc_pam_enable"
 
@@ -78,8 +70,8 @@
 : ${activedirectory_pam_facilities:="auth session"}
 : ${activedirectory_pam_services:="${DEFAULT_PAM_SERVICES}"}
 
-: ${ldapclient_pam_facilities:="auth session"}
-: ${ldapclient_pam_services:="${DEFAULT_PAM_SERVICES}"}
+: ${ldap_pam_facilities:="auth session"}
+: ${ldap_pam_services:="${DEFAULT_PAM_SERVICES}"}
 
 #
 # PC-BSD specifics
@@ -126,7 +118,7 @@
 
 	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
-		var="\$$(printf "ldapclient_pam_${tmp}")"
+		var="\$$(printf "ldap_pam_${tmp}")"
 
 	else
 		var="${tmp}"	
@@ -165,7 +157,7 @@
 	then
 		local tmp="$(echo ${service}|tr '.-' _)"
 
-		var=\$$(printf "ldapclient_pam_${tmp}")
+		var=\$$(printf "ldap_pam_${tmp}")
 		val=$(eval "echo ${var} 2>/dev/null")
 
 		if [ -n "${val}" ]
@@ -208,12 +200,12 @@
 	then
 		local tmp="$(echo ${service}|tr '.-' _)"
 
-		var=\$$(printf "ldapclient_pam_${tmp}")
+		var=\$$(printf "ldap_pam_${tmp}")
 		val=$(eval "echo ${var} 2>/dev/null")
 
 		if [ -z "${val}" ]
 		then
-			val="${ldapclient_pam_facilities}"
+			val="${ldap_pam_facilities}"
 		fi
 
 		check=1
@@ -510,13 +502,11 @@
 	then
 		if pam_auth_index_isset "${s}"
 		then
-			echo "AAA"
 			local index="$(get_pam_auth_index "${s}")"
 			__auth="-m "$(echo "${auth}" | sed -E "s|^\+|+${index}|")""
 
 		elif pam_auth_before_isset "${s}"
 		then
-			echo "BBB"
 			local before="$(get_pam_auth_before "${s}")"
 			local index="$(get_module_index "${pam_file}" auth "${before}")"
 
@@ -528,7 +518,6 @@
 
 		elif pam_auth_after_isset "${s}"
 		then
-			echo "CCC"
 			local before="$(get_pam_auth_after "${s}")"
 			local index="$(get_module_index "${pam_file}" auth "${after}")"
 
@@ -538,17 +527,14 @@
 		elif echo "${auth}" | egrep -q '^(+|^)' && \
 			! pam_service_configured "${pam_file}" "${auth}"
 		then
-			echo "DDD"
 			local index="$(get_auth_index "${pam_file}")"
 			__auth="-m "$(echo "${auth}" | sed -E "s|^\+|+${index}|")""
 
 		elif echo "${auth}" | egrep -q '^-'
 		then
-			echo "EEE"
 			__auth="-m "${auth}""
 		fi
 	else
-			echo "FFF"
 		__auth=""
 	fi
 
@@ -557,14 +543,152 @@
 
 do_pam_account_conf()
 {
+	local pam_file="${1}"
+	local s="${2}"
+	local account="${3}"
+	local __account
+
+	if pam_account_isset "${s}"
+	then
+		if pam_account_index_isset "${s}"
+		then
+			local index="$(get_pam_account_index "${s}")"
+			__account="-m "$(echo "${account}" | sed -E "s|^\+|+${index}|")""
+
+		elif pam_account_before_isset "${s}"
+		then
+			local before="$(get_pam_account_before "${s}")"
+			local index="$(get_module_index "${pam_file}" account "${before}")"
+
+			if [ "${index}" -gt "0" ]
+			then
+				index=$(( index -= 1 ))
+			fi
+			__auth="-m "$(echo "${account}" | sed -E "s|^\+|+${index}|")""
+
+		elif pam_account_after_isset "${s}"
+		then
+			local before="$(get_pam_account_after "${s}")"
+			local index="$(get_module_index "${pam_file}" account "${after}")"
+
+			index=$(( index += 1 ))
+			__account="-m "$(echo "${account}" | sed -E "s|^\+|+${index}|")""
+
+		elif echo "${account}" | egrep -q '^(+|^)' && \
+			! pam_service_configured "${pam_file}" "${account}"
+		then
+			local index="$(get_account_index "${pam_file}")"
+			__account="-m "$(echo "${account}" | sed -E "s|^\+|+${index}|")""
+
+		elif echo "${account}" | egrep -q '^-'
+		then
+			__auth="-m "${account}""
+		fi
+	else
+		__account=""
+	fi
+
+	echo "${__account}"
 }
 
 do_pam_session_conf()
 {
+	local pam_file="${1}"
+	local s="${2}"
+	local session="${3}"
+	local __session
+
+	if pam_session_isset "${s}"
+	then
+		if pam_session_index_isset "${s}"
+		then
+			local index="$(get_pam_session_index "${s}")"
+			__session="-m "$(echo "${session}" | sed -E "s|^\+|+${index}|")""
+
+		elif pam_session_before_isset "${s}"
+		then
+			local before="$(get_pam_session_before "${s}")"
+			local index="$(get_module_index "${pam_file}" session "${before}")"
+
+			if [ "${index}" -gt "0" ]
+			then
+				index=$(( index -= 1 ))
+			fi
+			__session="-m "$(echo "${session}" | sed -E "s|^\+|+${index}|")""
+
+		elif pam_session_after_isset "${s}"
+		then
+			local before="$(get_pam_session_after "${s}")"
+			local index="$(get_module_index "${pam_file}" session "${after}")"
+
+			index=$(( index += 1 ))
+			__session="-m "$(echo "${session}" | sed -E "s|^\+|+${index}|")""
+
+		elif echo "${session}" | egrep -q '^(+|^)' && \
+			! pam_service_configured "${pam_file}" "${session}"
+		then
+			local index="$(get_session_index "${pam_file}")"
+			__session="-m "$(echo "${session}" | sed -E "s|^\+|+${index}|")""
+
+		elif echo "${session}" | egrep -q '^-'
+		then
+			__session="-m "${session}""
+		fi
+	else
+		__session=""
+	fi
+
+	echo "${__session}"
 }
 
 do_pam_password_conf()
 {
+	local pam_file="${1}"
+	local s="${2}"
+	local password="${3}"
+	local __password
+
+	if pam_password_isset "${s}"
+	then
+		if pam_password_index_isset "${s}"
+		then
+			local index="$(get_pam_password_index "${s}")"
+			__password="-m "$(echo "${password}" | sed -E "s|^\+|+${index}|")""
+
+		elif pam_password_before_isset "${s}"
+		then
+			local before="$(get_pam_password_before "${s}")"
+			local index="$(get_module_index "${pam_file}" password "${before}")"
+
+			if [ "${index}" -gt "0" ]
+			then
+				index=$(( index -= 1 ))
+			fi
+			__password="-m "$(echo "${password}" | sed -E "s|^\+|+${index}|")""
+
+		elif pam_password_after_isset "${s}"
+		then
+			local before="$(get_pam_password_after "${s}")"
+			local index="$(get_module_index "${pam_file}" password "${after}")"
+
+			index=$(( index += 1 ))
+			__password="-m "$(echo "${password}" | sed -E "s|^\+|+${index}|")""
+
+		elif echo "${password}" | egrep -q '^(+|^)' && \
+			! pam_service_configured "${pam_file}" "${password}"
+		then
+			local index="$(get_password_index "${pam_file}")"
+			__password="-m "$(echo "${password}" | sed -E "s|^\+|+${index}|")""
+
+		elif echo "${password}" | egrep -q '^-'
+		then
+			__password="-m "${password}""
+		fi
+	else
+		__password=""
+	fi
+
+	echo "${__password}"
 }
 
 do_pam_facility_conf()
@@ -589,7 +713,7 @@
 
 	elif checkyesno pc_ldap_enable 2>/dev/null
 	then
-		services="${ldapclient_pam_services}"
+		services="${ldap_pam_services}"
 	fi
 
 	for pam_dir in ${PAMDIRS}
@@ -613,108 +737,47 @@
 
 			if in_pam_services "${s}" "${services}"
 			then
-				# pam_auth_isset
-				# pam_auth_index_isset
-				# pam_auth_before_isset
-				# pam_auth_after_isset
 
-				if [ -z "${auth}" ]
-				then
-					__auth=""
-					continue
-				fi
-
 				__auth=""
 				if pam_auth_isset "${s}"
 				then
 					__auth="$(do_pam_auth_conf "${pam_file}" "${s}" "${auth}")"
+					if [ -n "${__auth}" ]
+					then
+						doconf=1
+					fi
 				fi
 
-				echo "__auth = $__auth"
-
-
+				__account=""
 				if pam_account_isset "${s}"
 				then
-					:
+					__account="$(do_pam_account_conf "${pam_file}" "${s}" "${account}")"
+					if [ -n "${__account}" ]
+					then
+						doconf=1
+					fi
 				fi
 
+				__session=""
 				if pam_session_isset "${s}"
 				then
-					:
-				fi
-
-				if pam_password_isset "${s}"
-				then
-					:
-				fi
-
-				continue
-
-				if pam_auth_isset "${s}" && [ -n "${auth}" ]
-				then
-					if echo "${auth}" | egrep -q '^(+|^)' && \
-						! pam_service_configured "${pam_file}" "${auth}"
+					__session="$(do_pam_session_conf "${pam_file}" "${s}" "${session}")"
+					if [ -n "${__session}" ]
 					then
-						local index="$(get_auth_index "${pam_file}")"
-						__auth="-m "$(echo "${auth}" | sed -E "s|^\+|+${index}|")""
-
-					elif echo "${auth}" | egrep -q '^-'
-					then
-						__auth="-m "${auth}""
+						doconf=1
 					fi
-					doconf=1
-				else
-					__auth=""
 				fi
-				if pam_account_isset "${s}" && [ -n "${account}" ]
-				then
-					if echo "${account}" | egrep -q '^(+|^)' && \
-						! pam_service_configured "${pam_file}" "${account}"
-					then
-						local index="$(get_account_index "${pam_file}")"
-						__account="-m "$(echo "${account}" | sed -E "s|^\+|+${index}|")""
 
-					elif echo "${account}" | egrep -q '^-'
-					then
-						__account="-m "${account}""
-					fi
-					doconf=1
-				else
-					__account=""
-				fi
-				if pam_session_isset "${s}" && [ -n "${session}" ]
+				__password=""
+				if pam_password_isset "${s}"
 				then
-					if echo "${session}" | egrep -q '^(+|^)' && \
-						! pam_service_configured "${pam_file}" "${session}"
+					__password="$(do_pam_password_conf "${pam_file}" "${s}" "${password}")"
+					if [ -n "${__password}" ]
 					then
-						local index="$(get_session_index "${pam_file}")"
-						__session="-m "$(echo "${session}" | sed -E "s|^\+|+${index}|")""
-
-					elif echo "${session}" | egrep -q '^-'
-					then
-						__session="-m "${session}""
+						doconf=1
 					fi
-					doconf=1
-				else
-					__session=""
 				fi
-				if pam_password_isset "${s}" && [ -n "${password}" ]
-				then
-					if echo "${password}" | egrep -q '^(+|^)' && \
-						! pam_service_configured "${pam_file}" "${password}"
-					then
-						local index="$(get_password_index "${pam_file}")"
-						__password="-m "$(echo "${password}" | sed -E "s|^\+|+${index}|")""
 
-					elif echo "${password}" | egrep -q '^-'
-					then
-						__password="-m "${password}""
-					fi
-					doconf=1
-				else
-					__password=""
-				fi
-
 				if [ "${doconf}" = "1" ]
 				then
 					${PAMCONF} -f "${pam_file}" \
@@ -837,4 +900,14 @@
 stop_cmd='pam_stop'
         
 load_rc_config $name
+
+if [ "${pc_ldap_enable}" = "YES" ]
+then
+	pc_pam_enable="YES"
+
+elif [ "${pc_activedirectory_enable}" = "YES" ]
+then
+	pc_pam_enable="YES"
+fi
+
 run_rc_command "$1"

Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-samba
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-samba	2012-11-07 20:03:56 UTC (rev 20141)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-samba	2012-11-07 23:44:01 UTC (rev 20142)
@@ -8,20 +8,12 @@
 # REQUIRE: pc_pam
 # BEFORE: smbd
 
+. /etc/rc.conf
 . /usr/local/etc/rc.ldap
 . /usr/local/etc/rc.activedirectory
 
 : ${pc_samba_enable:="NO"}
 
-if [ "${pc_ldap_enable}" = "YES" ]
-then
-	pc_samba_enable="YES"
-
-elif [ "${pc_activedirectory_enable}" = "YES" ]
-then
-	pc_samba_enable="YES"
-fi
-
 name="pc_samba"
 rcvar="pc_samba_enable"
 
@@ -229,4 +221,14 @@
 stop_cmd='smbconf_stop'
 
 load_rc_config $name
+
+if [ "${pc_ldap_enable}" = "YES" ]
+then
+	pc_samba_enable="YES"
+
+elif [ "${pc_activedirectory_enable}" = "YES" ]
+then
+	pc_samba_enable="YES"
+fi
+
 run_rc_command "$1"



More information about the Commits mailing list