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.
This commit is contained in:
Joel Sherrill
2010-07-05 22:01:06 +00:00
parent 95cf41e21e
commit 7a595e8a2f
3 changed files with 21 additions and 3 deletions
+5
View File
@@ -1,3 +1,8 @@
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.
2010-07-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxid01/init.c, psxid01/psxid01.doc, psxid01/psxid01.scn: Add test
+12 -2
View File
@@ -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
+4 -1
View File
@@ -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 ***