diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-08-01 20:26:05 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-08-01 20:26:05 +0000 |
commit | 7bf3e29007350897cb708da01df845f4d58b4173 (patch) | |
tree | 7f6ecb1b4706d955d9bf52f2b3aa7aff11419109 /src/libstddjb/prot_readgroups.c | |
parent | e8fe8ed8117bb1a58cd588b295352875d3c08c1a (diff) | |
download | skalibs-7bf3e29007350897cb708da01df845f4d58b4173.tar.xz |
Remove prot
Diffstat (limited to 'src/libstddjb/prot_readgroups.c')
-rw-r--r-- | src/libstddjb/prot_readgroups.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/libstddjb/prot_readgroups.c b/src/libstddjb/prot_readgroups.c deleted file mode 100644 index 431cf1c..0000000 --- a/src/libstddjb/prot_readgroups.c +++ /dev/null @@ -1,27 +0,0 @@ -/* ISC license. */ - -/* MT-unsafe */ - -#include <grp.h> -#include <errno.h> -#include <string.h> -#include <skalibs/djbunix.h> - -int prot_readgroups (char const *name, gid_t *tab, unsigned int max) -{ - unsigned int n = 0 ; - for (;;) - { - struct group *gr ; - char **member ; - errno = 0 ; - if (n >= max) break ; - gr = getgrent() ; - if (!gr) break ; - for (member = gr->gr_mem ; *member ; member++) - if (!strcmp(name, *member)) break ; - if (*member) tab[n++] = gr->gr_gid ; - } - endgrent() ; - return errno ? -1 : n ; -} |