Closed sstark closed 8 months ago
This update enhances the suda.vim
plugin by improving the suda#system
function. It now smartly checks for an active sudo session by trying a non-interactive command first. If this check fails, meaning there's no active sudo timestamp, it then prompts the user for a password. This approach streamlines operations by avoiding unnecessary password requests, making the user experience smoother and more efficient.
File(s) | Summary of Changes |
---|---|
autoload/suda.vim |
Updated suda#system to first attempt non-interactive command execution for sudo timestamp before prompting for password. |
doc/suda.txt |
Enhanced suda to support global timestamps for sudo authentication, enabling token reuse without password prompts. |
🐇✨
In the realm of code, where vim commands dance,
A clever rabbit hopped, seeking a chance.
To smooth the path, with a magical tweak,
No more passwords, if sudo's not weak.
🌟🐾
"Hop, skip, a leap," it said with a grin,
"For smoother coding, let the magic begin!"
🎉🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
In certain circumstances we do not need to ask for a password because we already have previously authenticated to sudo and can just reuse the credentials.
Since there is no way to check if a sudo timestamp has timed out we run a simple command and check the result.
Using an existing sudo timestamp from within nvim seems to work only if the timestamp_type is set to 'global' in the sudo configuration file.
The assesment of the risk of setting the security relevant setting timestamp_type to 'global' needs to be done by the user.
Summary by CodeRabbit
suda
plugin to improve user experience by reducing unnecessary password prompts.suda
functionality documentation to include support for global timestamps for sudo authentication.