Skip to content
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

doas prints pam conversation to stdout #126

Open
gcb opened this issue May 31, 2024 · 3 comments
Open

doas prints pam conversation to stdout #126

gcb opened this issue May 31, 2024 · 3 comments

Comments

@gcb
Copy link

gcb commented May 31, 2024

Same as was described on #95. I believe this have to do with the pam interface, not with things doas itself print. maybe doas is somehow hiding the tty from pam?

$ doas ls 1>1.txt 2>2.txt
$ tail 1.txt 2.txt
==> 1.txt <==
list of files
Place your right index finger on the fingerprint reader

==> 2.txt <==
(nothing)

reference from previous issue https://gitlab.freedesktop.org/libfprint/fprintd/-/issues/17

opendoas 6.8.2-3

@gcb
Copy link
Author

gcb commented May 31, 2024

showing the fix on 95, which was only for doas printed errors:

$ doas ls 1>1.txt 2>2.txt
(press a few wrong fingers)

$ tail 1.txt 2.txt 
==> 1.txt <==
(list of files)
Place your right index finger on the fingerprint reader
Place your right index finger on the fingerprint reader
Place your right index finger on the fingerprint reader

==> 2.txt <==
Failed to match fingerprint
Failed to match fingerprint

@gcb
Copy link
Author

gcb commented May 31, 2024

not familiar with pam interfaces, but tried to simply force ECHO_ON on https://github.com/Duncaen/OpenDoas/blob/master/pam.c#L64

and that only moved the pam messages to stderr:

$ git log ...
commit b96106b7e34ac591ae78b1684e9be3a265122463
$ git diff
diff --git pam.c pam.c
index fa483b8..1e36bb9 100644
--- pam.c
+++ pam.c
@@ -61,7 +61,8 @@ pamprompt(const char *msg, int echo_on, int *ret)
 {
    const char *prompt;
    char *pass, buf[PAM_MAX_RESP_SIZE];
-   int flags = RPP_REQUIRE_TTY | (echo_on ? RPP_ECHO_ON : RPP_ECHO_OFF);
+   //#int flags = RPP_REQUIRE_TTY | (echo_on ? RPP_ECHO_ON : RPP_ECHO_OFF);
+   int flags = RPP_REQUIRE_TTY | RPP_ECHO_ON;
 
    /* overwrite default prompt if it matches "Password:[ ]" */
    if (strncmp(msg,"Password:", 9) == 0 &&

$  ./doas ls 1>1.txt 2>2.txt

$  $ tail 1.txt 2.txt 
==> 1.txt <==
doas.o
env.c
env.o
libopenbsd
pam.c
pam.o
parse.o
parse.y
shadow.c
timestamp.c

==> 2.txt <==
Place your right index finger on the fingerprint reader

@gcb
Copy link
Author

gcb commented Jul 18, 2024

pam/fprintd says it's "fixed" on their end. Anyone can validate the implementation here? I'm not familiar with pam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant