Skip to content

Commit 01817b4

Browse files
committed
session client UPDATE interpret special characters for noecho
Fixes CESNET/netopeer2#1557
1 parent f906fdd commit 01817b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/session_client_ssh.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,13 @@ nc_open_tty_noecho(const char *path, struct termios *oldterm)
8484
}
8585

8686
newterm = *oldterm;
87+
88+
/* turn off echo */
8789
newterm.c_lflag &= ~ECHO;
88-
newterm.c_lflag &= ~ICANON;
90+
91+
/* get rid of any leftover characters */
8992
tcflush(fileno(ret), TCIFLUSH);
93+
9094
if (tcsetattr(fileno(ret), TCSANOW, &newterm)) {
9195
ERR(NULL, "Unable to change terminal \"%s\" settings for hiding password (%s).", path, strerror(errno));
9296
fclose(ret);

0 commit comments

Comments
 (0)