Opened 12 years ago

Closed 7 years ago

Last modified 6 years ago

#34619 closed defect (fixed)

prevent use of unknown subports

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.4.3
Component: base Version: 2.1.1
Keywords: Cc: larryv (Lawrence Velázquez), cooljeanius (Eric Gallager), coke (Will Coleda), kurthindenburg (Kurt Hindenburg)
Port:

Description

It's possible to tell MacPorts to install a port with any arbitrary subport name, for example:

$ sudo port install zlib subport=foo
Password:
--->  Fetching distfiles for foo
--->  Verifying checksum(s) for foo
--->  Extracting foo
--->  Configuring foo
--->  Building foo
--->  Staging foo into destroot
--->  Installing foo @1.2.7_0
--->  Activating foo @1.2.7_0
Error: org.macports.activate for port foo returned: Image error: /opt/local/include/zconf.h is being used by the active zlib port.  Please deactivate this port first, or use 'port -f activate foo' to force the activation.
Please see the log file for port foo for details:
    /opt/local/var/macports/logs/_Users_rschmidt_macports_dports_archivers_zlib/foo/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port zlib failed

You could even impersonate one port with another:

$ sudo port install zlib subport=expat
--->  Fetching distfiles for expat
--->  Verifying checksum(s) for expat
--->  Extracting expat
--->  Configuring expat
--->  Building expat
--->  Staging expat into destroot
--->  Installing expat @1.2.7_0
--->  Deactivating expat @2.1.0_0
--->  Activating expat @1.2.7_0
Error: org.macports.activate for port expat returned: Image error: /opt/local/include/zconf.h is being used by the active zlib port.  Please deactivate this port first, or use 'port -f activate expat' to force the activation.
Please see the log file for port expat for details:
    /opt/local/var/macports/logs/_Users_rschmidt_macports_dports_archivers_zlib/expat/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port zlib failed

Obviously this only results in problems and MacPorts should prevent it. Expected result:

$ sudo port install zlib subport=foo
Error: port zlib does not have a subport foo

Change History (11)

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Milestone: MacPorts Future

comment:2 Changed 11 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

comment:3 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:4 Changed 9 years ago by coke (Will Coleda)

Cc: will@… added

Cc Me!

comment:5 Changed 7 years ago by kurthindenburg (Kurt Hindenburg)

Cc: kurthindenburg added

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

Resolution: fixed
Status: newclosed

In 9c48520c7347a84af603ed35ed27a96a42d57838/macports-base:

Error when a port is opened with a nonexistent subport

Closes: https://github.com/macports/macports-base/pull/28
Closes: #34619

comment:7 Changed 6 years ago by neverpanic (Clemens Lang)

Milestone: MacPorts FutureMacPorts 2.5.0

comment:8 Changed 6 years ago by neverpanic (Clemens Lang)

Milestone: MacPorts 2.5.0MacPorts Future

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

Milestone: MacPorts FutureMacPorts 2.5.0

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

In 4853357b26ae030ccc9497836137fa5d77b7a97c/macports-base:

Error when a port is opened with a nonexistent subport

Closes: https://github.com/macports/macports-base/pull/28
Closes: #34619
(cherry picked from commit 9c48520c7347a84af603ed35ed27a96a42d57838)

comment:11 Changed 6 years ago by neverpanic (Clemens Lang)

Milestone: MacPorts 2.5.0MacPorts 2.4.3
Note: See TracTickets for help on using tickets.