audit.c revision 2020b2b6df0384feda1732f65486c4604fbf5bea
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * CDDL HEADER START
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * The contents of this file are subject to the terms of the
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * Common Development and Distribution License (the "License").
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * You may not use this file except in compliance with the License.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * See the License for the specific language governing permissions
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * and limitations under the License.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * When distributing Covered Code, include this CDDL HEADER in each
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * If applicable, add the following below this CDDL HEADER, with the
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * fields enclosed by brackets "[]" replaced with your own identifying
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * information: Portions Copyright [yyyy] [name of copyright owner]
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * CDDL HEADER END
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_FLG_BINDTO_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_FLG_BINDFROM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * Ensure that Conv_la_bind_buf_t is large enough:
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * BINDSZ is the real minimum size of the buffer required by conv_la_bind().
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * However, Conv_la_bind_buf_t uses CONV_LA_BIND_BUFSIZE to set the
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * buffer size. We do things this way because the definition of BINDSZ uses
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * information that is not available in the environment of other programs
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * that include the conv.h header file.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans#if (CONV_LA_BIND_BUFSIZE != BINDSZ) && !defined(__lint)
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans#error "CONV_LA_BIND_BUFSIZE does not match BINDSZ"
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * String conversion routine for la_objopen() return flags.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evansconv_la_bind(uint_t bind, Conv_la_bind_buf_t *la_bind_buf)
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans#define SEARCHSZ CONV_EXPN_FIELD_DEF_PREFIX_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SER_ORIG_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SER_LIBPATH_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SER_RUNPATH_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SER_DEFAULT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SER_CONFIG_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SER_SECURE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * Ensure that Conv_la_search_buf_t is large enough:
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * SEARCHSZ is the real minimum size of the buffer required by conv_la_search().
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * However, Conv_la_search_buf_t uses CONV_LA_SEARCH_BUFSIZE to set the
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * buffer size. We do things this way because the definition of SEARCHSZ uses
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * information that is not available in the environment of other programs
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * that include the conv.h header file.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans#if (CONV_LA_SEARCH_BUFSIZE != SEARCHSZ) && !defined(__lint)
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans#error "CONV_LA_SEARCH_BUFSIZE does not match SEARCHSZ"
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * String conversion routine for la_objsearch() flags.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evansconv_la_search(uint_t search, Conv_la_search_buf_t *la_search_buf)
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * String conversion routine for la_objopen() return flags.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * String conversion routine for la_activity() flags.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evansconv_la_activity(uint_t request, Conv_fmt_flags_t fmt_flags,
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_ACT_CONSISTENT, /* MSG_ORIG(MSG_LA_ACT_CONSISTENT) */
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_ACT_DELETE /* MSG_ORIG(MSG_LA_ACT_DELETE) */
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans static const conv_ds_t *ds[] = { CONV_DS_ADDR(ds_requests), NULL };
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans return (conv_map_ds(ELFOSABI_NONE, EM_NONE, request, ds, fmt_flags,
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SYMB_NOPLTENTER_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SYMB_NOPLTEXIT_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SYMB_STRUCTCALL_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SYMB_DLSYM_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans MSG_LA_SYMB_ALTVALUE_SIZE + CONV_EXPN_FIELD_DEF_SEP_SIZE + \
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans CONV_INV_BUFSIZE + CONV_EXPN_FIELD_DEF_SUFFIX_SIZE
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * Ensure that Conv_la_symbind_buf_t is large enough:
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * SYMBSZ is the real minimum size of the buffer required by conv_la_symbind().
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * However, Conv_la_symbind_buf_t uses CONV_LA_SYMB_BUFSIZE to set the
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * buffer size. We do things this way because the definition of SYMBSZ uses
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * information that is not available in the environment of other programs
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * that include the conv.h header file.
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans#if (CONV_LA_SYMBIND_BUFSIZE != SYMBSZ) && !defined(__lint)
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans#error "CONV_LA_SYMBIND_BUFSIZE does not match SYMBSZ"
2020b2b6df0384feda1732f65486c4604fbf5beaRod Evans * String conversion routine for la_symbind() flags.