summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/c2/audit_path.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/c2/audit_path.c')
-rw-r--r--usr/src/uts/common/c2/audit_path.c69
1 files changed, 3 insertions, 66 deletions
diff --git a/usr/src/uts/common/c2/audit_path.c b/usr/src/uts/common/c2/audit_path.c
index ec0f3ce5de..cf51d2c3b6 100644
--- a/usr/src/uts/common/c2/audit_path.c
+++ b/usr/src/uts/common/c2/audit_path.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,12 +19,10 @@
* CDDL HEADER END
*/
/*
- * Copyright 1991-2003 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* @(#)audit_path.c 2.7 92/02/16 SMI; SunOS CMW
* @(#)audit_path.c 4.2.1.2 91/05/08 SMI; BSM Module
@@ -56,66 +53,6 @@
#include <sys/sysmacros.h>
#include <sys/atomic.h>
-/*
- * allocate a new auditpath
- * newsect = increment sections count,
- * charincr = change in strings storage
- */
-struct audit_path *
-au_pathdup(const struct audit_path *oldapp, int newsect, int charincr)
-{
- struct audit_path *newapp;
- int i, alloc_size, oldlen;
- char *oldcp, *newcp;
-
- newsect = (newsect != 0);
- oldcp = oldapp->audp_sect[0];
- oldlen = (oldapp->audp_sect[oldapp->audp_cnt] - oldcp);
- alloc_size = sizeof (struct audit_path) +
- (oldapp->audp_cnt + newsect) * sizeof (char *) +
- oldlen + charincr;
-
- newapp = kmem_alloc(alloc_size, KM_SLEEP);
- newapp->audp_ref = 1;
- newapp->audp_size = alloc_size;
-
- newapp->audp_cnt = oldapp->audp_cnt + newsect;
- newcp = (char *)(&newapp->audp_sect[newapp->audp_cnt + 1]);
- for (i = 0; i <= oldapp->audp_cnt; i++) {
- newapp->audp_sect[i] = newcp +
- (oldapp->audp_sect[i] - oldcp);
- }
- /*
- * if this is a new section, set its end
- * if this is an extended section, reset its end
- */
- newapp->audp_sect[newapp->audp_cnt] = newcp + oldlen + charincr;
- /* copy all of the old strings */
- bcopy(oldcp, newcp, oldlen);
-
- return (newapp);
-}
-
-/*
- * increment audit path reference count
- */
-void
-au_pathhold(struct audit_path *app)
-{
- atomic_add_32(&app->audp_ref, 1);
-}
-
-/*
- * decrement audit path reference count
- */
-void
-au_pathrele(struct audit_path *app)
-{
- if (atomic_add_32_nv(&app->audp_ref, -1) > 0)
- return;
- kmem_free(app, app->audp_size);
-}
-
int
au_token_size(m)