From 1d93a576f4cc7c6bfb5eb122469c3d4ba85f84bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 15 Jul 2021 13:57:12 +0200 Subject: Reverse meaning of +d (dumb) flag I personally find the detection useful enough to have enabled by default. --- rtty.1 | 5 +++-- rtty.c | 13 ++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rtty.1 b/rtty.1 index 7fc2fee..d8a01eb 100644 --- a/rtty.1 +++ b/rtty.1 @@ -30,8 +30,9 @@ If the .Sy +d flag is provided, .Nm -tries to detect password prompts from the remote server -and hide the user's input. +disables all heuristics to detect password prompts +from the remote server and hide the user's input, +which are enabled by default. If the .Sy +p flag is provided, diff --git a/rtty.c b/rtty.c index 18eeae6..aa62f45 100644 --- a/rtty.c +++ b/rtty.c @@ -22,7 +22,7 @@ main(int argc, char *argv[]) char bufin[MAXBUF], bufout[MAXBUF], *bi, *bo, in[30], **nargv, out[30], pw[255]; fd_set rfds0, rfds1; - int detect, fdin, fdout, i, n, offset, sshpass; + int dumb, fdin, fdout, i, n, offset, sshpass; struct timeval tv; signal(SIGCHLD, sigchld); @@ -35,9 +35,9 @@ main(int argc, char *argv[]) err(1, "mkfifo"); /* Process rtty-specific flags. */ - detect = sshpass = 0; + dumb = sshpass = 0; for(;argv[1][0] == '+';){ - if(strchr(argv[1], 'd')) detect = 1; + if(strchr(argv[1], 'd')) dumb = 1; if(strchr(argv[1], 'p')) sshpass = 1; /* Remove flag argument from argv. */ @@ -153,13 +153,12 @@ main(int argc, char *argv[]) fflush(stdout); bufin[0] = 0; - if(!detect) - continue; - /* - * As the +d flag is given, rtty tries to detect + * Unless the +d flag is given, rtty tries to detect * password prompts and hide the user's input. */ + if(dumb) + continue; if(bo[strlen(bo)-1] == ':' || strcmp(bo+strlen(bo)-2, ": ") == 0){ if(!(bo = strrchr(bufout, '\n'))) -- cgit v1.2.3