[PC-BSD Commits] r19418 - pcbsd/current/src-sh/pc-adctl/scripts

svn at pcbsd.org svn at pcbsd.org
Wed Sep 19 19:32:06 PDT 2012


Author: johnh
Date: 2012-09-20 02:32:06 +0000 (Thu, 20 Sep 2012)
New Revision: 19418

Modified:
   pcbsd/current/src-sh/pc-adctl/scripts/pc-pam
Log:
One more bugfix. Removing lines from pam files was broken, now it's fixed.



Modified: pcbsd/current/src-sh/pc-adctl/scripts/pc-pam
===================================================================
--- pcbsd/current/src-sh/pc-adctl/scripts/pc-pam	2012-09-20 01:06:33 UTC (rev 19417)
+++ pcbsd/current/src-sh/pc-adctl/scripts/pc-pam	2012-09-20 02:32:06 UTC (rev 19418)
@@ -204,7 +204,7 @@
 	local pam_file="${1}"
 	local pam_str="${2}"
 
-	local str="$(echo "${pam_str}" | sed -E 's|^(([+\-^])?([0-9]+)?)?||')"
+	local str="$(echo "${pam_str}" | sed -E 's|^(([+-^])?([0-9]+)?)?||')"
 
 	local facility="$(echo "${str}" | cut -f1 -d:)"
 	local control="$(echo "${str}" | cut -f2 -d:)"
@@ -256,11 +256,11 @@
 
 			if in_pam_services "${s}" "${services}"
 			then
-				if pam_auth_isset "${s}" && [ -n "${auth}" ] && \
-					! pam_service_configured "${pam_file}" "${auth}"
+				if pam_auth_isset "${s}" && [ -n "${auth}" ]
 				then
 					__auth="-m "${auth}""
-					if echo "${auth}" | grep -q '^+'
+					if echo "${auth}" | grep -q '^(+|^)' && \
+						! pam_service_configured "${pam_file}" "${auth}"
 					then
 						local index="$(get_auth_index "${pam_file}")"
 						__auth="-m "$(echo "${auth}" | sed -E "s|^\+|+${index}|")""
@@ -269,11 +269,11 @@
 				else
 					__auth=""
 				fi
-				if pam_account_isset "${s}" && [ -n "${account}" ] && \
-					! pam_service_configured "${pam_file}" "${account}"
+				if pam_account_isset "${s}" && [ -n "${account}" ]
 				then
 					__account=" -m "${account}""
-					if echo "${account}" | grep -q '^+'
+					if echo "${account}" | grep -q '^(+|^)' && \
+						! pam_service_configured "${pam_file}" "${account}"
 					then
 						local index="$(get_account_index "${pam_file}")"
 						__account="-m "$(echo "${account}" | sed -E "s|^\+|+${index}|")""
@@ -282,11 +282,11 @@
 				else
 					__account=""
 				fi
-				if pam_session_isset "${s}" && [ -n "${session}" ] && \
-					! pam_service_configured "${pam_file}" "${session}"
+				if pam_session_isset "${s}" && [ -n "${session}" ]
 				then
 					__session="-m "${session}""
-					if echo "${session}" | grep -q '^+'
+					if echo "${session}" | grep -q '^(+|^)' && \
+						! pam_service_configured "${pam_file}" "${session}"
 					then
 						local index="$(get_session_index "${pam_file}")"
 						__session="-m "$(echo "${session}" | sed -E "s|^\+|+${index}|")""
@@ -295,11 +295,11 @@
 				else
 					__session=""
 				fi
-				if pam_password_isset "${s}" && [ -n "${password}" ] && \
-					! pam_service_configured "${pam_file}" "${password}"
+				if pam_password_isset "${s}" && [ -n "${password}" ]
 				then
 					__password="-m "${password}""
-					if echo "${password}" | grep -q '^+'
+					if echo "${password}" | grep -q '^(+|^)' && \
+						! pam_service_configured "${pam_file}" "${password}"
 					then
 						local index="$(get_password_index "${pam_file}")"
 						__password="-m "$(echo "${password}" | sed -E "s|^\+|+${index}|")""
@@ -311,7 +311,6 @@
 
 				if [ "${doconf}" = "1" ]
 				then
-
 					${PAMCONF} -f "${pam_file}" \
 					${__auth} \
 					${__account} \



More information about the Commits mailing list