/*
* CDDL HEADER START
*
* 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
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <netdb.h>
#include <pwd.h>
#include <string.h>
#include <unistd.h>
#include <alloca.h>
#include <stdlib.h>
#include <bsm/audit_uevents.h>
#include <bsm/audit_record.h>
/* Private Functions */
int aug_selected();
int aug_na_selected();
/* Global Variables */
/*
* cannot_audit:
* Return 1 if audit module not loaded.
* Return 0 otherwise.
*
* The argument, force, should be set to 1 for long-lived processes
* like some daemons. Force should be set to 0 for most programs.
*/
int
int force;
{
int cond = 0;
} else {
}
}
}
/*
* aug_init():
* Initialize global variables.
*/
void
aug_init()
{
aug_pid = -1;
aug_event = 0;
aug_sorf = -2;
aug_na = 0;
}
/*
* aug_get_port:
* Return the raw device number of the port to which the
* current process is attached (assumed to be attached
* through file descriptor 0) or 0 if can't stat the port.
*/
{
int rc;
char *ttyn;
return (0);
}
if (rc < 0) {
perror("stat");
return (0);
}
}
/*
* aug_get_machine:
* Return internet address of host hostname,
* or 0 if can't do lookup.
*/
int
{
int err;
void *p;
if (err != 0)
return (0);
case AF_INET:
/* LINTED */
sizeof (((struct sockaddr_in *)0)->sin_addr));
break;
case AF_INET6:
/* LINTED */
sizeof (((struct sockaddr_in6 *)0)->sin6_addr));
break;
default:
return (0);
}
return (1);
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
}
void
{
int i;
for (i = 0; i < (type/4); i++)
}
int
aug_save_me(void)
{
return (-1);
aug_save_euid(geteuid());
aug_save_egid(getegid());
aug_save_uid(getuid());
aug_save_gid(getgid());
aug_save_pid(getpid());
return (0);
}
/*
* aug_save_namask():
* Save the namask using the naflags entry in the audit_control file.
* Return 0 if successful.
* Return -1, and don't change the namask, if failed.
* Side Effect: Sets aug_na to -1 if error, 1 if successful.
*/
int
{
aug_na = -1;
/*
* get non-attributable system event mask from kernel.
*/
return (-1);
}
aug_na = 1;
return (0);
}
void
{
}
void
{
}
void
aug_save_text(char *s)
{
if (s == NULL)
else
}
void
aug_save_text1(char *s)
{
if (s == NULL)
else
}
void
aug_save_text2(char *s)
{
if (s == NULL)
else
}
void
{
}
void
aug_save_path(char *s)
{
if (s == NULL)
}
int
{
return (-1);
}
aug_policy = policy;
return (0);
}
/*
* aug_audit:
* Cut and audit record if it is selected.
* Return 0, if successfully written.
* Return 0, if not written, and not expected to write.
* Return -1, if not written because of unexpected error.
*/
int
aug_audit(void)
{
int ad;
if (cannot_audit(0)) {
return (0);
}
if (aug_na) {
if (!aug_na_selected()) {
return (0);
}
} else if (!aug_selected()) {
return (0);
}
return (-1);
}
if (is_system_labeled())
if (aug_policy & AUDIT_GROUP) {
int ng;
}
}
}
}
}
}
}
#ifdef _LP64
#else
#endif
return (-1);
}
return (0);
}
int
{
if (aug_na == -1) {
return (-1);
}
}
int
{
(void) aug_save_namask();
return (aug_na_selected());
}
return (-1);
}
}
static int
{
int prs_sorf;
if (sorf == 0) {
} else if (sorf == -1) {
} else {
}
}