diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-11-14 14:31:54 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-11-20 10:30:22 +0100 |
commit | acf9a8dd54d1b1cb01e361784146a062a29e1487 (patch) | |
tree | c3f16482ba4bbbf827b137186086b7f21eafb451 /testsuites/samples/fileio/init.c | |
parent | libcsupport: Minimal /etc/passwd and /etc/group (diff) | |
download | rtems-acf9a8dd54d1b1cb01e361784146a062a29e1487.tar.bz2 |
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.
Diffstat (limited to 'testsuites/samples/fileio/init.c')
-rw-r--r-- | testsuites/samples/fileio/init.c | 13 |
1 files changed, 9 insertions, 4 deletions
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 <crypt.h> #include <stdio.h> #include <string.h> #include <unistd.h> @@ -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, |