Exemplo n.º 1
0
std::vector<GroupInfo> BuiltInAuthn::getGroups(void) throw (DmException)
{
  std::vector<GroupInfo> groups;
  GroupInfo group;
  struct group* ent;
  
  while ((ent = getgrent()) != NULL) {
    group.clear();
    group.name   = ent->gr_name;
    group["gid"] = ent->gr_gid;
  }
  
  return groups;
}
Exemplo n.º 2
0
std::vector<GroupInfo> NsAdapterCatalog::getGroups(void) throw (DmException)
{
  std::vector<GroupInfo> groups;
  struct dpns_groupinfo* dpnsGroups;
  GroupInfo group;
  int       nGroups;
  
  wrapCall(dpns_getgrpmap(&nGroups, &dpnsGroups));
  for (int i = 0; i < nGroups; ++i) {
    group.clear();
    group.name      = dpnsGroups[i].groupname;
    group["gid"]    = dpnsGroups[i].gid;
    group["banned"] = dpnsGroups[i].banned;
    groups.push_back(group);
  }
  free(dpnsGroups);
  
  return groups;
}