Remove redundant tty signal blocking in log function.
This commit is contained in:
@@ -75,7 +75,6 @@ struct script_buf {
|
|||||||
#define IOFD_TIMING 5
|
#define IOFD_TIMING 5
|
||||||
#define IOFD_MAX 6
|
#define IOFD_MAX 6
|
||||||
|
|
||||||
static sigset_t ttyblock;
|
|
||||||
static struct timeval last_time;
|
static struct timeval last_time;
|
||||||
static union io_fd io_fds[IOFD_MAX];
|
static union io_fd io_fds[IOFD_MAX];
|
||||||
|
|
||||||
@@ -268,14 +267,6 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation,
|
|||||||
if (io_fds[IOFD_STDERR].v == NULL)
|
if (io_fds[IOFD_STDERR].v == NULL)
|
||||||
log_error(USE_ERRNO, "Can't create %s", pathbuf);
|
log_error(USE_ERRNO, "Can't create %s", pathbuf);
|
||||||
|
|
||||||
/* So we can block tty-generated signals */
|
|
||||||
sigemptyset(&ttyblock);
|
|
||||||
sigaddset(&ttyblock, SIGINT);
|
|
||||||
sigaddset(&ttyblock, SIGQUIT);
|
|
||||||
sigaddset(&ttyblock, SIGTSTP);
|
|
||||||
sigaddset(&ttyblock, SIGTTIN);
|
|
||||||
sigaddset(&ttyblock, SIGTTOU);
|
|
||||||
|
|
||||||
gettimeofday(&last_time, NULL);
|
gettimeofday(&last_time, NULL);
|
||||||
|
|
||||||
/* XXX - log more stuff? window size? environment? */
|
/* XXX - log more stuff? window size? environment? */
|
||||||
@@ -329,12 +320,9 @@ static int
|
|||||||
sudoers_io_log(const char *buf, unsigned int len, int idx)
|
sudoers_io_log(const char *buf, unsigned int len, int idx)
|
||||||
{
|
{
|
||||||
struct timeval now, tv;
|
struct timeval now, tv;
|
||||||
sigset_t omask;
|
|
||||||
|
|
||||||
gettimeofday(&now, NULL);
|
gettimeofday(&now, NULL);
|
||||||
|
|
||||||
sigprocmask(SIG_BLOCK, &ttyblock, &omask);
|
|
||||||
|
|
||||||
#ifdef HAVE_ZLIB
|
#ifdef HAVE_ZLIB
|
||||||
if (def_compress_io)
|
if (def_compress_io)
|
||||||
gzwrite(io_fds[idx].g, buf, len);
|
gzwrite(io_fds[idx].g, buf, len);
|
||||||
@@ -353,8 +341,6 @@ sudoers_io_log(const char *buf, unsigned int len, int idx)
|
|||||||
last_time.tv_sec = now.tv_sec;
|
last_time.tv_sec = now.tv_sec;
|
||||||
last_time.tv_usec = now.tv_usec;
|
last_time.tv_usec = now.tv_usec;
|
||||||
|
|
||||||
sigprocmask(SIG_SETMASK, &omask, NULL);
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user