Console fun

Started by Jyling, November 02, 2025, 11:03:41 PM

Previous topic - Next topic
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.

Intel N100, 4* I226-V, 2* 82559, 16 GByte, 500 GByte NVME, ZTE F6005

1100 down / 800 up, Bufferbloat A+

... or run manually

Quote/usr/libexec/locate.updatedb
....

November 03, 2025, 12:54:20 PM #3 Last Edit: November 03, 2025, 01:00:15 PM by frakkin64
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.
Topton N5105 | 16GB RAM | 1TB NVMe | 4x i226-V

Uh, not this "security" related issue again. ;)

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


Cheers,
Franco