From nobody@FreeBSD.org  Thu Aug 16 20:44:40 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE9D516A421
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Aug 2007 20:44:40 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id AB3B213C469
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Aug 2007 20:44:40 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l7GKiegV090134
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 16 Aug 2007 20:44:40 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l7GKieW2090133;
	Thu, 16 Aug 2007 20:44:40 GMT
	(envelope-from nobody)
Message-Id: <200708162044.l7GKieW2090133@www.freebsd.org>
Date: Thu, 16 Aug 2007 20:44:40 GMT
From: Tim Newsham <newsham@lava.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: rc.d/ldconfig doesnt handle ldconfig_local_dirs properly
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         115588
>Category:       conf
>Synopsis:       rc.d/ldconfig doesnt handle ldconfig_local_dirs properly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-rc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 16 20:50:01 GMT 2007
>Closed-Date:    Mon Aug 20 12:35:21 GMT 2007
>Last-Modified:  Mon Aug 20 12:35:21 GMT 2007
>Originator:     Tim Newsham
>Release:        FreeBSD6.2-STABLE (early august)
>Organization:
>Environment:
FreeBSD hpsux.x0d99.com 6.2-STABLE FreeBSD 6.2-STABLE #1: Fri Aug  3 18:39:42 HST 2007     root@hpsux.x0d99.com:/usr/src/sys/amd64/compile/THENEWSH  amd64
>Description:
The /etc/rc.d/ldconfig script does not properly handle ldconfig_local_dirs or ld_config_local32_dirs paths.  If you try to run the script with either of these set in /etc/rc.conf (ie. ldconfig_local32_dirs=/usr/local/lib32) the screen will be filled with garbage.  I believe this is due to:

if [ -n "${_files}" ]; then
   ldconfig_paths="${ldconfig_paths} `cat ${_files} | sort -u`"
fi

which sets the ldconfig_paths variable to the contents of all of the library files.  This variable is later echoed to the screen.  Perhaps the "cat" was meant to be an "echo"?

Tim
>How-To-Repeat:
edit /etc/rc.conf.  Add a line 
   ldconfig_local_dirs=/usr/local/lib
save the file and run 
   sh /etc/rc.d/ldconfig restart

repeat with ldconfig_local32_dirs on an em64_t/amd64 machine.

>Fix:
Change cat to echo?  I'm not sure I understand what the script was trying to do.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: yar 
Responsible-Changed-When: Fri Aug 17 06:32:13 UTC 2007 
Responsible-Changed-Why:  
Over to the rc list for consideration. 

The code in rc.d/ldconfig looks wrong to me, too; 
it tries to cat(1) library files. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115588 

From: Yar Tikhiy <yar@comp.chem.msu.su>
To: bug-followup@FreeBSD.org,
 newsham@lava.net
Cc:  
Subject: Re: misc/115588: rc.d/ldconfig doesnt handle ldconfig_local_dirs properly
Date: Fri, 17 Aug 2007 10:54:23 +0400

 On a second thought, ldconfig_local_dirs should list not library  
 directories but ldconfig directories, which are a different kind of  
 beasts. I just looked up a wrong variable in rc.conf(5). Anyway,  
 leaving this PR to a developer who actually uses this feature.
State-Changed-From-To: open->closed 
State-Changed-By: flz 
State-Changed-When: Mon Aug 20 12:34:11 UTC 2007 
State-Changed-Why:  
You should be using ldconfig32_paths not ldconfig_local32_dirs. 

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