summaryrefslogtreecommitdiffstats
path: root/sys/security/audit/audit.c
diff options
context:
space:
mode:
authorsson <sson@FreeBSD.org>2009-06-29 20:19:19 +0000
committersson <sson@FreeBSD.org>2009-06-29 20:19:19 +0000
commit3de2232b431b0fc22153f5286da9948f67b3d80e (patch)
treea40b65d24900fa99e8ca16ffc6932787a5d2ed20 /sys/security/audit/audit.c
parent0cabaf8791593503b5c5aee1394849a275c48ef9 (diff)
downloadFreeBSD-src-3de2232b431b0fc22153f5286da9948f67b3d80e.zip
FreeBSD-src-3de2232b431b0fc22153f5286da9948f67b3d80e.tar.gz
Dynamically allocate the gidset field in audit record.
This fixes a problem created by the recent change that allows a large number of groups per user. The gidset field in struct kaudit_record is now dynamically allocated to the size needed rather than statically (using NGROUPS). Approved by: re@ (kensmith, rwatson), gnn (mentor)
Diffstat (limited to 'sys/security/audit/audit.c')
-rw-r--r--sys/security/audit/audit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/security/audit/audit.c b/sys/security/audit/audit.c
index da47d25..1967e05 100644
--- a/sys/security/audit/audit.c
+++ b/sys/security/audit/audit.c
@@ -77,6 +77,7 @@ static MALLOC_DEFINE(M_AUDITCRED, "audit_cred", "Audit cred storage");
MALLOC_DEFINE(M_AUDITDATA, "audit_data", "Audit data storage");
MALLOC_DEFINE(M_AUDITPATH, "audit_path", "Audit path storage");
MALLOC_DEFINE(M_AUDITTEXT, "audit_text", "Audit text storage");
+MALLOC_DEFINE(M_AUDITGIDSET, "audit_gidset", "Audit GID set storage");
SYSCTL_NODE(_security, OID_AUTO, audit, CTLFLAG_RW, 0,
"TrustedBSD audit controls");
@@ -253,6 +254,8 @@ audit_record_dtor(void *mem, int size, void *arg)
free(ar->k_ar.ar_arg_argv, M_AUDITTEXT);
if (ar->k_ar.ar_arg_envv != NULL)
free(ar->k_ar.ar_arg_envv, M_AUDITTEXT);
+ if (ar->k_ar.ar_arg_groups.gidset != NULL)
+ free(ar->k_ar.ar_arg_groups.gidset, M_AUDITGIDSET);
}
/*
OpenPOWER on IntegriCloud