# Trouble porting mlocate



## wojtech (Aug 4, 2014)

mlocate is a much better alternative to the current locate/glocate since it allows filtering of returned files by permission (it uses a common database but only lists those files to a user that he has access to). It also does differential DB updates which are much quicker.

Anyways my colleague and I have tried to get this to work under FreeBSD. The problems are mainly build related, compatibility wise it appears to have been working in the past (at least under MacOS http://chetanislazy.com/blog/2010/06/25 ... -mac-os-x/). Our experience with FreeBSD is really limited though and the maintainer of mlocate cannot really help either. For somebody with porting experience it could be a really easy fix.

Here are some resources:

source tar: https://fedorahosted.org/releases/m/l/m ... .26.tar.xz
repository: http://hg.fedorahosted.org/hg/mlocate
current status: https://fedorahosted.org/mlocate/ticket/33


----------



## SirDice (Aug 4, 2014)

locate(1) is part of the base OS.


----------



## wojtech (Aug 6, 2014)

I am well aware of that but locate is not mlocate (or slocate)

Benefits of slocate and mlocate: only display to a user the files he actually has access to (current locate is a security risk since it potentially exposes file names not accessible to the user)
Benefit of mlocate (over slocate and locate): differential database updates that can be done more frequently.

To my knowledge, there are no technical reasons why mlocate would not work once compiled correctly.


----------



## SirDice (Aug 6, 2014)

wojtech said:
			
		

> I am well aware of that but locate is not mlocate (or slocate)


FreeBSD's locate(1) isn't the same as GNU locate either.



> (current locate is a security risk since it potentially exposes file names not accessible to the user)


That may be true on Linux but I don't think this is the case for FreeBSD. From the locate(1) man page:

```
The locate database is typically built by user ``nobody'' and the
     locate.updatedb(8) utility skips directories which are not readable for
     user ``nobody'', group ``nobody'', or world.  For example, if your HOME
     directory is not world-readable, none of your files are in the database.
```

Keep in mind that FreeBSD has its own locate(1) implementation.

http://svnweb.freebsd.org/base/head/usr.bin/locate/


----------

