Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#30332 closed defect (duplicate)

MacPorts fails to open a portfile due to denied permissions

Reported by: mkae (Marko Käning) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.0.0
Keywords: Cc:
Port:

Description

I recently upgraded to MacPorts 2.0.0.

It looks like I have found a MacPorts permission problem now.

Here is an example of a usual workflow when I work with a local port tree.

  • Right at the beginning one sees that the install of kdepimlibs4 fails.
  • A look at the log file reveals that MacPorts changes gid and uid to 505 and 511 respectively being the macports user.
  • dscl shows that marko has uid 502
  • ls -l shows that the Portfile should be readable to anyone, BUT IT ISN'T OBVIOUSLY. :-(
[ MP-devel ] :kdepimlibs4 marko$ sudo port install
Error: Unable to execute port: could not read "/Users/marko/WC/MacPorts/ports/kde/kdepimlibs4/Portfile": permission denied
To report a bug, see <http://guide.macports.org/#project.tickets>
[ MP-devel ] :kdepimlibs4 marko$ 
[ MP-devel ] :kdepimlibs4 marko$ 
[ MP-devel ] :kdepimlibs4 marko$ 
[ MP-devel ] :kdepimlibs4 marko$ tail /opt/macports-test/var/macports/logs/_Users_marko_WC_MacPorts_ports_kde_kdepimlibs4/kdepimlibs4/main.log
:debug:main Found Dependency: receipt exists for openldap
:debug:main Searching for dependency: gpgme
:debug:main Found Dependency: receipt exists for gpgme
:msg:main 
:debug:main Executing org.macports.main (kdepimlibs4)
:debug:main changing euid/egid - current euid: 0 - current egid: 0
:debug:main egid changed to: 505
:debug:main euid changed to: 511
:info:main Warning: the following items did not execute (for kdepimlibs4): org.macports.activate org.macports.archivefetch org.macports.fetch org.macports.checksum org.macports.extract org.macports.patch org.macports.configure org.macports.build org.macports.destroot org.macports.install
:notice:main Log for kdepimlibs4 is at: /opt/macports-test/var/macports/logs/_Users_marko_WC_MacPorts_ports_kde_kdepimlibs4/kdepimlibs4/main.log
[ MP-devel ] :kdepimlibs4 marko$ 
[ MP-devel ] :kdepimlibs4 marko$ 
[ MP-devel ] :kdepimlibs4 marko$ 
[ MP-devel ] :kdepimlibs4 marko$ dscl localhost -read /Local/Default/Users/marko | tailNFSHomeDirectory: /Users/marko
Password: ********
Picture:
 /Library/User Pictures/Nature/Cactus.tif
PrimaryGroupID: 20
RealName: Marko
RecordName: marko
RecordType: dsRecTypeStandard:Users
UniqueID: 502
UserShell: /bin/bash
[ MP-devel ] :kdepimlibs4 marko$ 
[ MP-devel ] :kdepimlibs4 marko$ 
[ MP-devel ] :kdepimlibs4 marko$ 
[ MP-devel ] :kdepimlibs4 marko$ ls  -l
total 24
-rw-r--r--  1 marko  staff  1220 Jul 18 19:31 Portfile
-rw-r--r--  1 marko  staff  1220 Jul 18 17:26 Portfile.my
lrwxr-xr-x  1 root   staff   101 Jul 24 01:01 work -> /opt/macports-test/var/macports/build/_Users_marko_WC_MacPorts_ports_kde_kdepimlibs4/kdepimlibs4/work

Change History (8)

comment:1 Changed 13 years ago by jmroot (Joshua Root)

Component: portsbase
Owner: changed from macports-mgr@… to macports-tickets@…
Port: port removed
Summary: MacPorts tails to open a portfile due to denied permissionsMacPorts fails to open a portfile due to denied permissions

comment:2 Changed 13 years ago by jmroot (Joshua Root)

Resolution: duplicate
Status: newclosed

Same basic problem as #26094. I could never reproduce it either…

comment:3 Changed 13 years ago by pixilla (Bradley Giesbrecht)

What are the permissions on /Users/marko/WC/MacPorts/ports/kde/kdepimlibs4?

comment:4 Changed 13 years ago by mkae (Marko Käning)

Nothing unusual:

$ ls -la /Users/marko/WC/MacPorts/ports/kde/kdepimlibs4
total 24
drwxr-xr-x   5 marko  staff   170 Jul 24 01:01 .
drwxr-xr-x  15 marko  staff   510 Jun 19 13:00 ..
-rw-r--r--   1 marko  staff  1220 Jul 18 19:31 Portfile
-rw-r--r--   1 marko  staff  1220 Jul 18 17:26 Portfile.my

comment:5 Changed 13 years ago by pixilla (Bradley Giesbrecht)

I was wondering if the permission on the directory /Users/marko/WC/MacPorts/ports/kde/kdepimlibs4 had ugo+x so everyone could access.

comment:6 Changed 13 years ago by pixilla (Bradley Giesbrecht)

Can you quite Terminal.app, relaunch Terminal.app and do:

$ ls -la /Users/marko/WC/MacPorts/ports/kde/kdepimlibs4
$ open /Users/marko/WC/MacPorts/ports/kde/kdepimlibs4

Verify that the file Portfile actually exists.

comment:7 Changed 13 years ago by marc.schlaich@…

Workaround is setting macportsuser to root.

comment:8 Changed 13 years ago by mkae (Marko Käning)

I see, well, I've found now why it happens. A directory higher up had too restrictive permissions which is why this was bound to fail. See my comment in ticket #26094!

Note: See TracTickets for help on using tickets.