Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 551408 - sys-apps/mlocate: bug in search results after renaming indexed directory
Summary: sys-apps/mlocate: bug in search results after renaming indexed directory
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-07 06:13 UTC by Milos Ivanovic
Modified: 2016-05-28 09:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milos Ivanovic 2015-06-07 06:13:26 UTC
Hi team,

There is a bug in mlocate version 0.26 (at least) which causes the locate(1) command to omit results which are only meant to be omitted when using the -e switch.

       -e, --existing
              Print only entries that refer to files existing at the time locate is run.

A proof-of-concept is shown below.

# renaming your file (works as documented)
eclipse ~ # mkdir whatever
eclipse ~ # touch whatever/whatever1
eclipse ~ # updatedb
eclipse ~ # locate whatever1
/root/whatever/whatever1
eclipse ~ # mv whatever/whatever1 whatever/whatever2
eclipse ~ # locate whatever1
/root/whatever/whatever1
eclipse ~ # locate -e whatever1

# clean up
eclipse ~ # rm whatever/whatever2
eclipse ~ # updatedb

# renaming a directory containing your file (bug)
eclipse ~ # locate whatever2
eclipse ~ # touch whatever/whatever2
eclipse ~ # updatedb
eclipse ~ # locate whatever2
/root/whatever/whatever2
eclipse ~ # mv whatever whatever99
eclipse ~ # locate whatever2
eclipse ~ # locate -e whatever2
eclipse ~ # mv whatever99 whatever
eclipse ~ # locate whatever2
/root/whatever/whatever2
eclipse ~ # locate -e whatever2
/root/whatever/whatever2