From root@fish.alkar.net  Fri Jan 24 02:05:20 2003
Return-Path: <root@fish.alkar.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id A50D237B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Jan 2003 02:05:20 -0800 (PST)
Received: from fish.alkar.net (fish.alkar.net [212.86.226.3])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8ACF543E4A
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 24 Jan 2003 02:05:17 -0800 (PST)
	(envelope-from root@fish.alkar.net)
Received: from fish.alkar.net (localhost [127.0.0.1])
	by fish.alkar.net (8.12.6/8.12.6) with ESMTP id h0OADYIx000792;
	Fri, 24 Jan 2003 12:13:34 +0200 (EET)
	(envelope-from root@fish.alkar.net)
Received: (from root@localhost)
	by fish.alkar.net (8.12.6/8.12.6/Submit) id h0OADVDT000791;
	Fri, 24 Jan 2003 12:13:31 +0200 (EET)
Message-Id: <200301241013.h0OADVDT000791@fish.alkar.net>
Date: Fri, 24 Jan 2003 12:13:31 +0200 (EET)
From: kota@alkar.net
Reply-To: kota@at.com.ua
To: FreeBSD-gnats-submit@freebsd.org
Cc: kota@alkar.net
Subject: wrong order of arguments of ldconfig in /etc/rc.d/ldconfig script in insecure mode
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         47430
>Category:       conf
>Synopsis:       wrong order of arguments of ldconfig in /etc/rc.d/ldconfig script in insecure mode
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    mtm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 24 02:10:03 PST 2003
>Closed-Date:    Mon May 19 11:12:12 PDT 2003
>Last-Modified:  Mon May 19 11:12:12 PDT 2003
>Originator:     Charlie &
>Release:        FreeBSD 5.0-RELEASE i386
>Organization:
>Environment:
System: FreeBSD fish.alkar.net 5.0-RELEASE FreeBSD 5.0-RELEASE #0: Thu Jan 16 22:16:53 GMT 2003 root@hollin.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC i386


	
>Description:
	in 5.0 ldconfig allow this order of arguments
        ldconfig -elf -i...
        and doesn't allow 
	ldconfig -i -elf ....
	That's why if you set ldconfig_insecure='YES' 
	/etc/rc.d/ldconfig  call ldconfig with the wrong order of arguments
        and the result is empty list of shared libraryes directories.
	
	Is this problem of scrypt or problem of ldconfig binary?
	
>How-To-Repeat:
	set ldconfig_insecure="YES" in rc.conf.local
	
>Fix:
	If this is problem of script and not ldconfig binary, this is small patch.
	

--- ldconfig.patch begins here ---
--- ldconfig.orig	Fri Jan 24 11:03:56 2003
+++ ldconfig	Fri Jan 24 11:27:15 2003
@@ -20,8 +20,8 @@
 {
 	case ${OSTYPE} in
 	FreeBSD)
-		ldconfig=${ldconfig_command}
-		checkyesno ldconfig_insecure && ldconfig="${ldconfig} -i"
+#		ldconfig=${ldconfig_command}
+#		checkyesno ldconfig_insecure && ldconfig="${ldconfig} -i"
 		if [ -x "${ldconfig_command}" ]; then
 			_LDC=/usr/lib
 			for i in ${ldconfig_paths}; do
@@ -30,7 +30,9 @@
 				fi
 			done
 			echo 'ELF ldconfig path:' ${_LDC}
-			${ldconfig} -elf ${_LDC}
+			ldconfig="${ldconfig_command} -elf "
+			checkyesno ldconfig_insecure && ldconfig="${ldconfig} -i"
+			${ldconfig} ${_LDC}
 
 			# Legacy aout support for i386 only
 			case `sysctl -n hw.machine_arch` in
@@ -44,7 +46,9 @@
 					fi
 				done
 				echo 'a.out ldconfig path:' ${_LDC}
-				${ldconfig} -aout ${_LDC}
+				ldconfig="${ldconfig_command} -aout "
+				checkyesno ldconfig_insecure && ldconfig="${ldconfig} -i"
+				${ldconfig} ${_LDC}
 				;;
 			esac
 		fi
--- ldconfig.patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mtm 
Responsible-Changed-By: mtm 
Responsible-Changed-When: Sun Jan 26 13:35:31 PST 2003 
Responsible-Changed-Why:  
I'll take a look at this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=47430 
State-Changed-From-To: open->closed 
State-Changed-By: mtm 
State-Changed-When: Mon May 19 11:11:07 PDT 2003 
State-Changed-Why:  
Fixed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=47430 
>Unformatted:
