From acf9a8dd54d1b1cb01e361784146a062a29e1487 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Nov 2014 14:31:54 +0100 Subject: shell: Use crypt_r() in rtems_shell_login_check() Use '*" to disable shell login instead of '!' according to the Linux man page. Use getpwnam_r() instead of getpwnam(). Do not access the user environment directly. Update the user environment only after a successful login check. --- testsuites/samples/fileio/init.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'testsuites/samples/fileio/init.c') diff --git a/testsuites/samples/fileio/init.c b/testsuites/samples/fileio/init.c index 2b60922b1c..735b5883bc 100644 --- a/testsuites/samples/fileio/init.c +++ b/testsuites/samples/fileio/init.c @@ -13,6 +13,7 @@ #define CONFIGURE_INIT #include "system.h" +#include #include #include #include @@ -641,10 +642,11 @@ static void fileio_start_shell(void) writeFile( "/etc/passwd", 0644, - "root:7QR4o148UPtb.:0:0:root::/:/bin/sh\n" - "rtems:*:1:1:RTEMS Application::/:/bin/sh\n" - "test:8Yy.AaxynxbLI:2:2:test account::/:/bin/sh\n" - "tty:!:3:3:tty owner::/:/bin/false\n" + "root:$6$$FuPOhnllx6lhW2qqlnmWvZQLJ8Thr/09I7ESTdb9VbnTOn5.65" + "/Vh2Mqa6FoKXwT0nHS/O7F0KfrDc6Svb/sH.:0:0:root::/:/bin/sh\n" + "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" ); writeFile( "/etc/group", @@ -1225,6 +1227,9 @@ Init (rtems_task_argument ignored) TEST_BEGIN(); + crypt_add_format(&crypt_md5_format); + crypt_add_format(&crypt_sha512_format); + status = rtems_shell_wait_for_input( STDIN_FILENO, 20, -- cgit v1.2.3