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?
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.
... or run manually
Quote/usr/libexec/locate.updatedb
....
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.
Uh, not this "security" related issue again. ;)
https://github.com/opnsense/src/issues/213
Cheers,
Franco