How do you sudo with xonsh?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I get the error xonsh: subprocess mode: permission denied: sudo
.
shell sudo xonsh
add a comment |Â
up vote
1
down vote
favorite
I get the error xonsh: subprocess mode: permission denied: sudo
.
shell sudo xonsh
Can you runsudo
successfully when you're not usingxonsh
?
â larsks
Aug 12 '15 at 18:47
Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
â Emre
Aug 12 '15 at 18:52
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I get the error xonsh: subprocess mode: permission denied: sudo
.
shell sudo xonsh
I get the error xonsh: subprocess mode: permission denied: sudo
.
shell sudo xonsh
shell sudo xonsh
edited Sep 19 at 14:03
Anthony Geoghegan
7,32633852
7,32633852
asked Aug 12 '15 at 18:19
Emre
18518
18518
Can you runsudo
successfully when you're not usingxonsh
?
â larsks
Aug 12 '15 at 18:47
Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
â Emre
Aug 12 '15 at 18:52
add a comment |Â
Can you runsudo
successfully when you're not usingxonsh
?
â larsks
Aug 12 '15 at 18:47
Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
â Emre
Aug 12 '15 at 18:52
Can you run
sudo
successfully when you're not using xonsh
?â larsks
Aug 12 '15 at 18:47
Can you run
sudo
successfully when you're not using xonsh
?â larsks
Aug 12 '15 at 18:47
Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
â Emre
Aug 12 '15 at 18:52
Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
â Emre
Aug 12 '15 at 18:52
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
It's a bug in xonsh
. In the build_ins.py
module, xonsh
attempts to determine if a file is "binary" or not by opening it and reading a few bytes:
def _is_binary(fname, limit=80):
with open(fname, 'rb') as f:
for i in range(limit):
char = f.read(1)
if char == b'':
return True
if char == b'n':
return False
if char == b'':
return False
return False
Security sensitive programs like sudo
are often executable but not readable, so this blows up.
Here is a possible patch for this behavior.
â larsks
Aug 12 '15 at 19:11
Thanks. I don't understand how nobody realizedsudo
doesn't work.
â Emre
Aug 12 '15 at 20:48
My guess is that not many people are usingxonsh
. It's not something I had ever heard of until I saw your question.
â larsks
Aug 12 '15 at 20:49
1
To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
â Anthony Scopatz
Aug 18 '15 at 1:11
1
The bug has now been fixed in master. Sorry about the problem in the first place.
â Anthony Scopatz
Aug 18 '15 at 14:21
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
It's a bug in xonsh
. In the build_ins.py
module, xonsh
attempts to determine if a file is "binary" or not by opening it and reading a few bytes:
def _is_binary(fname, limit=80):
with open(fname, 'rb') as f:
for i in range(limit):
char = f.read(1)
if char == b'':
return True
if char == b'n':
return False
if char == b'':
return False
return False
Security sensitive programs like sudo
are often executable but not readable, so this blows up.
Here is a possible patch for this behavior.
â larsks
Aug 12 '15 at 19:11
Thanks. I don't understand how nobody realizedsudo
doesn't work.
â Emre
Aug 12 '15 at 20:48
My guess is that not many people are usingxonsh
. It's not something I had ever heard of until I saw your question.
â larsks
Aug 12 '15 at 20:49
1
To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
â Anthony Scopatz
Aug 18 '15 at 1:11
1
The bug has now been fixed in master. Sorry about the problem in the first place.
â Anthony Scopatz
Aug 18 '15 at 14:21
add a comment |Â
up vote
5
down vote
accepted
It's a bug in xonsh
. In the build_ins.py
module, xonsh
attempts to determine if a file is "binary" or not by opening it and reading a few bytes:
def _is_binary(fname, limit=80):
with open(fname, 'rb') as f:
for i in range(limit):
char = f.read(1)
if char == b'':
return True
if char == b'n':
return False
if char == b'':
return False
return False
Security sensitive programs like sudo
are often executable but not readable, so this blows up.
Here is a possible patch for this behavior.
â larsks
Aug 12 '15 at 19:11
Thanks. I don't understand how nobody realizedsudo
doesn't work.
â Emre
Aug 12 '15 at 20:48
My guess is that not many people are usingxonsh
. It's not something I had ever heard of until I saw your question.
â larsks
Aug 12 '15 at 20:49
1
To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
â Anthony Scopatz
Aug 18 '15 at 1:11
1
The bug has now been fixed in master. Sorry about the problem in the first place.
â Anthony Scopatz
Aug 18 '15 at 14:21
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
It's a bug in xonsh
. In the build_ins.py
module, xonsh
attempts to determine if a file is "binary" or not by opening it and reading a few bytes:
def _is_binary(fname, limit=80):
with open(fname, 'rb') as f:
for i in range(limit):
char = f.read(1)
if char == b'':
return True
if char == b'n':
return False
if char == b'':
return False
return False
Security sensitive programs like sudo
are often executable but not readable, so this blows up.
It's a bug in xonsh
. In the build_ins.py
module, xonsh
attempts to determine if a file is "binary" or not by opening it and reading a few bytes:
def _is_binary(fname, limit=80):
with open(fname, 'rb') as f:
for i in range(limit):
char = f.read(1)
if char == b'':
return True
if char == b'n':
return False
if char == b'':
return False
return False
Security sensitive programs like sudo
are often executable but not readable, so this blows up.
answered Aug 12 '15 at 19:03
larsks
10k32738
10k32738
Here is a possible patch for this behavior.
â larsks
Aug 12 '15 at 19:11
Thanks. I don't understand how nobody realizedsudo
doesn't work.
â Emre
Aug 12 '15 at 20:48
My guess is that not many people are usingxonsh
. It's not something I had ever heard of until I saw your question.
â larsks
Aug 12 '15 at 20:49
1
To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
â Anthony Scopatz
Aug 18 '15 at 1:11
1
The bug has now been fixed in master. Sorry about the problem in the first place.
â Anthony Scopatz
Aug 18 '15 at 14:21
add a comment |Â
Here is a possible patch for this behavior.
â larsks
Aug 12 '15 at 19:11
Thanks. I don't understand how nobody realizedsudo
doesn't work.
â Emre
Aug 12 '15 at 20:48
My guess is that not many people are usingxonsh
. It's not something I had ever heard of until I saw your question.
â larsks
Aug 12 '15 at 20:49
1
To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
â Anthony Scopatz
Aug 18 '15 at 1:11
1
The bug has now been fixed in master. Sorry about the problem in the first place.
â Anthony Scopatz
Aug 18 '15 at 14:21
Here is a possible patch for this behavior.
â larsks
Aug 12 '15 at 19:11
Here is a possible patch for this behavior.
â larsks
Aug 12 '15 at 19:11
Thanks. I don't understand how nobody realized
sudo
doesn't work.â Emre
Aug 12 '15 at 20:48
Thanks. I don't understand how nobody realized
sudo
doesn't work.â Emre
Aug 12 '15 at 20:48
My guess is that not many people are using
xonsh
. It's not something I had ever heard of until I saw your question.â larsks
Aug 12 '15 at 20:49
My guess is that not many people are using
xonsh
. It's not something I had ever heard of until I saw your question.â larsks
Aug 12 '15 at 20:49
1
1
To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
â Anthony Scopatz
Aug 18 '15 at 1:11
To be clear, sudo does work even with this bug on many systems (which is why it was missed). Some distributions choose to make sudo unreadable-but-executable. This is not categorically true for all Linux distros. There is a PR into xonsh that fixes this.
â Anthony Scopatz
Aug 18 '15 at 1:11
1
1
The bug has now been fixed in master. Sorry about the problem in the first place.
â Anthony Scopatz
Aug 18 '15 at 14:21
The bug has now been fixed in master. Sorry about the problem in the first place.
â Anthony Scopatz
Aug 18 '15 at 14:21
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f222845%2fhow-do-you-sudo-with-xonsh%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Can you run
sudo
successfully when you're not usingxonsh
?â larsks
Aug 12 '15 at 18:47
Yes. I also checked that the ownership and rights of my other shells and xonsh match. The only difference is that xonsh is in /usr/local/bin.
â Emre
Aug 12 '15 at 18:52