Giter Site home page Giter Site logo

Comments (9)

zeertzjq avatar zeertzjq commented on July 17, 2024 1

I have worked out a more user-friendly fix in this branch. It requires let g:suda#try_no_text_input_auth = 1 and has a configurable prompt message. This fix is based on PR #35, and I haven't documented the config options I added yet, but I think the fix should work.

from suda.vim.

zeertzjq avatar zeertzjq commented on July 17, 2024

I use fprintd with sudo and I also have this problem. According to the discussions in #34 i guess it is very hard to determine whether sudo requests a password, so an extra configuration option may be the easiest way to solve this.

from suda.vim.

WhyNotHugo avatar WhyNotHugo commented on July 17, 2024

an extra configuration option may be the easiest way to solve this.

That would partially work. If my yubikey is not plugged it, sudo falls back to asking for a password, so that scenario would not work. I guess if a fingerprint reader is built into the keyboard that wouldn't be an issue in that case though.

from suda.vim.

zeertzjq avatar zeertzjq commented on July 17, 2024

an extra configuration option may be the easiest way to solve this.

That would partially work. If my yubikey is not plugged it, sudo falls back to asking for a password, so that scenario would not work. I guess if a fingerprint reader is built into the keyboard that wouldn't be an issue in that case though.

Oh, then maybe another option is to make sudo read from an empty stdin first. Changing -n to -S in this line should be enough. When stdin is empty, sudo will fail to read a password and exit directly, while authentication methods that come before password can still work. (Unlike -n which also suppresses other stuff like fingerprint authentication.)

I'm not familiar with YubiKey. When using fprintd the solution above causes the editor to freeze until a fingerprint is scanned, so such a solution works, but is not user-friendly.

from suda.vim.

zeertzjq avatar zeertzjq commented on July 17, 2024

I'm working on a more user-friendly fix in this branch. It requires let g:suda#try_no_text_input_auth = 1 and has a configurable prompt message. This fix is based on PR #35, and I haven't documented the config options I added yet, but I think the fix should work.

I tested the fix with fprintd. SudaWrite works fine, but when using SudaRead spam is written to the temporary file by pam_fprintd.so. Using dd instead of cat in suda#read() may solve this only when assuming root can write to temporary files created by Vim/Neovim. I'm not sure whether it is safe to make this assumption.

from suda.vim.

zeertzjq avatar zeertzjq commented on July 17, 2024

Another option may be to allow using an external terminal emulator or tmux to run sudo, so that the plugin doesn't need to care about what sudo expects at all.

from suda.vim.

WhyNotHugo avatar WhyNotHugo commented on July 17, 2024

Actually, even using a new split with a terminal that does the sudo might be a good idea.

It'd also improve the experience with failed password attempts.

from suda.vim.

fidgetingbits avatar fidgetingbits commented on July 17, 2024

This is an issue when using howdy as well, as you generally want sudo to automatically authenticate without asking for the password.

from suda.vim.

d0wn2 avatar d0wn2 commented on July 17, 2024

Any updates on this? I also use fprintd and when saving via Suda it prompts for the password first, then attempts to authenticate via the fingerprint sensor, and ultimately doesn't even save the file.

from suda.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.