myaudit.c revision f48205be61a214698b763ff550ab9e657525104c
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <netdb.h>
#include <pwd.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include "smserver.h"
#include <bsm/audit_uevents.h>
#include <bsm/audit_record.h>
/* Private Functions */
static int audit_selected(door_data_t *);
static int audit_na_selected(door_data_t *);
/*
* can_audit:
* Return 1 if audit module is loaded.
* Return 0 otherwise.
*
*/
int
can_audit(void)
{
int cond = 0;
auc = AUC_DISABLED;
} else {
}
if (auc == AUC_DISABLED)
return (0);
else return (1);
}
static int
{
int policy;
return (-1);
}
return (0);
}
/*
* audit_init():
* Initialize variables.
*/
void
{
door_dp->audit_event = 0;
}
int
{
int ret_val;
int i;
if (ret_val == -1)
return (ret_val);
if (ret_val == -1)
return (ret_val);
(void) audit_save_policy(door_dp);
return (0);
}
/*
* audit_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 audit_na to -1 if error, 1 if successful.
*/
static int
{
/*
* get non-attributable system event mask from kernel.
*/
return (-1);
}
return (0);
}
/*
* audit_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
{
int ad;
if (can_audit() == 0) {
return (0);
}
if (!audit_na_selected(door_dp)) {
return (0);
}
} else if (!audit_selected(door_dp)) {
return (0);
}
return (-1);
}
if (is_system_labeled())
int ng;
}
}
}
}
}
#ifdef _LP64
#else
#endif
return (-1);
}
return (0);
}
static int
{
return (-1);
}
}
static int
{
(void) audit_save_namask(door_dp);
return (audit_na_selected(door_dp));
}
}
static int
{
int prs_sorf;
if (sorf == 0) {
} else if (sorf == -1) {
} else {
}
}