Commit Graph

7 Commits

Author SHA1 Message Date
Thierry Carrez a694b9e5ad Restore SIGPIPE default action for subprocesses
Python ignores SIGPIPE on startup, because it prefers to check every
write and raise an IOError exception rather than taking the signal. Most
Unix subprocesses don't expect to work this way. This patch (adapted
from Colin Watson's post at http://tinyurl.com/2a7mzh5) sets SIGPIPE
back to the default action for nova.utils.execute and nova-rootwrap
created subprocesses.

Fixes bug 1053364

Change-Id: I17e1629bb4ef4268515c6734ddb6e12746739c52
2012-09-20 15:24:14 +02:00
Joe Gordon b0392d3017 OpenStack capitalization added to HACKING.rst
Along with capitalization fixes to comments in code

Change-Id: I72ddc582001f80d954ca5a121903c689f40d08d1
2012-08-17 15:59:32 -05:00
Thierry Carrez 1d447e69f9 Deprecate root_helper in favor of rootwrap_config
Mark the root_helper option deprecated and introduce usage of
the rootwrap_config option instead. The root_helper option will
still fully be supported in Folsom, but will be removed in Grizzly.

Transition notes: you should replace:
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf

by:
rootwrap_config=/etc/nova/rootwrap.conf

Implements bp deprecate-root-helper

Change-Id: I8dfc94e9b91f7ffc82d393b345f09409da347e78
2012-08-01 15:32:37 +02:00
Thierry Carrez 93d3c77caf Move rootwrap filters definition to config files
Move rootwrap filters definition from being defined within Nova
code to being defined in configuration files to facilitate pluging-in
new rootwrap commands.

Transition notes:
* nova-rootwrap now requires an additional (first) parameter pointing
  to the root-owned rootwrap.conf file, sudoers needs to be updated
  to specify that ("nova-rootwrap /etc/nova/rootwrap.conf *")
* Packagers should ship {compute,network,volume}.filters inside a
  directory listed in rootwrap.conf rather than shipping
  nova/rootwrap/{compute,network,volume}.py
* Filter definitions now only support strings. The KillFilter (which was
  using arrays as parameters) was modified and the tests updated.

Implements bp nova-rootwrap-pluggable-filters

Corresponding devstack change needs to land first, so that tests pass:
https://review.openstack.org/8842

Change-Id: I2350154cd8057bd57926ed542de035626f7de37d
2012-06-22 15:35:23 +02:00
Adam Gandelman 40206cb80a nova-rootwrap: wait() for return code before exit
nova-rootwrap does not wait() for the subprocess it executes to complete before
returning its return code. This often ends up in 0 being returned regardless of
failure/success and causing unforeseen problems in Nova.

Fixes bug #928566

Change-Id: I9b6d85c747513086d0e774cb92ba403886b3283c
2012-02-07 16:15:25 -08:00
Thierry Carrez bfdb9b1f5e Fix environment passing in DnsmasqFilter
Fix environment passing in DnsmasqFilter so that dnsmasq can
be run as root through nova-rootwrap. Fixes bug 919275.

Change-Id: I2e78d92b9af4ddea9c0f1c5ddbe2d55fb672310e
2012-01-23 13:59:42 +01:00
Thierry Carrez 3c87de7c12 A more secure root-wrapper alternative
Alternative to using a sudoers file to limit which commands can be run as
root in Nova. This one makes use of command filters defined in Nova code
itself, which can be customized to deeply inspect command arguments before
allowing a command to be executed.

This change puts the infrastructure in place, together with command filters
that replicate the level of filtering provided by a sudoers file (no deep
argument inspection yet). An example of an advanced filter (RegExpFilter) is
also provided. This new root wrapper is not active by default (root_helper
still defaults to "sudo"). Implements blueprint nova-rootwrap.

Change-Id: I7ad723b55e9446758876f21b4fbb09374a910425
2011-12-07 15:10:04 +01:00