Esempio n. 1
0
MODRET pw_getgrent(cmd_rec *cmd) {
  struct group *gr;

  if (persistent_passwd)
    gr = p_getgrent();

  else
    gr = getgrent();

  return gr ? mod_create_data(cmd, gr) : PR_DECLINED(cmd);
}
Esempio n. 2
0
MODRET pw_getgrent(cmd_rec *cmd) {
  struct group *gr = NULL;

  if (unix_persistent_passwd) {
    gr = p_getgrent();

  } else {
    gr = getgrent();
  }

  return gr ? mod_create_data(cmd, gr) : PR_DECLINED(cmd);
}
Esempio n. 3
0
static struct group *p_getgrgid(gid_t gid) {
  struct group *gr = NULL;

  p_setgrent();
  while ((gr = p_getgrent()) != NULL) {
    pr_signals_handle();

    if (gr->gr_gid == gid)
      break;
  }

  return gr;
}
Esempio n. 4
0
static struct group *p_getgrnam(const char *name) {
  struct group *gr = NULL;

  p_setgrent();
  while ((gr = p_getgrent()) != NULL) {
    pr_signals_handle();

    if (strcmp(name, gr->gr_name) == 0)
      break;
  }

  return gr;
}