Skip to content

pkg_add.c: Resolve the shlib symlink before recursing into pkg_add - #2774

Merged
bapt merged 1 commit into
freebsd:mainfrom
arrowd:shlib-symlink-resolve
Nov 4, 2026
Merged

bapt merged 1 commit into
freebsd:mainfrom
arrowd:shlib-symlink-resolve

Conversation

@arrowd

@arrowd arrowd commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This subtle bug can be reproduced when pkg_add recurses through different types of dependencies - deps and requires. The path passed into pkg_add_check_pkg_archive() is expected to start with "All/", but after handling a shlib requirement and recursing down it changes to "shlibs/". At the bottom the code ends up doing

access("/../shlibs/libconsumer.so.1/package1-1.pkg",F_OK) ERR#2 'No such file or directory'

instead of

access("/../All/libconsumer.so.1/package1-1.pkg",F_OK) 0 = (0x0)

The added test case fails without this fix.

This subtle bug can be reproduced when pkg_add recurses through different
types of dependencies - deps and requires. The path passed into
pkg_add_check_pkg_archive() is expected to start with "All/", but after
handling a shlib requirement and recursing down it changes to "shlibs/".
At the bottom the code ends up doing

access("/../shlibs/libconsumer.so.1/package1-1.pkg",F_OK) ERR#2 'No such file or directory'

instead of

access("/../All/libconsumer.so.1/package1-1.pkg",F_OK) 0 = (0x0)

The added test case fails without this fix.
@bapt
bapt merged commit 0b34606 into freebsd:main Nov 4, 2026
7 checks passed
@arrowd
arrowd deleted the shlib-symlink-resolve branch November 4, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants