Hello tech@,

The following patch adds a carriage return before printing the regular
challenge.

If you're like me and you sometimes forget to wait before the prompt
comes up before typing your password it might be a little less stressful
if the message returns to the start of the line instead of after the
first few characters of your password and you have to rush to clear(1).

I don't know the impact of prepending this to auth_userchallenge(3), so
I left this one alone for now.

Any OKs or objections?

martijn@

Index: doas.c
===================================================================
RCS file: /cvs/src/usr.bin/doas/doas.c,v
retrieving revision 1.50
diff -u -p -r1.50 doas.c
--- doas.c      7 Feb 2016 20:01:58 -0000       1.50
+++ doas.c      8 Feb 2016 20:30:48 -0000
@@ -425,7 +425,7 @@ main(int argc, char **argv, char **envp)
                        if (gethostname(host, sizeof(host)))
                                snprintf(host, sizeof(host), "?");
                        snprintf(cbuf, sizeof(cbuf),
-                           "doas (%.32s@%.32s) password: ", myname, host);
+                           "\rdoas (%.32s@%.32s) password: ", myname, host);
                        challenge = cbuf;
                }
                response = readpassphrase(challenge, rbuf, sizeof(rbuf),

Reply via email to