Github messages for voidlinux
 help / color / mirror / Atom feed
From: github-actions[bot] <github-actions[bot]>
Subject: Re: [ISSUE] [CLOSED] [RFC] lint for invalid/insecure rpath in binaries and libraries
Date: Sat, 18 Jun 2022 04:12:51 +0200	[thread overview]
Message-ID: <20220618021251.WrvidIA3nuureEMOSiX0XhTages5XLKru-Q7TVACTZ4@z> (raw)
In-Reply-To: <>

[-- Attachment #1: Type: text/plain, Size: 2022 bytes --]

Closed issue by tornaria on void-packages repository

I'm compling a library that will "leak" the install directories in rpaths. I mean `/destdir/*`.

I catched it just by chance, so I wonder if it would make sense to check for that and warn/error for bad rpaths like those.

Here's a quick hack. I put this in `common/hooks/post-install/`. I'm not sure it belongs there or in `pre-pkg`, but seems to work ok there.

# check rpath
# see:

hook() {
        find ${PKGDESTDIR} -type f | while read f; do
        read -n4 elfmagic < "$f"
        if [ "$elfmagic" = $'\177ELF' ]; then
                        for rpath in $($OBJDUMP -p "$f"|awk '/RPATH/{print $2}'); do
                                case $rpath in
                                                msg_warn "invalid RPATH=$rpath in $lf\n"
                                                msg_normal "RPATH=$rpath in $lf\n"

Have a look at for a stricter approach, namely:
 - allow only rpaths not starting with /lib, /usr/lib,  $ORIGIN, etc.
 - for those, check that the actual path exists in the package.
 - everything else: warn (could be error, maybe with some way to skip)

Maybe some explanation in the manual would also be helpful, and a suggestion on how to fix it if it can't be disabled in configure/make. What I did was add `chrpath` to `hostmakedepends`, and run `chrpath -d FILES` from `post_install()`.

      parent reply	other threads:[~2022-06-18  2:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 23:11 [ISSUE] " tornaria
2021-08-30 23:17 ` ericonr
2022-06-04  2:09 ` github-actions
2022-06-18  2:12 ` github-actions [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220618021251.WrvidIA3nuureEMOSiX0XhTages5XLKru-Q7TVACTZ4@z \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).