xref: /illumos-gate/usr/src/man/man3bsm/au_user_mask.3bsm (revision 20a7641f9918de8574b8b3b47dbe35c4bfc78df1)
te
Copyright (c) 2017 Peter Tribble
Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the 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. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
AU_USER_MASK 3BSM "Mar 6, 2017"
NAME
au_user_mask - get user's binary preselection mask
SYNOPSIS

cc [ flag... ] file... -lbsm  -lsocket   -lnsl  [ library... ]
#include <bsm/libbsm.h>

int au_user_mask(char *username, au_mask_t *mask_p);
DESCRIPTION

The au_user_mask() function reads the default, system wide audit classes, combines them with the per-user audit classes, and updates the binary preselection mask pointed to by mask_p with the combined value.

The audit preselection mask is constructed as follows:

success flags =
 (system default success flags + per-user always success flags)
 - per-user never success flags
failure flags =
 (system default failure flags + per-user always failure flags)
 - per-user never failure flags

The au_user_mask() function fails only if the system wide audit flags could not be retrieved.

RETURN VALUES

Upon successful completion, au_user_mask() returns 0.

ATTRIBUTES

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Stable
MT-Level MT-Safe
SEE ALSO

login (1), getaudit (2), setaudit (2), au_preselect (3BSM), attributes (7)

NOTES

The au_user_mask() function should be called by programs like login(1) which set a process's preselection mask with setaudit(2). getaudit(2) should be used to obtain audit characteristics for the current process.

If global zone auditing is set, a local zone cannot reduce the default flags.