Bug 49327

Summary: slocate ignores LOCATE _PATH
Product: [Retired] Red Hat Linux Reporter: Jim Radford <radford>
Component: slocateAssignee: Thomas Woerner <twoerner>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-15 18:44:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Jim Radford 2001-07-18 01:39:17 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.6 i686; en-US; rv:0.9.1)
Gecko/20010609

Description of problem:
slocate ignores datbases passed in the LOCATE_PATH environment
variable.


How reproducible:
Always

Steps to Reproduce:
$ mkdir -p /tmp/locate/asdfasdf/time
$ locate -o x -U /tmp/locate
$ env LOCATE_PATH=x locate asdfasdf
$ locate -d x asdfasdf
/tmp/locate/asdfasdf
/tmp/locate/asdfasdf/time


Additional info:

Here's a patch.

--- slocate-2.5/main.c.orig     Tue Jul 17 18:15:10 2001
+++ slocate-2.5/main.c  Tue Jul 17 18:16:33 2001
@@ -1362,6 +1362,10 @@
        /* Add the LOCATE_PATH environment variable to the list of
databases to search in */
        parse_decode_path(getenv("LOCATE_PATH"));
 
+       /* If we found something in LOCATE_PATH then don't overwrite it
with the default */
+       if(SLOCATE_PATH && *SLOCATE_PATH) 
+           ADD_SLOCATEDB=0;
+
        /* Loop through specified command line arguments */
        while ((ch = getopt(args,argv,"VvuhqU:r:o:e:l:d:-:n:f:ci")) != EOF) {
                switch(ch) {

Comment 1 Thomas Woerner 2004-10-15 18:44:45 UTC
Please verify this with a newer version of Red Hat Enterprise Linux or
Fedora Core and reopen it against the new version if it still occurs.

Closing as "not a bug" for now.