Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 650854 - sys-devel/distcc: init script should use checkpath instead of mkdir/chown
Summary: sys-devel/distcc: init script should use checkpath instead of mkdir/chown
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-19 08:04 UTC by Georgy Yakovlev
Modified: 2022-05-31 07:02 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 Georgy Yakovlev archtester gentoo-dev 2018-03-19 08:04:05 UTC
There was a long discussion about that

https://bugs.gentoo.org/540006

currently distcc initscript calls chown as a part of start function

start() {
	ebegin "Starting distccd"

	if [ ! -e /var/run/distccd ] ; then
		mkdir -p /var/run/distccd
		chown distcc:daemon /var/run/distccd
	fi
...skip...
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-08 12:47:39 UTC
Could you please commit a fix for this?  I'm not using OpenRC, so can't test it.  No need to send patch for review, I trust you.
Comment 2 Larry the Git Cow gentoo-dev 2018-12-09 06:40:54 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffd45776bb13d8ee7140fd5499413a7ffa873798

commit ffd45776bb13d8ee7140fd5499413a7ffa873798
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2018-12-09 06:17:53 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2018-12-09 06:35:53 +0000

    sys-devel/distcc: improve init.d script, secure pidfile handling
    
    removed unneeded start/stop functions
    
    removed gcc spec/path loading, it's useless because
    path whitelist is handled by compiler-shadow and we no longer
    use gcc specs.
    
    pidfile is now owned by root and created by s-s-d
    pidfile path is now controlled by service name (/run/distccd.pid)
    initfile no longer runs chmod on pidfile and parent directory.
    
    Bug: https://bugs.gentoo.org/650854
    Package-Manager: Portage-2.3.52, Repoman-2.3.12
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 sys-devel/distcc/distcc-3.3.2-r1.ebuild | 196 ++++++++++++++++++++++++++++++++
 sys-devel/distcc/files/distccd.confd    |  37 ++++++
 sys-devel/distcc/files/distccd.initd    |  13 +++
 3 files changed, 246 insertions(+)
Comment 3 Georgy Yakovlev archtester gentoo-dev 2018-12-09 06:47:30 UTC
ok I pushed updated openrc script, much better than it was but still not ideal.

I've found more openrc related bugs, most are pretty old.
I'll go thru them and will try to fix as time permits.




here's the list.

https://bugs.gentoo.org/493680  =sys-devel/distcc-3.1 - /etc/conf.d/distccd: set log level severity to something more severe than "notice"

https://bugs.gentoo.org/350209  access violation when using distcc with DISTCC_LOG

https://bugs.gentoo.org/477630  - ERROR: failed to open /var/log/distccd.log: Permission denied

https://bugs.gentoo.org/340595 -  Support for multiple distccd instances

also logging needs some attention. Upstream recommends using logfile, not syslog. and default is syslog now. And it needs logrotate file.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-09 08:38:59 UTC
Thanks for taking care of it.
Comment 5 crabbed halo ablution 2020-12-17 19:03:19 UTC
I think this bug is FIXED now by commit ffd45776bb13d8ee7140fd5499413a7ffa873798 as seen above. The other bugs mentioned have their own open bugs.