summaryrefslogtreecommitdiff
path: root/src/libstddjb/prot_grps.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-08-01 20:26:05 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-08-01 20:26:05 +0000
commit7bf3e29007350897cb708da01df845f4d58b4173 (patch)
tree7f6ecb1b4706d955d9bf52f2b3aa7aff11419109 /src/libstddjb/prot_grps.c
parente8fe8ed8117bb1a58cd588b295352875d3c08c1a (diff)
downloadskalibs-7bf3e29007350897cb708da01df845f4d58b4173.tar.xz
Remove prot
Diffstat (limited to 'src/libstddjb/prot_grps.c')
-rw-r--r--src/libstddjb/prot_grps.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/libstddjb/prot_grps.c b/src/libstddjb/prot_grps.c
deleted file mode 100644
index c5ea35b..0000000
--- a/src/libstddjb/prot_grps.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* ISC license. */
-
-/* MT-unsafe */
-
-#include <unistd.h>
-#include <pwd.h>
-#include <grp.h>
-#include <limits.h>
-#include <errno.h>
-#include <skalibs/setgroups.h>
-#include <skalibs/djbunix.h>
-
-int prot_grps (char const *name)
-{
- gid_t tab[NGROUPS_MAX] ;
- struct passwd *pw ;
- int n = prot_readgroups(name, tab, NGROUPS_MAX) ;
- if (n < 0) return n ;
- errno = 0 ;
- pw = getpwnam(name) ;
- if (!pw)
- {
- if (!errno) errno = ENOENT ;
- return -1 ;
- }
- return setgroups_and_gid(pw->pw_gid, n, tab) ;
-}