diff options
author | Marek Pospisil <Marek.Pospisil@Sun.COM> | 2010-03-09 04:56:09 -0800 |
---|---|---|
committer | Marek Pospisil <Marek.Pospisil@Sun.COM> | 2010-03-09 04:56:09 -0800 |
commit | 96093503d6c90cc5a0cd2ce8c88e1975be2d00b3 (patch) | |
tree | d716060fc43a9c2a178f9deedfb998edba758254 | |
parent | d132affafd84df8f910e9921e5c725c897f24dd4 (diff) | |
download | illumos-joyent-96093503d6c90cc5a0cd2ce8c88e1975be2d00b3.tar.gz |
PSARC/2009/613 auditon(2) clarification
6884238 The audit_policy variable should be a uint32_t.
-rw-r--r-- | usr/src/cmd/audit/audit.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/auditd/auditd.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/smserverd/myaudit.c | 4 | ||||
-rw-r--r-- | usr/src/cmd/smserverd/smserver.h | 11 | ||||
-rw-r--r-- | usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c | 4 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/adt_xlate.h | 4 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/audit_allocate.c | 2 | ||||
-rw-r--r-- | usr/src/lib/libbsm/common/generic.c | 6 | ||||
-rw-r--r-- | usr/src/uts/common/c2/audit_kernel.h | 4 | ||||
-rw-r--r-- | usr/src/uts/common/syscall/auditsys.c | 10 |
10 files changed, 23 insertions, 26 deletions
diff --git a/usr/src/cmd/audit/audit.c b/usr/src/cmd/audit/audit.c index bf31448d13..8616fe4a92 100644 --- a/usr/src/cmd/audit/audit.c +++ b/usr/src/cmd/audit/audit.c @@ -294,7 +294,7 @@ is_audit_control_ok(char *filename) { static boolean_t is_valid_zone(boolean_t show_err) { - long policy; + uint32_t policy; if (auditon(A_GETPOLICY, (char *)&policy, 0) == -1) { (void) fprintf(stderr, gettext( diff --git a/usr/src/cmd/auditd/auditd.c b/usr/src/cmd/auditd/auditd.c index a616ebd52b..14e76d88a4 100644 --- a/usr/src/cmd/auditd/auditd.c +++ b/usr/src/cmd/auditd/auditd.c @@ -599,7 +599,7 @@ loadauditlist() int acresult; int wait_count = 0; kva_t *kvlist; - long policy; + uint32_t policy; int cnt_flag; struct au_qctrl kqmax; au_acinfo_t *ach = NULL; diff --git a/usr/src/cmd/smserverd/myaudit.c b/usr/src/cmd/smserverd/myaudit.c index 845f53fe8b..041cfc9360 100644 --- a/usr/src/cmd/smserverd/myaudit.c +++ b/usr/src/cmd/smserverd/myaudit.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -78,7 +78,7 @@ can_audit(void) static int audit_save_policy(door_data_t *door_dp) { - int policy; + uint32_t policy; if (auditon(A_GETPOLICY, (caddr_t)&policy, sizeof (policy))) { return (-1); diff --git a/usr/src/cmd/smserverd/smserver.h b/usr/src/cmd/smserverd/smserver.h index cb82833719..691192e8f8 100644 --- a/usr/src/cmd/smserverd/smserver.h +++ b/usr/src/cmd/smserverd/smserver.h @@ -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,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SMSERVER_H_ #define _SMSERVER_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -149,7 +146,7 @@ typedef struct door_data { char *audit_user; /* text version of audit_uid */ au_asid_t audit_asid; /* asid of process writing record */ char *audit_path; /* path token */ - int audit_policy; /* kernel audit policy */ + uint32_t audit_policy; /* kernel audit policy */ struct auditpinfo_addr audit_ap; char audit_text[128]; char audit_text1[128]; diff --git a/usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c b/usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c index 35a0926d7b..9283ff2dc6 100644 --- a/usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c +++ b/usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c @@ -1249,8 +1249,8 @@ s10_acctctl(sysret_t *rval, int cmd, void *buf, size_t bufsz) int s10_auditsys(sysret_t *rval, int bsmcmd, intptr_t a0, intptr_t a1, intptr_t a2) { - int err; - uint_t m; + int err; + uint32_t m; if (bsmcmd != BSM_AUDITCTL) return (__systemcall(rval, SYS_auditsys + 1024, bsmcmd, a0, a1, diff --git a/usr/src/lib/libbsm/common/adt_xlate.h b/usr/src/lib/libbsm/common/adt_xlate.h index c4491ed24a..4e417bf287 100644 --- a/usr/src/lib/libbsm/common/adt_xlate.h +++ b/usr/src/lib/libbsm/common/adt_xlate.h @@ -21,7 +21,7 @@ /* * adt_xlate.h * - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * */ @@ -206,7 +206,7 @@ struct adt_internal_state { uint32_t as_have_user_data; - int as_kernel_audit_policy; + uint32_t as_kernel_audit_policy; int as_session_model; adt_session_flags_t as_flags; pid_t as_pid; diff --git a/usr/src/lib/libbsm/common/audit_allocate.c b/usr/src/lib/libbsm/common/audit_allocate.c index ebfa4b1561..745c40f82e 100644 --- a/usr/src/lib/libbsm/common/audit_allocate.c +++ b/usr/src/lib/libbsm/common/audit_allocate.c @@ -89,7 +89,7 @@ audit_allocate_record(status) { auditinfo_addr_t mask; /* audit ID */ au_event_t event; /* audit event number */ - int policy; /* audit policy */ + uint32_t policy; /* audit policy */ int ng; /* number of groups in process */ #ifdef DEBUG diff --git a/usr/src/lib/libbsm/common/generic.c b/usr/src/lib/libbsm/common/generic.c index e1d1929070..199076c193 100644 --- a/usr/src/lib/libbsm/common/generic.c +++ b/usr/src/lib/libbsm/common/generic.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -68,7 +68,7 @@ static char *aug_text2; /* misc text to be written to trail */ static au_asid_t aug_asid; /* asid of process writing record */ static int (*aug_afunc)(); /* write additional tokens if needed */ static char *aug_path; /* path token */ -static int aug_policy; /* kernel audit policy */ +static uint32_t aug_policy; /* kernel audit policy */ /* * cannot_audit: @@ -377,7 +377,7 @@ aug_save_path(char *s) int aug_save_policy() { - int policy; + uint32_t policy; if (auditon(A_GETPOLICY, (caddr_t)&policy, sizeof (policy))) { return (-1); diff --git a/usr/src/uts/common/c2/audit_kernel.h b/usr/src/uts/common/c2/audit_kernel.h index 21d648ae83..d2c61c3257 100644 --- a/usr/src/uts/common/c2/audit_kernel.h +++ b/usr/src/uts/common/c2/audit_kernel.h @@ -307,7 +307,7 @@ struct au_kcontext { int auk_auditstate; int auk_output_active; struct vnode *auk_current_vp; - int auk_policy; + uint32_t auk_policy; struct audit_queue auk_queue; @@ -337,7 +337,7 @@ extern zone_key_t au_zone_key; /* * Kernel auditing external variables */ -extern int audit_policy; +extern uint32_t audit_policy; extern int audit_active; extern struct audit_queue au_queue; diff --git a/usr/src/uts/common/syscall/auditsys.c b/usr/src/uts/common/syscall/auditsys.c index 538709e2d2..43b7df42b9 100644 --- a/usr/src/uts/common/syscall/auditsys.c +++ b/usr/src/uts/common/syscall/auditsys.c @@ -35,7 +35,7 @@ extern kmutex_t pidlock; -int audit_policy; /* global audit policies in force */ +uint32_t audit_policy; /* global audit policies in force */ /*ARGSUSED1*/ @@ -406,12 +406,12 @@ setaudit_addr(caddr_t info_p, int len) static int getpolicy(caddr_t data) { - int policy; + uint32_t policy; au_kcontext_t *kctx = GET_KCTX_PZ; policy = audit_policy | kctx->auk_policy; - if (copyout(&policy, data, sizeof (int))) + if (copyout(&policy, data, sizeof (policy))) return (EFAULT); return (0); } @@ -437,10 +437,10 @@ getpolicy(caddr_t data) static int setpolicy(caddr_t data) { - int policy; + uint32_t policy; au_kcontext_t *kctx; - if (copyin(data, &policy, sizeof (int))) + if (copyin(data, &policy, sizeof (policy))) return (EFAULT); kctx = GET_KCTX_NGZ; |