Summary: | sys-apps/openrc -> /lib/rc/sh/rc-cgroup.sh doesn't check permissions | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | nobody <noreply> |
Component: | OpenRC | Assignee: | OpenRC Team <openrc> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | slong |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | rc-cgroup-wperm.patch |
Description
nobody
2014-05-18 10:09:36 UTC
Created attachment 378614 [details, diff]
rc-cgroup-wperm.patch
I can confirm this, though I also get cpuacct and debug cgroup errors (obviously config-dependent.)
cgroup_cleanup() is my code, though my copyright isn't on the file. Rest looks like stuff we discussed, though not all of it, and some of it not so well-written (wouldn't get past review in #bash, if you specify sh advice.)
Anyhow attaching trivial patch to fix this specific issue; without write permission this function can never work, so it makes perfect sense to check that pre-condition in the function for robustness.
The file needs a cleanup rewrite though. I can do that easily enough, though it's a bit disappointing the sh idioms for robustness I repeatedly outlined didn't make it through.
I have a feeling the logic may need review, as outlined in comment; as well as the whole sh codebase needing a cleanup, after reviewing commit history.
I can confirm the mess spat out by `/etc/init.d/root status` as a non-root user, and that the single line added by Steve L (comment #1) fixes the cosmetic problem. I'm running amd64 multilib stable, OpenRC version 0.12.4 Actually this might be a dupe. Does anyone have any comments on the solution in bug#500364? *** This bug has been marked as a duplicate of bug 500364 *** |