Changeset 065d72ce in rtems


Ignore:
Timestamp:
Nov 17, 2014, 9:19:00 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
373ccbb9
Parents:
b8bd90f6
git-author:
Sebastian Huber <sebastian.huber@…> (11/17/14 09:19:00)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/20/14 09:30:23)
Message:

shell: Get supplementary group IDs in login check

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/shell/login_check.c

    rb8bd90f6 r065d72ce  
    3434
    3535#include <rtems/shell.h>
     36#include <rtems/userenv.h>
    3637
    3738bool rtems_shell_login_check(
     
    7778    seteuid(pw.pw_uid);
    7879    setegid(pw.pw_gid);
     80    rtems_current_user_env_getgroups();
    7981  }
    8082
  • testsuites/libtests/shell01/init.c

    rb8bd90f6 r065d72ce  
    2626
    2727#include <rtems/shell.h>
     28#include <rtems/userenv.h>
    2829
    2930#include "tmacros.h"
     
    4849static void test(void)
    4950{
     51  rtems_user_env_t *uenv;
    5052  bool ok;
    5153  int rv;
     
    7476  );
    7577
     78  uenv = rtems_current_user_env_get();
     79
    7680  rv = setuid(0);
    7781  rtems_test_assert(rv == 0);
     
    96100  rtems_test_assert(getgid() == 0);
    97101  rtems_test_assert(getegid() == 0);
     102  rtems_test_assert(uenv->ngroups == 0);
    98103
    99104  ok = rtems_shell_login_check("zero", NULL);
     
    103108  rtems_test_assert(getgid() == 5);
    104109  rtems_test_assert(getegid() == 5);
     110  rtems_test_assert(uenv->ngroups == 1);
     111  rtems_test_assert(uenv->groups[0] == 1);
    105112
    106113  ok = rtems_shell_login_check("moop", "foo");
     
    110117  rtems_test_assert(getgid() == 3);
    111118  rtems_test_assert(getegid() == 3);
     119  rtems_test_assert(uenv->ngroups == 5);
     120  rtems_test_assert(uenv->groups[0] == 1);
     121  rtems_test_assert(uenv->groups[1] == 2);
     122  rtems_test_assert(uenv->groups[2] == 4);
     123  rtems_test_assert(uenv->groups[3] == 5);
     124  rtems_test_assert(uenv->groups[4] == 8);
    112125}
    113126
Note: See TracChangeset for help on using the changeset viewer.