summaryrefslogtreecommitdiff
path: root/bin/systrace
diff options
context:
space:
mode:
authorPeter Valchev <pvalchev@cvs.openbsd.org>2003-06-19 06:26:20 +0000
committerPeter Valchev <pvalchev@cvs.openbsd.org>2003-06-19 06:26:20 +0000
commitf54e7db8dd3f8b752ad9a007594e9e2cdf778820 (patch)
treebfacbe3bd218d8f7d6cc2b3d06eff13c59e458fa /bin/systrace
parent2a886664db4bf6b331e3f775a22af1f3be9447f4 (diff)
remove unused code which allocated useless memory (which was not freed)
ok provos itojun
Diffstat (limited to 'bin/systrace')
-rw-r--r--bin/systrace/policy.c23
1 files changed, 1 insertions, 22 deletions
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 <provos@citi.umich.edu>
* 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();