Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#56721 closed defect (fixed)

exec_as_uid sometimes incorrectly drops privileges before returning

Reported by: Gord-Butler Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.5.3
Component: base Version: 2.5.2
Keywords: Cc:
Port:

Description

During an attempt to upgrade ports (version 2.5.2 on OSX 10.9), avahi could not be rebuilt because MacPorts couldn't build a directory. The error message given is below.

Error: Couldn't activate avahi 0.7_3+gtk+gtk3+quartz: can't create directory "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_net_avahi": permission denied
Error: rev-upgrade failed: Error rebuilding avahi

Change History (12)

comment:1 Changed 6 years ago by mf2k (Frank Schima)

Keywords: avahi mavericks 10.9 removed

comment:2 Changed 6 years ago by kencu (Ken)

This has been happening to me lately on various systems and with various ports, most often dbus.

Try just doing sudo port activate avahi and then select the right one (the last one) from the list that pops up. This has worked for me in every case so far.

comment:3 Changed 6 years ago by jmroot (Joshua Root)

Could you attach the log please?

comment:4 Changed 6 years ago by jmroot (Joshua Root)

This problem can't be reproduced on High Sierra. It will be very difficult to investigate further without a log or debug output.

comment:5 Changed 6 years ago by Gord-Butler

I couldn't find a log. All I got was the message stating it couldn't create a folder at the location stated in the error message.

comment:6 Changed 6 years ago by jmroot (Joshua Root)

The log path will be shown by port logfile avahi. If there isn't one then please run the command with the -d option to generate debug output.

comment:7 Changed 6 years ago by Gord-Butler

I ran the upgrade with the -d option. This is the output.

sudo port upgrade avahi -d
--->  Scanning binaries for linking errors
--->  Found 17 broken files, matching files to ports     
--->  Found 4 broken ports, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt:
 avahi @0.7+gtk+gtk3+quartz
 gegl @0.2.0-20180218+quartz
 opencv @3.3.1
 gmic @2.2.2
Continue? [Y/n]: Y
Error: Couldn't activate avahi 0.7_3+gtk+gtk3+quartz: can't create directory "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_net_avahi": permission denied
Error: rev-upgrade failed: Error rebuilding avahi
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

I was able to activate it with sudo port activate avahi and selecting the last option on the list, though.

Last edited 6 years ago by Gord-Butler (previous) (diff)

comment:8 Changed 6 years ago by jmroot (Joshua Root)

Sorry, the -d needs to go between port and upgrade. Putting it at the end attempts to turn off a variant called "d".

comment:9 Changed 6 years ago by jmroot (Joshua Root)

Component: portsbase
Port: avahi removed
Summary: Cannot activate avahi 0.7_3+gtk+gtk3+quartzexec_as_uid sometimes incorrectly drops privileges before returning

I may have found the problem.

comment:10 Changed 6 years ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In 4b36e605d76fa3a423b4e35a6722ade4185ffa4f/macports-base (master):

Fix restoring previous euid in exec_as_uid

Fixes: #56721

comment:11 Changed 6 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.5.3

comment:12 Changed 6 years ago by jmroot (Joshua Root)

In 5766cfed60233f3ffd7cc7e582bf81d47490c55f/macports-base (release-2.5):

Fix restoring previous euid in exec_as_uid

Fixes: #56721
(cherry picked from commit 4b36e605d76fa3a423b4e35a6722ade4185ffa4f)

Note: See TracTickets for help on using tickets.