Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix crash bug in linux_sysctl.assign() on Virtuozzo containers #635

Merged
merged 1 commit into from

2 participants

@0xDEC0DE

On systems like Virtuozzo containers, "sysctl -w" is not allowed, ever, and will fail with EPERM errors even if one is root. Since assign() doesn't check exit status or the returned string, this leads to a nasty-looking stack trace.

Nicolas Simonds fix crash bug in linux_sysctl.assign() on Virtuozzo containers
On systems like Virtuozzo containers, "sysctl -w" is not allowed,
ever, and will fail with ENOPERM errors even if one is root.  Since
assign() doesn't check exit status or the returned string, this
leads to a nasty stack trace.
4e1c367
@SEJeff SEJeff merged commit af7ea3d into saltstack:develop
@SEJeff
Owner

It was good seeing you last night @ Corey's talk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 3, 2012
  1. fix crash bug in linux_sysctl.assign() on Virtuozzo containers

    Nicolas Simonds authored
    On systems like Virtuozzo containers, "sysctl -w" is not allowed,
    ever, and will fail with ENOPERM errors even if one is root.  Since
    assign() doesn't check exit status or the returned string, this
    leads to a nasty stack trace.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  salt/modules/linux_sysctl.py
View
2  salt/modules/linux_sysctl.py
@@ -65,6 +65,8 @@ def assign(name, value):
cmd = 'sysctl -w {0}={1}'.format(name, value)
ret = {}
out = __salt__['cmd.run'](cmd).strip()
+ if ' = ' not in out:
+ raise CommandExecutionError('sysctl -w failed: {0}'.format(out))
comps = out.split(' = ')
ret[comps[0]] = comps[1]
return ret
Something went wrong with that request. Please try again.