version 1.1.1.4, 2013/07/22 10:46:13
|
version 1.1.1.5, 2013/10/14 07:56:35
|
Line 53
|
Line 53
|
#include <fcntl.h> |
#include <fcntl.h> |
|
|
#include "sudo.h" |
#include "sudo.h" |
|
#include "sudo_plugin.h" |
|
|
static volatile sig_atomic_t signo[NSIG]; |
static volatile sig_atomic_t signo[NSIG]; |
|
|
Line 70 tgetpass(const char *prompt, int timeout, int flags)
|
Line 71 tgetpass(const char *prompt, int timeout, int flags)
|
sigaction_t savetstp, savettin, savettou, savepipe; |
sigaction_t savetstp, savettin, savettou, savepipe; |
char *pass; |
char *pass; |
static const char *askpass; |
static const char *askpass; |
static char buf[SUDO_PASS_MAX + 1]; | static char buf[SUDO_CONV_REPL_MAX + 1]; |
int i, input, output, save_errno, neednl = 0, need_restart; |
int i, input, output, save_errno, neednl = 0, need_restart; |
debug_decl(tgetpass, SUDO_DEBUG_CONV) |
debug_decl(tgetpass, SUDO_DEBUG_CONV) |
|
|
Line 127 restart:
|
Line 128 restart:
|
* Catch signals that would otherwise cause the user to end |
* Catch signals that would otherwise cause the user to end |
* up with echo turned off in the shell. |
* up with echo turned off in the shell. |
*/ |
*/ |
zero_bytes(&sa, sizeof(sa)); | memset(&sa, 0, sizeof(sa)); |
sigemptyset(&sa.sa_mask); |
sigemptyset(&sa.sa_mask); |
sa.sa_flags = SA_INTERRUPT; /* don't restart system calls */ |
sa.sa_flags = SA_INTERRUPT; /* don't restart system calls */ |
sa.sa_handler = tgetpass_handler; |
sa.sa_handler = tgetpass_handler; |
Line 207 restore:
|
Line 208 restore:
|
static char * |
static char * |
sudo_askpass(const char *askpass, const char *prompt) |
sudo_askpass(const char *askpass, const char *prompt) |
{ |
{ |
static char buf[SUDO_PASS_MAX + 1], *pass; | static char buf[SUDO_CONV_REPL_MAX + 1], *pass; |
sigaction_t sa, saved_sa_pipe; |
sigaction_t sa, saved_sa_pipe; |
int pfd[2]; |
int pfd[2]; |
pid_t pid; |
pid_t pid; |
Line 242 sudo_askpass(const char *askpass, const char *prompt)
|
Line 243 sudo_askpass(const char *askpass, const char *prompt)
|
} |
} |
|
|
/* Ignore SIGPIPE in case child exits prematurely */ |
/* Ignore SIGPIPE in case child exits prematurely */ |
zero_bytes(&sa, sizeof(sa)); | memset(&sa, 0, sizeof(sa)); |
sigemptyset(&sa.sa_mask); |
sigemptyset(&sa.sa_mask); |
sa.sa_flags = SA_INTERRUPT; |
sa.sa_flags = SA_INTERRUPT; |
sa.sa_handler = SIG_IGN; |
sa.sa_handler = SIG_IGN; |