OPNsense Forum

English Forums => 25.7, 25.10 Series => Topic started by: Jyling on November 02, 2025, 11:03:41 PM

Title: Console fun
Post by: Jyling on November 02, 2025, 11:03:41 PM
What am I missing? Trying to locate dnsmasq.conf,

root@router:~ # locate dnsmasq.conf
locate: the locate database '/var/db/locate.database' does not exist.

To create a new database, please run the following command as root:

  /etc/periodic/weekly/310.locate

root@router:~ # /etc/periodic/weekly/310.locate

Rebuilding locate database:
Must be root.
root@router:~ # whoami
root
root@router:~ # locate dnsmasq.conf
locate: the locate database '/var/db/locate.database' is smaller than 256 bytes large.

To create a new database, please run the following command as root:

  /etc/periodic/weekly/310.locate

root@router:~ #

I am the root, am I not?
Title: Re: Console fun
Post by: meyergru on November 02, 2025, 11:08:55 PM
locate is using a pre-build database to make searches faster for local users. OpnSense is not build for that purpose.

If you want to find a specific find, you can use find ("find / -name 'dnsmasq.conf'") or - even easier, look at the running processes with their commandlines to see what they actually use: "ps auxwwww | fgrep dnsmasq". More often than not, OpnSense uses a different location than usual for FreeBSD, so multiple versions of the config files exist.

Title: Re: Console fun
Post by: bringha on November 03, 2025, 12:37:53 PM
... or run manually

Quote/usr/libexec/locate.updatedb
....
Title: Re: Console fun
Post by: frakkin64 on November 03, 2025, 12:54:20 PM
Quote from: Jyling on November 02, 2025, 11:03:41 PMroot@router:~ # /etc/periodic/weekly/310.locate

That script is running as nobody, what seems to be broken here is the actual "su -fm nobody" in that script.  The intent apparently is to run as nobody to not reveal files readable only to root.

If I were guessing, perhaps there was some adjustments made on "su" that differs from FreeBSD.  But I think as mentioned it seems like very few folks using locate.  I usually use find as well, especially considering the intent is to mask root only files it kind of makes it useless.
Title: Re: Console fun
Post by: franco on November 03, 2025, 05:34:01 PM
Uh, not this "security" related issue again. ;)

https://github.com/opnsense/src/issues/213


Cheers,
Franco