From fa028bb2ef1e3cd9a8dfdd8b557e5acda3e11505 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 17 Nov 2014 11:55:27 +0100 Subject: shell: Do chroot() after successful login --- testsuites/samples/fileio/init.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'testsuites/samples/fileio') diff --git a/testsuites/samples/fileio/init.c b/testsuites/samples/fileio/init.c index 1c6c88c6a6..4dd00ed7a7 100644 --- a/testsuites/samples/fileio/init.c +++ b/testsuites/samples/fileio/init.c @@ -636,9 +636,14 @@ static void fileio_start_shell(void) printf( "mkdir /etc: %s:\n", strerror(errno) ); } + sc = mkdir("/chroot", 0777); + if ( sc ) { + printf( "mkdir /chroot: %s:\n", strerror(errno) ); + } + printf( "Creating /etc/passwd and group with three useable accounts\n" - "root/pwd , test/pwd, rtems/NO PASSWORD" + "root/pwd , test/pwd, rtems/NO PASSWORD, chroot/NO PASSWORD" ); writeFile( @@ -649,6 +654,7 @@ static void fileio_start_shell(void) "rtems::1:1:RTEMS Application::/:/bin/sh\n" "test:$1$$oPu1Xt2Pw0ngIc7LyDHqu1:2:2:test account::/:/bin/sh\n" "tty:*:3:3:tty owner::/:/bin/false\n" + "chroot::4:2:chroot account::/chroot:/bin/sh\n" ); writeFile( "/etc/group", -- cgit v1.2.3