1. Holger Krekel
  2. execnet
  3. Issues
Issue #21 resolved

support sudo on local popen

Alfredo Deza
created an issue

To create a gateway over ssh, sudo python works great because it is used as part of a string (note that I am printing the args being passed to Popen):

gw = execnet.makegateway('ssh=node1//python=sudo python')
['ssh', '-C', 'node1', 'sudo python -c "import sys;exec(eval(sys.stdin.readline()))"']

But that is not the case with a local popen gateway:

 gw = execnet.makegateway('popen//python=sudo python')
['sudo python', '-u', '-c', 'import sys;exec(eval(sys.stdin.readline()))']

'sudo python` will make Popen raise an OSError because it can't find the executable.

When using this fix [0] I am able to start a local popen gateway with sudo python

gw = execnet.makegateway('popen//python=sudo python')
['sudo', 'python', '-u', '-c', 'import sys;exec(eval(sys.stdin.readline()))']

Is it possible to consider that change to allow local popen gateways with sudo?

[0] https://bitbucket.org/ctheune/execnet/commits/923812b8f0e43930105033464e1d09e6e923d4dd

Comments (3)

  1. Log in to comment