Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 666246 - sys-libs/musl ldconfig does not respect -r/$ROOT
Summary: sys-libs/musl ldconfig does not respect -r/$ROOT
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-09-14 20:46 UTC by Wiktor Kerr
Modified: 2018-09-26 12:13 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed fix (0001-sys-libs-musl-make-ldconfig-script-respect-r.patch,1.13 KB, patch)
2018-09-14 20:46 UTC, Wiktor Kerr
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wiktor Kerr 2018-09-14 20:46:04 UTC
Created attachment 546966 [details, diff]
Proposed fix

emerge --root=/foo calls ldconfig -r -X /foo. However, the ldconfig script bundled with the ebuild ignores the argument.

When running emerge as user this manifests in most emerges asking:

mv: replace '/etc/ld-musl-x86_64.path', overriding mode 0644 (rw-r--r--)?

When running as root, it is even worse as the file in / is silently overwritten and the file in /foo is never created.

Attached proposed patch that fixes the issue.
Comment 1 Wiktor Kerr 2018-09-14 20:51:20 UTC
>emerge --root=/foo calls ldconfig -r -X /foo.

Of course I meant ldconfig -X -r /foo.
Comment 2 Anthony Basile gentoo-dev 2018-09-26 12:11:13 UTC
(In reply to Wiktor Kerr from comment #1)
> >emerge --root=/foo calls ldconfig -r -X /foo.
> 
> Of course I meant ldconfig -X -r /foo.

i haven't had a chance to look at this, but i assume you've tested emerging both with and without --root=/foo  I don't want to commit this and break existing systems.  the patch seems correct but i'd like confirmation that it works in both cases.
Comment 3 Anthony Basile gentoo-dev 2018-09-26 12:13:47 UTC
(In reply to Anthony Basile from comment #2)
> (In reply to Wiktor Kerr from comment #1)
> > >emerge --root=/foo calls ldconfig -r -X /foo.
> > 
> > Of course I meant ldconfig -X -r /foo.
> 
> i haven't had a chance to look at this, but i assume you've tested emerging
> both with and without --root=/foo  I don't want to commit this and break
> existing systems.  the patch seems correct but i'd like confirmation that it
> works in both cases.

like here's the kind of thing i'm concerned about.  there is a sanity check near the top:

LDSO_CONF="/etc/ld.so.conf"
if [[ ! -e $LDSO_CONF ]]; then
	echo "$LDSO_CONF not found" >&2
	exit 1
fi


this will only check the current root's ld.so.conf, not $ROOT/ld.so.conf.