mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-04-04 13:57:40 +00:00
Implement passphrase input.
This commit is contained in:
parent
202d972a6c
commit
412cf013c4
4 changed files with 59 additions and 2 deletions
12
main.c
12
main.c
|
|
@ -36,6 +36,7 @@
|
|||
# include <sys/resource.h>
|
||||
#endif
|
||||
#include <math.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "rzip.h"
|
||||
#include "lrzip.h"
|
||||
|
|
@ -203,9 +204,15 @@ static void usage(void)
|
|||
|
||||
}
|
||||
|
||||
|
||||
static void sighandler(int sig __UNUSED__)
|
||||
{
|
||||
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();
|
||||
exit(0);
|
||||
}
|
||||
|
|
@ -768,6 +775,9 @@ int main(int argc, char *argv[])
|
|||
|
||||
gettimeofday(&start_time, NULL);
|
||||
|
||||
if (unlikely(STDIN && ENCRYPT))
|
||||
failure("Unable to work from STDIN while reading password\n");
|
||||
|
||||
if (DECOMPRESS || TEST_ONLY)
|
||||
decompress_file(&control);
|
||||
else if (INFO)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue