Repository URL to install this package:
Version:
4.0.115 ▾
|
contego
/
home
/
tvault
/
.virtenv
/
lib
/
python2.7
/
site-packages
/
os_brick
/
privileged
/
rootwrap.pyc
|
---|
ó ˍEYc @ sd d Z d d l Z d d l m Z d d l m Z d d l m Z d Z e j j d Z d S( s Just in case it wasn't clear, this is a massive security back-door. `execute_root()` (or the same via `execute(run_as_root=True)`) allows any command to be run as the privileged user (default "root"). This is intended only as an expedient transition and should be removed ASAP. This is not completely unreasonable because: 1. We have no tool/workflow for merging changes to rootwrap filter configs from os-brick into nova/cinder, which makes it difficult to evolve these loosely coupled projects. 2. Let's not pretend the earlier situation was any better. The rootwrap filters config contained several entries like "allow cp as root with any arguments", etc, and would have posed only a mild inconvenience to an attacker. At least with privsep we can (in principle) run the "root" commands as a non-root uid, with restricted Linux capabilities. The plan is to switch os-brick to privsep using this module (removing the urgency of (1)), then work on the larger refactor that addresses (2) in followup changes. iÿÿÿÿN( t processutils( t strutils( t privilegedc O s | j d t } | j d d y' | r8 t | | St j | | SWnL t k r } t j d j | } t j d | d t j | n Xd S( s9 NB: Raises processutils.ProcessExecutionError on failure.t run_as_roott root_helpert t cmdt descriptionN( t popt Falset Nonet execute_roott putilst executet OSErrorR t mask_passwordt joint ProcessExecutionErrort sixt text_type( R t kwargsR t et sanitized_cmd( ( sQ /home/tvault/.virtenv/lib/python2.7/site-packages/os_brick/privileged/rootwrap.pyR 2 s c O s t j d t d t | | S( sA NB: Raises processutils.ProcessExecutionError/OSError on failure.t shellR ( R R R ( R R ( ( sQ /home/tvault/.virtenv/lib/python2.7/site-packages/os_brick/privileged/rootwrap.pyR O s ( t __doc__R t oslo_concurrencyR R t oslo_utilsR t os_brickR R t defaultt entrypointR ( ( ( sQ /home/tvault/.virtenv/lib/python2.7/site-packages/os_brick/privileged/rootwrap.pyt <module>% s