[MacPorts] #73455: findutils: cannot use locate; updatedb apparently fails to do anything useful!
MacPorts
noreply at macports.org
Mon May 4 17:40:31 UTC 2026
#73455: findutils: cannot use locate; updatedb apparently fails to do anything
useful!
---------------------------+----------------------
Reporter: seamusdemora | Owner: mascguy
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.11.6
Resolution: | Keywords: sequoia
Port: findutils |
---------------------------+----------------------
Comment (by tomio-arisaka):
{{{gupdatedb}}} is a shell script. So we can see how it works.
For example, on macOS High Sierra, I tried to build the {{{glocate}}}
databases with {{{gfind}}} and {{{gfrcode}}} as follows:
(note: {{{glocate}}} allows us to use multiple databases)
{{{
$ sudo gfind /opt/X11 -type f -print0 | /opt/local/libexec/gfrcode -0 >
${HOME}/locatedb2
$
$ sudo gfind /opt \( -path "/opt/X11" -prune \) -o -type f -print0 |
/opt/local/libexec/gfrcode -0 > ${HOME}/locatedb1
$
$ export LOCATE_PATH=${HOME}/locatedb1
$
$ glocate xload
/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/x11/xload/Portfile
$
$ export LOCATE_PATH=${HOME}/locatedb1:${HOME}/locatedb2
$
$ glocate xload
/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/x11/xload/Portfile
/opt/X11/bin/xload
/opt/X11/share/man/man1/xload.1
$
}}}
Another example, I tried to build a database used by {{{glocate}}} on
ARM64 macOS Sonoma:
{{{
$ sudo gfind /System -type f -print0 | /opt/local/libexec/gfrcode -0 >
${HOME}/locatedb02
Password:
gfind: ‘/System/Volumes/Update/.TemporaryItems’: Operation not permitted
gfind: ‘/System/Volumes/Preboot/.TemporaryItems’: Operation not permitted
gfind: ‘/System/Volumes/Preboot/com.apple.security.cryptexd’: Operation
not permitted
gfind: ‘/System/Volumes/xarts/.Trashes’: Operation not permitted
gfind: ‘/System/Volumes/Data/home’: Operation not permitted
gfind: ‘/System/Volumes/Data/.Spotlight-V100’: Operation not permitted
gfind: ‘/System/Volumes/Data/Library/Application Support/com.apple.TCC’:
Operation not permitted
gfind: ‘/System/Volumes/Data/Library/Trial’: Operation not permitted
gfind:
‘/System/Volumes/Data/Library/Caches/com.apple.amsengagementd.classicdatavault’:
Operation not permitted
gfind: ‘/System/Volumes/Data/Library/Caches/com.apple.aneuserd’: Operation
not permitted
gfind: ‘/System/Volumes/Data/Library/Caches/com.apple.aned’: Operation not
permitted
gfind: failed to read file names from file system at or below ‘/System’:
No such file or directory
$
}}}
So I changed the command in order to avoid the errors:
{{{
$ sudo gfind /System \( -path "/System/Volumes" -prune \) -o -type f
-print0 | /opt/local/libexec/gfrcode -0 > ${HOME}/locatedb02
Password:
$
}}}
By the way,
macOS file system supports **extended attributes**, **file flags**, and
the **Access Control Lists** (ACL). {{{/usr/bin/find}}} can look for them,
and {{{/bin/ls}}} can display them, if present.
For example, on ARM64 macOS Sonoma, **extended attributes** and **file
flags** are used for **System Integrity Protection** (SIP):
{{{
$ /bin/ls -l at a /
total 11
drwxr-xr-x 22 root wheel 704 3 10 18:56 .
drwxr-xr-x 22 root wheel 704 3 10 18:56 ..
lrwxr-xr-x 1 root admin 36 3 10 18:56 .VolumeIcon.icns ->
System/Volumes/Data/.VolumeIcon.icns
---------- 1 root admin 0 3 10 18:56 .file
drwxr-xr-x 2 root wheel 64 3 10 18:56 .nofollow
drwxr-xr-x 2 root wheel 64 3 10 18:56 .resolve
drwxr-xr-x 2 root wheel 64 3 10 18:56 .vol
drwxrwxr-x 13 root admin 416 4 26 02:20 Applications
drwxr-xr-x 67 root wheel 2144 4 26 02:20 Library
drwxr-xr-x@ 10 root wheel 320 3 10 18:56 System
com.apple.rootless 0
drwxr-xr-x 5 root admin 160 4 26 02:20 Users
drwxr-xr-x 10 root wheel 320 5 2 22:21 Volumes
drwxr-xr-x@ 39 root wheel 1248 3 10 18:56 bin
com.apple.rootless 0
drwxr-xr-x 2 root wheel 64 11 7 2020 cores
dr-xr-xr-x 4 root wheel 5244 5 2 21:41 dev
lrwxr-xr-x@ 1 root wheel 11 3 10 18:56 etc -> private/etc
com.apple.rootless 0
lrwxr-xr-x 1 root wheel 25 5 2 21:42 home ->
/System/Volumes/Data/home
drwxr-xr-x 4 root wheel 128 10 25 2023 opt
drwxr-xr-x 6 root wheel 192 5 2 21:41 private
drwxr-xr-x@ 64 root wheel 2048 3 10 18:56 sbin
com.apple.rootless 0
lrwxr-xr-x@ 1 root wheel 11 3 10 18:56 tmp -> private/tmp
com.apple.rootless 0
drwxr-xr-x@ 11 root wheel 352 3 10 18:56 usr
com.apple.rootless 0
lrwxr-xr-x@ 1 root wheel 11 3 10 18:56 var -> private/var
com.apple.rootless 0
$
$ /bin/ls -lOa /
total 11
drwxr-xr-x 22 root wheel sunlnk 704 3 10 18:56 .
drwxr-xr-x 22 root wheel sunlnk 704 3 10 18:56 ..
lrwxr-xr-x 1 root admin - 36 3 10 18:56
.VolumeIcon.icns -> System/Volumes/Data/.VolumeIcon.icns
---------- 1 root admin - 0 3 10 18:56 .file
drwxr-xr-x 2 root wheel - 64 3 10 18:56 .nofollow
drwxr-xr-x 2 root wheel - 64 3 10 18:56 .resolve
drwxr-xr-x 2 root wheel hidden 64 3 10 18:56 .vol
drwxrwxr-x 13 root admin sunlnk 416 4 26 02:20
Applications
drwxr-xr-x 67 root wheel sunlnk 2144 4 26 02:20 Library
drwxr-xr-x@ 10 root wheel restricted 320 3 10 18:56 System
drwxr-xr-x 5 root admin sunlnk 160 4 26 02:20 Users
drwxr-xr-x 10 root wheel hidden 320 5 2 22:21 Volumes
drwxr-xr-x@ 39 root wheel restricted,hidden 1248 3 10 18:56 bin
drwxr-xr-x 2 root wheel hidden 64 11 7 2020 cores
dr-xr-xr-x 4 root wheel hidden 5244 5 2 21:41 dev
lrwxr-xr-x@ 1 root wheel restricted,hidden 11 3 10 18:56 etc ->
private/etc
lrwxr-xr-x 1 root wheel hidden 25 5 2 21:42 home ->
/System/Volumes/Data/home
drwxr-xr-x 4 root wheel hidden 128 10 25 2023 opt
drwxr-xr-x 6 root wheel sunlnk,hidden 192 5 2 21:41 private
drwxr-xr-x@ 64 root wheel restricted,hidden 2048 3 10 18:56 sbin
lrwxr-xr-x@ 1 root wheel restricted,hidden 11 3 10 18:56 tmp ->
private/tmp
drwxr-xr-x@ 11 root wheel restricted,hidden 352 3 10 18:56 usr
lrwxr-xr-x@ 1 root wheel restricted,hidden 11 3 10 18:56 var ->
private/var
$
}}}
**ACL**s and **extended attributes** are used for the Time Machine and the
user accounts:
{{{
$ /bin/ls -led /Volumes/TM-22
drwxrwxr-x@ 6 maxima staff 192 5 2 00:31 /Volumes/TM-22
0: group:everyone deny
add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown
$
$ /bin/ls -l at d /Volumes/TM-22
drwxrwxr-x@ 6 maxima staff 192 5 2 21:42 /Volumes/TM-22
com.apple.backupd.BackupMachineAddress -1
com.apple.backupd.ComputerName -1
com.apple.backupd.HostUUID -1
com.apple.backupd.ModelID -1
com.apple.macl -1
com.apple.timemachine.private.structure.metadata -1
$
}}}
--
Ticket URL: <https://trac.macports.org/ticket/73455#comment:20>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list