[MacPorts] #73369: inetutils: Install fails with non-root installation because it can't find grcp
MacPorts
noreply at macports.org
Fri Jan 9 22:56:26 UTC 2026
#73369: inetutils: Install fails with non-root installation because it can't find
grcp
--------------------------+-------------------------
Reporter: AgilentGCMS | Owner: Schamschula
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.11.6
Resolution: | Keywords:
Port: inetutils |
--------------------------+-------------------------
Comment (by ryandesign):
Replying to [comment:13 Marius Schamschula <mschamschula@…>]:
> add ui_msg regarding non-root installs
Two suggestions about that. First, use `notes` instead of manually
printing messages with `ui_msg`. Second, reword the message to no longer
say "be sure to install inetutils as root" because that's not really an
easy thing for a user to do. You're instructing the user to uninstall
MacPorts and all ports and reinstall MacPorts as root, which is extremely
invasive and may not be something the user is even able to do if they
don't have administrator privileges. (Users don't tend to go to the
trouble to install MacPorts without root privileges and endure building
all ports from source unless they have a good reason.) Instead, the
message might just explain to the user that because they've installed
MacPorts without root privileges, the following executables are not
installed. And then fix the port so that it can actually be installed
without root.
And in fact I see I was wrong [comment:9 above] about the specific cause:
the Portfile does already know to make symlinks only to those executables
that were installed:
{{{#!tcl
xinstall -m 755 -d ${destroot}${prefix}/libexec/gnubin
foreach binary [glob -tails -directory ${destroot}${prefix}/bin
g*] {
ln -s ${prefix}/bin/${binary}
${destroot}${prefix}/libexec/gnubin/[string range $binary 1 end]
}
}}}
However it also changes persmissions on three executables without first
verifying that those executables were installed; that's the problem:
{{{#!tcl
file attributes ${destroot}${prefix}/bin/grcp -permissions +s
file attributes ${destroot}${prefix}/bin/grlogin -permissions +s
file attributes ${destroot}${prefix}/bin/grsh -permissions +s
}}}
I also wonder why the port wants to change the permissions of these three
executables. `+s` means add the setuid bit. Shouldn't the Makefile have
set that already? Maybe these three lines can simply be removed.
And we saw that the build skipped six executables because they wanted
setuid. So why does the Portfile only try to deal with three of them?
Looking on my system for a root MacPorts installation, all six of the
executables were installed with the setuid bit set (lines beginning with
`-rws`):
{{{
% port -qv installed inetutils
inetutils @2.6_1+client (active) requested_variants='' platform='darwin
21' archs='x86_64' date='2025-08-19T17:52:32-0500'
% port -q contents inetutils | xargs ls -ld | grep '^-.*/bin/'
-rwxr-xr-x 1 root admin 90848 Aug 19 17:52
/opt/local/bin/gdnsdomainname
-rwxr-xr-x 1 root admin 176600 Aug 19 17:52 /opt/local/bin/gftp
-rwxr-xr-x 1 root admin 92136 Aug 19 17:52 /opt/local/bin/glogger
-rwsr-xr-x 1 root admin 96512 Aug 19 17:52 /opt/local/bin/gping
-rwsr-xr-x 1 root admin 94616 Aug 19 17:52 /opt/local/bin/gping6
-rwsr-sr-x 1 root admin 94200 Aug 19 17:52 /opt/local/bin/grcp
-rwxr-xr-x 1 root admin 91224 Aug 19 17:52 /opt/local/bin/grexec
-rwsr-sr-x 1 root admin 92840 Aug 19 17:52 /opt/local/bin/grlogin
-rwsr-sr-x 1 root admin 91600 Aug 19 17:52 /opt/local/bin/grsh
-rwxr-xr-x 1 root admin 94488 Aug 19 17:52 /opt/local/bin/gtalk
-rwxr-xr-x 1 root admin 172808 Aug 19 17:52 /opt/local/bin/gtelnet
-rwxr-xr-x 1 root admin 95976 Aug 19 17:52 /opt/local/bin/gtftp
-rwsr-xr-x 1 root admin 94360 Aug 19 17:52 /opt/local/bin/gtraceroute
}}}
This supports the idea that the three `file attributes` lines in the
Portfile are unnecessary and removing them should fix this bug.
The lines [changeset:6ca221fb4835dfbf0867670e7508cada03fe9467/macports-
ports were added] in 2018 when the port was at version 1.9.4. The commit
message doesn't say why, and checking the 1.9.4 source code, the Makefile
did already contain the code to set the setuid bit of rcp, rsh, rlogin,
and traceroute.
--
Ticket URL: <https://trac.macports.org/ticket/73369#comment:15>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list