Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 278811

Summary: sci-misc/boinc initscript is not /bin/sh-compliant
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Tomáš Chvátal (RETIRED) <scarabeus>
Status: RESOLVED FIXED    
Severity: minor CC: sci
Priority: High Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch to fix init.d script

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-23 09:10:48 UTC
Initscript installed with =sci-misc/boinc-6.4.5-r2 does contain many bashisms which cause it to not work correctly when /bin/sh is not bash as OpenRC's runscript runs init.d scripts with /bin/sh.

Issue noticed with =app-shells/dash-0.5.5.1.2 and =sys-apps/openrc-9999.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-23 09:36:59 UTC
Created attachment 198884 [details, diff]
Patch to fix init.d script

I've replaced all '[[' occurences with standard '['; broken down '-a' within '[' to two tests (it's an XSI extension); added quoting in many places to avoid problems with spaces (especially in filenames and all user-supplied values).

I've also removed all 'pushd's and replaced them with standard 'cd'. I don't see any reason to use them as init.d scripts are called as a subshell and thus parent shell remains in the same dir. Moreover, one of those 'pushd's had no 'popd' (;.
Comment 2 Tomáš Chvátal (RETIRED) gentoo-dev 2009-07-24 10:58:57 UTC
Thanks for patch.
Added to the cvs :]