From ffd52858449d58111581d5ee82ff1c3ffba585a5 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 18 Nov 2014 11:07:36 +0100 Subject: shell: Inherit UID and GID if no login check Use the UID and GID of the executing user for the real and effective UID and GID of the shell task in case no login check is present. This prevents privilege escalation via shell scripts. --- cpukit/libmisc/shell/shell.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cpukit/libmisc/shell/shell.h') diff --git a/cpukit/libmisc/shell/shell.h b/cpukit/libmisc/shell/shell.h index 726a8eeb4e..c137378cbe 100644 --- a/cpukit/libmisc/shell/shell.h +++ b/cpukit/libmisc/shell/shell.h @@ -17,6 +17,7 @@ #ifndef __RTEMS_SHELL_H__ #define __RTEMS_SHELL_H__ +#include #include #include #include @@ -199,6 +200,18 @@ typedef struct { bool output_append; rtems_id wake_on_end; rtems_shell_login_check_t login_check; + + /** + * @brief The real and effective UID of the shell task in case no login check + * is present. + */ + uid_t uid; + + /** + * @brief The real and effective GID of the shell task in case no login check + * is present. + */ + gid_t gid; } rtems_shell_env_t; bool rtems_shell_main_loop( -- cgit v1.2.3