Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sandboxlib: Allow None stdout/stderr to retain forwarding #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fishface60
Copy link
Contributor

I couldn't work out a way to make sandboxlib let me keep my stdout/stderr otherwise.
I'm not a fan of changing the default behaviour of this, especially without a documented way to preserve it.

@ssssam
Copy link
Contributor

ssssam commented Nov 25, 2015

There is a documented way to do this already, see: https://github.com/CodethinkLabs/sandboxlib/blob/master/sandboxlib/__init__.py#L100. It's hard to find because there's no documentation generated from this source yet.

I think it's bad design to make the user 'opt out' of inheriting the parent file descriptions -- it should be 'opt in' if we are trying to sandbox things. I know it's different from how subprocess.Popen() works and that needs to be clear.

@richardmaw-codethink
Copy link

On Wed, Nov 25, 2015 at 02:52:34AM -0800, Sam Thursfield wrote:

There is a documented way to do this already, see: https://github.com/CodethinkLabs/sandboxlib/blob/master/sandboxlib/__init__.py#L100. It's hard to find because there's no documentation generated from this source yet.

I think it's bad design to make the user 'opt out' of inheriting the parent file descriptions -- it should be 'opt in' if we are trying to sandbox things. I know it's different from how subprocess.Popen() works and that needs to be clear.

You already need to opt-into not inheriting file descriptors by virtue
of the fact that you have changed the default value to CAPTURE.

By forcing None to mean devnull this makes subprocess.Popen have
to do a lot more work to shuffle file descriptors,
and makes it more difficult to allow file descriptor inheritance for
reasons I don't find compelling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants