Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 541334 - net-p2p/bitcoind-0.10.0 init script's 'checkpath' call fails, because it's performed on a symlink
Summary: net-p2p/bitcoind-0.10.0 init script's 'checkpath' call fails, because it's pe...
Status: RESOLVED FIXED
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:
Depends on:
Blocks:
 
Reported: 2015-02-25 11:43 UTC by Florian Schmaus
Modified: 2015-03-14 15:33 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Schmaus gentoo-dev 2015-02-25 11:43:53 UTC
The ebuild install the bitcoin.conf in /etc/bitcoin and creates a symlink from /var/lib/bitcoin/.bitcoin/bitcoinf → /etc/bitcoin/bitcoin.conf

Later in the init script there is

checkpath -f -o ${bitcoind_user} -m 0400 ${conffile} || return 1

which failes with

+ checkpath -f -o bitcoin -m 0400 /var/lib/bitcoin/.bitcoin/bitcoin.conf
 * checkpath: chmod: /var/lib/bitcoin/.bitcoin/bitcoin.conf  is a symbolic link

the line should be changed to

checkpath -f -o ${bitcoind_user} -m 0400 $(readlink -f ${conffile}) || return 1


Reproducible: Always

Steps to Reproduce:
1.emerge =net-p2p/bitcoind-0.10.0
2. /etc/init.d/bitcoind start
Comment 1 Florian Schmaus gentoo-dev 2015-02-25 11:55:25 UTC
Related OpenRC bug and change: https://bugs.gentoo.org/show_bug.cgi?id=540006
Comment 2 Luke-Jr 2015-02-26 00:24:19 UTC
Doesn't your proposed fix merely reintroduce the security problems in bug 540006? Is there a better way we could/should do this?
Comment 3 Florian Schmaus gentoo-dev 2015-02-26 08:23:36 UTC
Well, I think the sound solution would be to reverse the direction of the symlink.
Comment 4 Luke-Jr 2015-03-03 09:47:01 UTC
The (current) init script doesn't appear to ever call checkpath, and upstream's init script seems to use it safely. Not sure how you're getting this problem, but can you test 0.10.0-r1 from the overlay, which now uses upstream's (patched for backward compatibility)?
Comment 6 Luke-Jr 2015-03-03 09:59:23 UTC
(In reply to Florian Schmaus from comment #5)
> It does use 'checkpath', see
> http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-p2p/bitcoind/
> files/bitcoin.initd-r1?revision=1.1&view=markup Line 22

Strange, looks like that file missed a number of updates somehow. Can you confirm the overlay/upstream version(s) work okay?
Comment 7 Anthony Basile gentoo-dev 2015-03-04 00:32:48 UTC
please check the tree version which i just added.
Comment 8 Anthony Basile gentoo-dev 2015-03-14 15:33:18 UTC
Assuming this is fixed.  Reopen if its still a problem.