summaryrefslogtreecommitdiffstats
path: root/testsuite/nsswitch/initgroups.c
diff options
context:
space:
mode:
authorcvs2svn Import User <samba-bugs@samba.org>2001-06-23 20:19:24 +0000
committercvs2svn Import User <samba-bugs@samba.org>2001-06-23 20:19:24 +0000
commit128b73da7b86c45e411e5331251f9ed08f0f689e (patch)
tree16b8fa688776961ddd7b0fc2432daaad169229e7 /testsuite/nsswitch/initgroups.c
parent4201e0777f37058b7c19ebfa534e1968d3a3e3b5 (diff)
downloadsamba-2.2.0a.tar.gz
samba-2.2.0a.tar.xz
samba-2.2.0a.zip
This commit was manufactured by cvs2svn to create tagsamba-2.2.0a
'release-2-2-0a'.
Diffstat (limited to 'testsuite/nsswitch/initgroups.c')
-rw-r--r--testsuite/nsswitch/initgroups.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/testsuite/nsswitch/initgroups.c b/testsuite/nsswitch/initgroups.c
deleted file mode 100644
index b7d9c50eaa3..00000000000
--- a/testsuite/nsswitch/initgroups.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <grp.h>
-#include <pwd.h>
-#include <sys/types.h>
-
-int main(int argc, char **argv)
-{
- int result, ngroups, i;
- gid_t *groups;
- struct passwd *pw;
-
- if (!(pw = getpwnam(argv[1]))) {
- printf("FAIL: no passwd entry for %s\n", argv[1]);
- return 1;
- }
-
- result = initgroups(argv[1], pw->pw_gid);
-
- if (result == -1) {
- printf("FAIL");
- return 1;
- }
-
- ngroups = getgroups(0, NULL);
-
- groups = (gid_t *)malloc(sizeof(gid_t) * ngroups);
- ngroups = getgroups(ngroups, groups);
-
- printf("%s is a member of groups:\n", argv[1]);
-
- for (i = 0; i < ngroups; i++) {
- struct group *grp;
-
- grp = getgrgid(groups[i]);
-
- printf("%d (%s)\n", groups[i], grp ? grp->gr_name : "?");
- }
-
- printf("PASS\n");
- return 0;
-}