summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/shell/login_check.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-11-17 11:55:27 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-11-20 10:30:24 +0100
commitfa028bb2ef1e3cd9a8dfdd8b557e5acda3e11505 (patch)
treee114dddd79c06902df5d24e627fe41a789ca70fb /cpukit/libmisc/shell/login_check.c
parentshell: Use exiting once initialization (diff)
downloadrtems-fa028bb2ef1e3cd9a8dfdd8b557e5acda3e11505.tar.bz2
shell: Do chroot() after successful login
Diffstat (limited to 'cpukit/libmisc/shell/login_check.c')
-rw-r--r--cpukit/libmisc/shell/login_check.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpukit/libmisc/shell/login_check.c b/cpukit/libmisc/shell/login_check.c
index 9d853f8d1f..a1af07ce1d 100644
--- a/cpukit/libmisc/shell/login_check.c
+++ b/cpukit/libmisc/shell/login_check.c
@@ -66,6 +66,10 @@ bool rtems_shell_login_check(
ok = false;
}
+ if (ok && strcmp(pw.pw_dir, "") != 0) {
+ ok = chroot(pw.pw_dir) == 0;
+ }
+
if (ok) {
rtems_shell_env_t *env = rtems_shell_get_current_env();