diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-05 22:01:06 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2010-07-05 22:01:06 +0000 |
commit | 7a595e8a2fa5b7ce664ffe99371a14c15770ee36 (patch) | |
tree | b7a0e50f1bbb37c35656a10e0631b94104e3b497 /testsuites/psxtests/psxid01 | |
parent | 2010-07-05 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-7a595e8a2fa5b7ce664ffe99371a14c15770ee36.tar.bz2 |
2010-07-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxid01/init.c, psxid01/psxid01.scn: Actually match an entry in
/etc/passwd and /etc/group.
Diffstat (limited to 'testsuites/psxtests/psxid01')
-rw-r--r-- | testsuites/psxtests/psxid01/init.c | 14 | ||||
-rw-r--r-- | testsuites/psxtests/psxid01/psxid01.scn | 5 |
2 files changed, 16 insertions, 3 deletions
diff --git a/testsuites/psxtests/psxid01/init.c b/testsuites/psxtests/psxid01/init.c index 3c64aacb94..c0e157c203 100644 --- a/testsuites/psxtests/psxid01/init.c +++ b/testsuites/psxtests/psxid01/init.c @@ -106,7 +106,15 @@ void test_getlogin(void) int sc; char ch; - printf( "getlogin() -- %s\n", getlogin() ); + puts( "setuid(5)" ); + sc = setuid(5); + rtems_test_assert( sc == 0 ); + printf( "getlogin() -- (%s)\n", getlogin() ); + + puts( "setuid(0)" ); + sc = setuid(0); + rtems_test_assert( sc == 0 ); + printf( "getlogin() -- (%s)\n", getlogin() ); puts( "getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT" ); sc = getlogin_r( NULL, LOGIN_NAME_MAX ); @@ -146,7 +154,9 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_MAXIMUM_TASKS 1 +/* so we can write /etc/passwd and /etc/group */ +#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_INIT diff --git a/testsuites/psxtests/psxid01/psxid01.scn b/testsuites/psxtests/psxid01/psxid01.scn index 0a58a0ad8e..8b9143d113 100644 --- a/testsuites/psxtests/psxid01/psxid01.scn +++ b/testsuites/psxtests/psxid01/psxid01.scn @@ -20,7 +20,10 @@ getpgrp - return local node - OK getpgrp returned 1 getgroups - return 0 - OK -getlogin() -- +setuid(5) +getlogin() -- () +setuid(0) +getlogin() -- (root) getlogin_r(NULL, LOGIN_NAME_MAX) -- EFAULT getlogin_r(buffer, 0) -- ERANGE *** END OF TEST ID 01 *** |