Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Sep 2002 17:07:03 -0700
From:      Bakul Shah <bakul@bitblocks.com>
To:        current@freebsd.org
Subject:   ldconfig in /etc/rc & /etc/rc.d/ldconfig
Message-ID:  <200209230007.UAA00098@goliath.cnchost.com>

next in thread | raw e-mail | index | archive | help
If the ldconfig_insecure flag is set in /etc/rc.conf,
ldconfig doesn't do anything useful at startup time except
complain.  The following patch should fix it.

diff -ur /usr/src/etc/rc ./rc
--- /usr/src/etc/rc	Tue Sep 17 21:02:01 2002
+++ ./rc	Sun Sep 22 16:49:19 2002
@@ -692,9 +692,10 @@
 # add your own entries or you may come to grief.
 #
 ldconfig="/sbin/ldconfig"
+ldc_flags=""
 case ${ldconfig_insecure} in
 [Yy][Ee][Ss])
-	ldconfig="${ldconfig} -i"
+	ldc_flags="-i"
 	;;
 esac
 if [ -x /sbin/ldconfig ]; then
@@ -705,7 +706,7 @@
 		fi
 	done
 	echo 'ELF ldconfig path:' ${_LDC}
-	${ldconfig} ${_LDC}
+	${ldconfig} ${ldc_flags} ${_LDC}
 
 	# Legacy aout support for i386 only
 	case `sysctl -n hw.machine_arch` in
@@ -719,7 +720,7 @@
 			fi
 		done
 		echo 'a.out ldconfig path:' ${_LDC}
-		${ldconfig} -aout ${_LDC}
+		${ldconfig} -aout ${ldc_flags} ${_LDC}
 		;;
 	esac
 fi
diff -ur /usr/src/etc/rc.d/ldconfig ./rc.d/ldconfig
--- /usr/src/etc/rc.d/ldconfig	Tue Sep 17 21:02:03 2002
+++ ./rc.d/ldconfig	Sun Sep 22 16:48:12 2002
@@ -21,7 +21,8 @@
 	case ${OSTYPE} in
 	FreeBSD)
 		ldconfig=${ldconfig_command}
-		checkyesno ldconfig_insecure && ldconfig="${ldconfig} -i"
+		ldc_flags=""
+		checkyesno ldconfig_insecure && ldc_flags="-i"
 		if [ -x "${ldconfig_command}" ]; then
 			_LDC=/usr/lib
 			for i in ${ldconfig_paths}; do
@@ -30,7 +31,7 @@
 				fi
 			done
 			echo 'ELF ldconfig path:' ${_LDC}
-			${ldconfig} -elf ${_LDC}
+			${ldconfig} -elf ${ldc_flags} ${_LDC}
 
 			# Legacy aout support for i386 only
 			case `sysctl -n hw.machine_arch` in
@@ -44,7 +45,7 @@
 					fi
 				done
 				echo 'a.out ldconfig path:' ${_LDC}
-				${ldconfig} -aout ${_LDC}
+				${ldconfig} -aout ${ldc_flags} ${_LDC}
 				;;
 			esac
 		fi

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209230007.UAA00098>