Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 278811 - sci-misc/boinc initscript is not /bin/sh-compliant
Summary: sci-misc/boinc initscript is not /bin/sh-compliant
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High minor
Assignee: Tomáš Chvátal (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2009-07-23 09:10 UTC by Michał Górny
Modified: 2009-07-24 10:58 UTC (History)
1 user (show)

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


Attachments
Patch to fix init.d script (boinc.init.diff,4.11 KB, patch)
2009-07-23 09:36 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 :]