From f54e7db8dd3f8b752ad9a007594e9e2cdf778820 Mon Sep 17 00:00:00 2001 From: Peter Valchev Date: Thu, 19 Jun 2003 06:26:20 +0000 Subject: remove unused code which allocated useless memory (which was not freed) ok provos itojun --- bin/systrace/policy.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'bin/systrace') diff --git a/bin/systrace/policy.c b/bin/systrace/policy.c index 0600ac01830..1f94338d567 100644 --- a/bin/systrace/policy.c +++ b/bin/systrace/policy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: policy.c,v 1.27 2003/06/16 06:36:40 itojun Exp $ */ +/* $OpenBSD: policy.c,v 1.28 2003/06/19 06:26:19 pvalchev Exp $ */ /* * Copyright 2002 Niels Provos * All rights reserved. @@ -101,8 +101,6 @@ SPLAY_GENERATE(polnrtree, policy, nrnode, polnrcompare) extern int userpolicy; static char policydir[MAXPATHLEN]; -static char *groupnames[NGROUPS_MAX]; -static int ngroups; struct tmplqueue templates; @@ -137,28 +135,9 @@ systrace_setupdir(char *path) int systrace_initpolicy(char *file, char *path) { - gid_t groups[NGROUPS_MAX]; - int i; - SPLAY_INIT(&policyroot); SPLAY_INIT(&polnrroot); - /* Find out group names for current user */ - if ((ngroups = getgroups(NGROUPS_MAX, groups)) == -1) - err(1, "getgroups"); - - for (i = 0; i < ngroups; i++) { - struct group *gr; - - if ((gr = getgrgid(groups[i])) != NULL) { - if ((groupnames[i] = strdup(gr->gr_name)) == NULL) - err(1, "strdup(%s)", gr->gr_name); - } else { - if (asprintf(&groupnames[i], "%u", groups[i]) == -1) - errx(1, "asprintf: cannot allocate memory"); - } - } - if (userpolicy) { systrace_setupdir(path); systrace_templatedir(); -- cgit v1.2.3