Giter Site home page Giter Site logo

Password prompt goes to stdout about doas HOT 4 CLOSED

slicer69 avatar slicer69 commented on August 16, 2024
Password prompt goes to stdout

from doas.

Comments (4)

slicer69 avatar slicer69 commented on August 16, 2024

Confirmed this is an issue. Trying to find the proper PAM documentation to direct the prompt to stderr.

from doas.

slicer69 avatar slicer69 commented on August 16, 2024

This issue has been fixed (or at least worked around) in the latest commit: cef2929

The password prompt is now displayed on stderr and the target command's output is written to stdout. At least it's working for me, would like to get it tested before I send update the FreeBSD port.

from doas.

 avatar commented on August 16, 2024

While it solves the problem I initially reported it still has another one. Redirecting stderr has the same problem. On OpenBSD doas ls &> ls.out works without putting the password prompt in ls.out (this works with sudo too). On FreeBSD with your fix the prompt still ends up in ls.out.

AFAICT su(1) solves this by using ttyname with pam_set_item(..., PAM_TTY, ...) (https://github.com/freebsd/freebsd/blob/master/usr.bin/su/su.c#L297 and https://github.com/freebsd/freebsd/blob/master/usr.bin/su/su.c#L123).

from doas.

slicer69 avatar slicer69 commented on August 16, 2024

I tried using ttyname and pam_set_item the way su does yesterday. It didn't work. Depending on where the call is made, I either ended up with the password prompt in stdout or no visible password prompt at all.

You said ls &> ls.out put the password prompt in the output, but that is what I would consider expected behaviour considering the command. I mean that is what I would want to happen if I ran doas ls &> ls.out.

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.