Giter Site home page Giter Site logo

password is read from stdin, not TTY about doas HOT 7 OPEN

slicer69 avatar slicer69 commented on August 16, 2024 1
password is read from stdin, not TTY

from doas.

Comments (7)

slicer69 avatar slicer69 commented on August 16, 2024 8

I've tested this and it works as expected on FreeBSD.

On Linux it was echoing the password when a pipe was used, which is obviously not good. I've fixed that.

On Linux piped data is not being forwarded to the command run by doas, it is intercepted by doas. Will look into that further.

from doas.

linuxergr avatar linuxergr commented on August 16, 2024

Is there any progress about this, as mentioned above?

from doas.

slicer69 avatar slicer69 commented on August 16, 2024

No, and there probably won't be until someone submits a patch for Linux compatibility that doesn't break other platforms.

from doas.

sandsmark avatar sandsmark commented on August 16, 2024

it doesn't seem like this does any tty or pty handling at all?

This is the basic stuff needed for securely reading the password AFAIK: https://github.com/sudo-project/sudo/blob/9e111eae57524ca72002ad1db36eb68ccd50b167/src/tgetpass.c#L110-L284

I don't think that is linux specific.

from doas.

slicer69 avatar slicer69 commented on August 16, 2024

This is Linux specific, the other platforms just handle this, basically automatically.

from doas.

henriquehbr avatar henriquehbr commented on August 16, 2024

Quoting my suggested solution from Duncaen/OpenDoas#21

It turns out i found a pretty good workaround for this by using expect for automatically entering input on interactive prompts, i ended up with something like this:

#!/usr/bin/expect
spawn doas -- pacman --noconfirm -U yay-bin-10.2.3-1-x86_64.pkg.tar.zst
expect "Password: " {send -- "password\r"}
expect eof

Hope it helps someone :)

from doas.

jdebp avatar jdebp commented on August 16, 2024

This is not a strictly problem in doas. This is a difference between the basic default "glass TTY" conversation functions supplied by LinuxPAM on Linux, by OpenPAM on the BSDs, and by doas itself.

It wouldn't be hard to adapt the Illumos pam_tty_conv() to Linux, and make it better for Illumos as a side-effect. But that would only fix this problem for "doas" and not fix it for everything else that uses LinuxPAM and hits the same problem for the same reason.

There's no bug filed about this at the LinuxPAM bug tracker directly nor at the Debian bug tracker nor at the Ubuntu bug tracker. The LinuxPAM bug tracker is definitely the place for you to go with this, @dw. (-:

from doas.

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.