mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-04-04 22:07:42 +00:00
Implement passphrase input.
This commit is contained in:
parent
202d972a6c
commit
412cf013c4
4 changed files with 59 additions and 2 deletions
8
util.c
8
util.c
|
|
@ -38,6 +38,7 @@
|
|||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <termios.h>
|
||||
|
||||
#ifdef _SC_PAGE_SIZE
|
||||
# define PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
|
||||
|
|
@ -86,6 +87,13 @@ void unlink_files(void)
|
|||
|
||||
static void fatal_exit(void)
|
||||
{
|
||||
struct termios termios_p;
|
||||
|
||||
/* Make sure we haven't died after disabling stdin echo */
|
||||
tcgetattr(fileno(stdin), &termios_p);
|
||||
termios_p.c_lflag |= ECHO;
|
||||
tcsetattr(fileno(stdin), 0, &termios_p);
|
||||
|
||||
unlink_files();
|
||||
fprintf(outputfile, "Fatal error - exiting\n");
|
||||
fflush(outputfile);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue