-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
'Retry as sudo' doesnt work #234311
Comments
We changed the solution to only require 1 file, so the execution looks fine. Are there more errors in the full logs? |
No other errors. Here is bigger a snippet from the log beginning with the initial permission denied error:
Full log file: PS: The Apparmor is turned off to cut off any third party interference and the bug was replicated on a fresh Kali install on another computer as well to exclude the possibility of the bug occurring in my specific environment. |
Thanks, this line is relevant:
Curious when you try this again, can you check the contents of this file and if it exists on disk? It would have a different name each time you try, so you need to get it from the logs. |
Putting my hat in the ring too. I'm running into the same issue. If there's anything I can do to help troubleshoot, let me know otherwise I'll just lurk. Thanks! |
I have the same issue, I ran the below so you can see my os vers ──(kali㉿kali)-[~/vtest] ┌──(kali㉿kali)-[~/vtest] |
We rely on a node module for the actual execution of the sudo script: https://github.com/bpasero/sudo-prompt which is forked from https://github.com/jorangreef/sudo-prompt because the latter is not active anymore. Would anyone here be willing to conduct an experiment purely with node.js and this module to see if the issue is actually with said module? I am starting to feel its in there and not in VS Code. This would require to follow along the sample in https://github.com/jorangreef/sudo-prompt?tab=readme-ov-file#usage, but I can help if someone is willing to try it out 🙏 |
I can help out. I'm running a Debian based OS though and it looks like the instructions you linked for sudo-prompt are for the npm package manager? I'll need your help with what you'd like me to do. |
Yes, this would involve installing node.js and being able to run a simple |
So I'm not sure if I did it correctly:
I received a popup to put in my password but after entering it, the terminal is now frozen and one of my cores is spiked and has been for the past few minutes. I wanted to give it time just in case but it wasn't doing anything. Based on the command in the readme, it looks like it should have just echoed hello to the screen right? Or am I way off base? I took a snapshot of my VM before I did all this so if I need different steps, just let me know and I can rollback easily. |
@KazeEnji yeah some tweaks needed, but great progress! please use this code: var sudo = require('@vscode/sudo-prompt');
var options = {
name: 'Electron'
};
sudo.exec('echo hello', options,
function(error, stdout, stderr) {
if (error) throw error;
console.log('stdout: ' + stdout);
}
); and thus use After a login prompt I get to see: |
Ok, I created the index.js file using the code you provided and when I attempted to run it, I received this error:
Looking the error up, it seems I also needed to |
Thanks! This does indeed mean that the library does not work on your Linux distribution, either due to a regression or always. We did not change the library at all in many years though. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
A workaround for this issue is now documented in #237427 (comment). It originates from a change of the Linux distro in hard limit on the maximum number of open file descriptors, i.e. |
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
People discussing this issue here: #70403
Given information from the above-mentioned source I was able to debug the problem.
According to the developer the write a file with sudo goes through following process:
After running VSCode with
--verbose
flag I have noticed the target file is not set:[sudo-prompt] running command: "/usr/share/code/bin/code" --file-write "/home/paul0ss/.config/Code/code-elevated-DYqaVPH4"
This is probably the reason why the file write doesnt succeed but also doesnt throw any exception stating that permission was denied.
The text was updated successfully, but these errors were encountered: