Do not compile intercept code if --disable-intercept is specified.

This commit is contained in:
Todd C. Miller
2021-09-01 13:35:47 -06:00
parent 5c2f1ebbcf
commit 38d884a62d
7 changed files with 38 additions and 29 deletions

View File

@@ -45,10 +45,12 @@
#include "sudo_rand.h"
#include "intercept.pb-c.h"
#ifdef _PATH_SUDO_INTERCEPT
/* TCSASOFT is a BSD extension that ignores control flags and speed. */
#ifndef TCSASOFT
# define TCSASOFT 0
#endif
# ifndef TCSASOFT
# define TCSASOFT 0
# endif
enum intercept_state {
RECV_HELLO_INITIAL,
@@ -938,3 +940,15 @@ bad:
close(client_sock);
debug_return;
}
#else /* _PATH_SUDO_INTERCEPT */
bool
intercept_setup(int fd, struct sudo_event_base *evbase,
struct command_details *details)
{
debug_decl(intercept_setup, SUDO_DEBUG_EXEC);
/* Intercept support not compiled in. */
debug_return_bool(false);
}
#endif /* _PATH_SUDO_INTERCEPT */