Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

no sudo in terminals created with child_process.spawn #20819

Open
5 tasks done
moritzschepp opened this issue May 26, 2020 · 4 comments
Open
5 tasks done

no sudo in terminals created with child_process.spawn #20819

moritzschepp opened this issue May 26, 2020 · 4 comments

Comments

@moritzschepp
Copy link

Prerequisites

Description

Subprocesses created with child_process.spawn can't use sudo. The problem was also described in #6702 and it was suggested that it was solved. I'm seeing this with atom 1.47.0 x64, though.

Steps to Reproduce

Drop this in your init.coffee:

spawn = require('child_process').spawn
spawn('mate-terminal', [], {detached: true})

and reload the atom window.

Expected behavior:

The resulting terminal window should allow to use sudo.

Actual behavior:

Trying to use sudo returns:

sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

Reproduces how often:

100%

Versions

Atom : 1.47.0
Electron: 5.0.13
Chrome : 73.0.3683.121
Node : 12.0.0

Additional Information

Its worth noting that the problem doesn't occur with gnome-terminal, although I believe that's because it connects to a gnome-terminal-server which is not started as a child process.

Perhaps related: electron/electron#18521

Let me know if I can provide more information.

@the-j0k3r
Copy link

See electron/electron#23881 this is an electron 5-0-x regression, worked with Atom 1.46.x and electron 4.2.7

I submitted a pr for the backport to electron 5-0-x branch which is what Atom 1.47.x uses

Resolution for now, Downgrade to Atom 1.46.x with electron 4.2.7

Also related to https://github.com/bus-stop/terminus/issues/84

@moritzschepp
Copy link
Author

Thanks for looking into this!

A workaround is also the gnome-terminal, if available.

@the-j0k3r
Copy link

Well 5.0.x electron is no longer supported so only electron 6.0.x or 7.0,x

See electron/electron#23881 (comment)

@the-j0k3r
Copy link

Now that #21079 (comment) is merged this issue will be fixed by a Atom release with electron 6.x

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

No branches or pull requests

2 participants