core: switch to using rpath for clasic confinement. #1094

Merged
merged 1 commit into from Feb 1, 2017

Conversation

Projects
None yet
2 participants
Collaborator

sergiusens commented Jan 31, 2017

From _dl_map_object in elf/dl-load.c:

Unless loading object has RUNPATH:
    RPATH of the loading object,
        then the RPATH of its loader (unless it has a RUNPATH), ...,
        until the end of the chain, which is either the executable
        or an object loaded by dlopen
    Unless executable has RUNPATH:
        RPATH of the executable
LD_LIBRARY_PATH
RUNPATH of the loading object
ld.so.cache
default dirs

LP: #1657504

Signed-off-by: Sergio Schvezov sergio.schvezov@canonical.com

core: switch to using rpath for clasic confinement.
From _dl_map_object in elf/dl-load.c:

Unless loading object has RUNPATH:
    RPATH of the loading object,
        then the RPATH of its loader (unless it has a RUNPATH), ...,
        until the end of the chain, which is either the executable
        or an object loaded by dlopen
    Unless executable has RUNPATH:
        RPATH of the executable
LD_LIBRARY_PATH
RUNPATH of the loading object
ld.so.cache
default dirs

LP: #1657504

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>

kyrofa approved these changes Jan 31, 2017

Indeed, or in sentence form (from wikipedia): "If the new-dtags feature is enabled in the linker (--enable-new-dtags), GNU ld, besides setting the DT_RPATH attribute, also sets the DT_RUNPATH attribute to the same string. At run time, if the dynamic linker finds a DT_RUNPATH attribute, it ignores the value of the DT_RPATH attribute, with the effect that LD_LIBRARY_PATH is checked first and the paths in the DT_RUNPATH attribute are only searched afterwards." 👍

@sergiusens sergiusens merged commit e174e46 into snapcore:master Feb 1, 2017

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
xenial-amd64 autopkgtest finished (success)
Details
zesty-amd64 autopkgtest finished (success)
Details

@sergiusens sergiusens deleted the sergiusens:bugfix/rpath-runpath branch Feb 1, 2017

elopio added a commit that referenced this pull request Feb 28, 2017

core: switch to using rpath for clasic confinement. (#1094)
From _dl_map_object in elf/dl-load.c:

Unless loading object has RUNPATH:
    RPATH of the loading object,
        then the RPATH of its loader (unless it has a RUNPATH), ...,
        until the end of the chain, which is either the executable
        or an object loaded by dlopen
    Unless executable has RUNPATH:
        RPATH of the executable
LD_LIBRARY_PATH
RUNPATH of the loading object
ld.so.cache
default dirs

LP: #1657504

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>

kalikiana pushed a commit to kalikiana/snapcraft that referenced this pull request Apr 6, 2017

core: switch to using rpath for clasic confinement. (#1094)
From _dl_map_object in elf/dl-load.c:

Unless loading object has RUNPATH:
    RPATH of the loading object,
        then the RPATH of its loader (unless it has a RUNPATH), ...,
        until the end of the chain, which is either the executable
        or an object loaded by dlopen
    Unless executable has RUNPATH:
        RPATH of the executable
LD_LIBRARY_PATH
RUNPATH of the loading object
ld.so.cache
default dirs

LP: #1657504

Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment