aboutsummaryrefslogtreecommitdiff
path: root/lib/password.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2015-04-27 11:13:19 -0500
committerRob Landley <rob@landley.net>2015-04-27 11:13:19 -0500
commit2fd8624cc612e946f593b2c9e9031c46f862562e (patch)
treeb8ab47e7f83175f4045e9a40ae27688213a78dbf /lib/password.c
parented753aaa5481e487a23c9e0e6a855c09612eb7ce (diff)
downloadtoybox-2fd8624cc612e946f593b2c9e9031c46f862562e.tar.gz
Some infrastructure hexedit needs. (Poor man's curses.)
Diffstat (limited to 'lib/password.c')
-rw-r--r--lib/password.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/lib/password.c b/lib/password.c
index b3cc199e..9654d42d 100644
--- a/lib/password.c
+++ b/lib/password.c
@@ -46,39 +46,6 @@ int get_salt(char *salt, char *algo)
return -1;
}
-// Reset terminal to known state, returning old state if old != NULL.
-int set_terminal(int fd, int raw, struct termios *old)
-{
- struct termios termio;
-
- if (!tcgetattr(fd, &termio) && old) *old = termio;
-
- // the following are the bits set for an xterm. Linux text mode TTYs by
- // default add two additional bits that only matter for serial processing
- // (turn serial line break into an interrupt, and XON/XOFF flow control)
-
- // Any key unblocks output, swap CR and NL on input
- termio.c_iflag = IXANY|ICRNL|INLCR;
- if (toys.which->flags & TOYFLAG_LOCALE) termio.c_iflag |= IUTF8;
-
- // Output appends CR to NL, does magic undocumented postprocessing
- termio.c_oflag = ONLCR|OPOST;
-
- // Leave serial port speed alone
- // termio.c_cflag = C_READ|CS8|EXTB;
-
- // Generate signals, input entire line at once, echo output
- // erase, line kill, escape control characters with ^
- // erase line char at a time
- // "extended" behavior: ctrl-V quotes next char, ctrl-R reprints unread chars,
- // ctrl-W erases word
- termio.c_lflag = ISIG|ICANON|ECHO|ECHOE|ECHOK|ECHOCTL|ECHOKE|IEXTEN;
-
- if (raw) cfmakeraw(&termio);
-
- return tcsetattr(fd, TCSANOW, &termio);
-}
-
// Prompt with mesg, read password into buf, return 0 for success 1 for fail
int read_password(char *buf, int buflen, char *mesg)
{