Skip to contentSkip to conversation

Bad rpath in cpupower with 4.0-rcX

DISCUSSION Josh Boyer 4 participants 5 messages Mar 6, 2015 – Mar 11, 2015

lore
Share & tools
lore

Josh Boyer

author
#0 lore raw

Hi All,

Commit 5c1de006e8e66 (cpupower Makefile change to help run the tool without 'make install') added an rpath to the cpupower binary. From what I can understand, this is to make it easier to run cpupower from the local build directory without having to run make install. It does accomplish that, but it also leaves the binary with the rpath in it which is considered bad practice. It also causes cpupower to fail in rpmbuild with the following error:

ERROR 0004: file '/usr/bin/cpupower' contains an insecure rpath './'
in [./]
error: Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)
Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)

I understand the want for eased development, but couldn't people just set LD_LIBRARY_PATH instead?

josh

author
#1 lore raw
Quoted 10 lines · Josh Boyer

Hi All,

Commit 5c1de006e8e66 (cpupower Makefile change to help run the tool without 'make install') added an rpath to the cpupower binary. From what I can understand, this is to make it easier to run cpupower from the local build directory without having to run make install. It does accomplish that, but it also leaves the binary with the rpath in it which is considered bad practice. It also causes cpupower to fail in rpmbuild with the following error:

Quoted 7 lines

ERROR 0004: file '/usr/bin/cpupower' contains an insecure rpath './'
in [./]
error: Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)
Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)

I understand the want for eased development, but couldn't people just set LD_LIBRARY_PATH instead?

No comments on this? Should I just send a revert patch instead?

josh

#2 lore raw
Quoted 16 lines · Josh Boyer
Quoted 15 lines · Josh Boyer

Hi All,

Commit 5c1de006e8e66 (cpupower Makefile change to help run the tool without 'make install') added an rpath to the cpupower binary. From what I can understand, this is to make it easier to run cpupower from the local build directory without having to run make install. It does accomplish that, but it also leaves the binary with the rpath in it which is considered bad practice. It also causes cpupower to fail in rpmbuild with the following error:

ERROR 0004: file '/usr/bin/cpupower' contains an insecure rpath './'
in [./]
error: Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)
Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)

Quoted 4 lines
Quoted 2 lines

I understand the want for eased development, but couldn't people just set LD_LIBRARY_PATH instead?

No comments on this? Should I just send a revert patch instead?

You can do that.

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#3 lore raw
Quoted 2 lines · Rafael J. Wysocki
Quoted 1 line · Josh Boyer

On Fri, Mar 6, 2015 at 8:47 AM, Josh Boyer <[email protected]>

Quoted 14 lines · wrote:
Quoted 14 lines
Quoted 14 lines

Hi All,

Commit 5c1de006e8e66 (cpupower Makefile change to help run the tool without 'make install') added an rpath to the cpupower binary. From what I can understand, this is to make it easier to run cpupower from the local build directory without having to run make install. It does accomplish that, but it also leaves the binary with the rpath in it which is considered bad practice. It also causes cpupower to fail in rpmbuild with the following error:

ERROR 0004: file '/usr/bin/cpupower' contains an insecure rpath './'
in [./]
error: Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)

I understand the want for eased development, but couldn't people just set LD_LIBRARY_PATH instead?

No comments on this? Should I just send a revert patch instead?

I agree adding . as library path was not a good idea. This probably is also a potential security issue.

What I do is building the libraries statically into the binary when testing. I will send a Makefile change introducing a static = true/false variable to do that easily.

Quoted 1 line

You can do that.

Thanks for sending the revert, it's the right thing to do.

Thomas

#4 lore raw

Sorry for the change.

Quoted 37 lines · Thomas Renninger
Quoted 2 lines · Rafael J. Wysocki
Quoted 1 line · Josh Boyer

On Fri, Mar 6, 2015 at 8:47 AM, Josh Boyer <[email protected]>

Quoted 14 lines · wrote:
Quoted 14 lines
Quoted 14 lines

Hi All,

Commit 5c1de006e8e66 (cpupower Makefile change to help run the tool without 'make install') added an rpath to the cpupower binary. From what I can understand, this is to make it easier to run cpupower from the local build directory without having to run make install. It does accomplish that, but it also leaves the binary with the rpath in it which is considered bad practice. It also causes cpupower to fail in rpmbuild with the following error:

ERROR 0004: file '/usr/bin/cpupower' contains an insecure rpath './'
in [./]
error: Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Bad exit status from /var/tmp/rpm-tmp.A6u26r (%install)

I understand the want for eased development, but couldn't people just set LD_LIBRARY_PATH instead?

No comments on this? Should I just send a revert patch instead?

I agree adding . as library path was not a good idea. This probably is also a potential security issue.

What I do is building the libraries statically into the binary when testing. I will send a Makefile change introducing a static = true/false variable to do that easily.

Quoted 1 line

You can do that.

Thanks for sending the revert, it's the right thing to do.

Thomas