Opened 4 years ago

Last modified 5 months ago

#60676 new defect

Install from source --with-no-root-privileges fails on Catalina - 'couldn't create error file for command: permission denied'

Reported by: chucko58 (Chuck Fry) Owned by:
Priority: Normal Milestone:
Component: base Version: 2.6.2
Keywords: Cc: chuck.fry@…, Dave-Allured (Dave Allured)
Port:

Description

I'm trying to install MacPorts 2.6.2 from source without root privileges on Catalina (macOS 10.15.5). This is a US Gov't owned computer and the system is heavily locked down.

I do my usual workaround for the user fullname containing backslashes (gov't insists on using MS Active Directory), then I hit this problem:

/Users/cfry/MacPorts/libexec/macports/bin/tclsh8.5 ./src/upgrade_sources_conf_default.tcl "/Users/cfry/MacPorts"
couldn't create error file for command: permission denied
    while executing
"open "|$mktemp -t macports_sources_upgrade.XXXXXXXXXX" r"
    invoked from within
"set mktempChannel [open "|$mktemp -t macports_sources_upgrade.XXXXXXXXXX" r]"
    (file "./src/upgrade_sources_conf_default.tcl" line 31)
make: *** [install] Error 1
bebop-tango:MacPorts-2.6.2 cfry$ 

I searched the archives and it appears the way to get past this is to open up permissions on the temp directory. But I can't:

bebop-tango:MacPorts-2.6.2 cfry$ temp="$(mktemp -t foo)"
bebop-tango:MacPorts-2.6.2 cfry$ echo "$temp"
/var/folders/qx/q_vy827n3tq37jvt8c02pfpczpxbgs/T/foo.LkkIu6ai
bebop-tango:MacPorts-2.6.2 cfry$ ls -l "$temp"
-rw-------  1 cfry  1286109195  0 Jun 17 18:11 /var/folders/qx/q_vy827n3tq37jvt8c02pfpczpxbgs/T/foo.LkkIu6ai
bebop-tango:MacPorts-2.6.2 cfry$ ls -ld "$(dirname "$temp")"
drwx------@ 93 cfry  1286109195  2976 Jun 17 18:11 /var/folders/qx/q_vy827n3tq37jvt8c02pfpczpxbgs/T
bebop-tango:MacPorts-2.6.2 cfry$ chmod a+rwx "$(dirname "$temp")"
chmod: Unable to change file mode on /var/folders/qx/q_vy827n3tq37jvt8c02pfpczpxbgs/T: Operation not permitted
bebop-tango:MacPorts-2.6.2 cfry$ 

I don't read tcl well enough to understand what the line in question is doing, but if all it's trying to do is get the name of a temp file from 'mktemp -t' as I suspect, I am at a loss to explain why it doesn't work.

Change History (2)

comment:1 Changed 3 years ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:2 Changed 5 months ago by jmroot (Joshua Root)

There have been similar errors in the past when users had unusual permissions set on /private/tmp, for example #50867.

Note: See TracTickets for help on using tickets.