Add support for command timeouts in sudoers. After the timeout,

the command will be terminated.
This commit is contained in:
Todd C. Miller
2017-02-14 15:56:34 -07:00
parent 4f9dcd7264
commit 3980f1531b
31 changed files with 2367 additions and 1749 deletions

View File

@@ -113,7 +113,8 @@ struct cmndtag {
* Per-command option container struct.
*/
struct command_options {
struct cmndtag tags; /* Command tags */
struct cmndtag tags; /* tag specificaion */
int timeout; /* command timeout */
#ifdef HAVE_SELINUX
char *role, *type; /* SELinux role and type */
#endif
@@ -168,6 +169,7 @@ struct privilege {
/*
* Structure describing a linked list of Cmnd_Specs.
* XXX - include struct command_options instad of its contents inline
*/
struct cmndspec {
TAILQ_ENTRY(cmndspec) entries;
@@ -175,6 +177,7 @@ struct cmndspec {
struct member_list *runasgrouplist; /* list of runas groups */
struct member *cmnd; /* command to allow/deny */
struct cmndtag tags; /* tag specificaion */
int timeout; /* command timeout */
#ifdef HAVE_SELINUX
char *role, *type; /* SELinux role and type */
#endif
@@ -275,4 +278,7 @@ int hexchar(const char *s);
/* base64.c */
size_t base64_decode(const char *str, unsigned char *dst, size_t dsize);
/* timeout.c */
int parse_timeout(const char *timestr);
#endif /* SUDOERS_PARSE_H */