audit_rexecd.c revision f89940742f5d14dde79b69b98a414dd7b7f585c7
/*
* 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
*/
/*
*/
#include <stdio.h>
#include <unistd.h>
#include <bsm/audit_record.h>
#include <bsm/audit_uevents.h>
#include <bsm/audit_private.h>
#include <stdlib.h>
#include <string.h>
#include <syslog.h>
#include <pwd.h>
#include <locale.h>
#include "generic.h"
#ifdef C2_DEBUG
#else
#define dprintf(x)
#endif
static au_event_t event;
static int audit_rexecd_status = 0;
static int
char *user;
int sf;
{
int sorf;
/* get non-attrib flags */
} else {
}
if (sf == 0) {
} else if (sf == -1) {
} else {
sorf = AU_PRS_BOTH;
}
}
void
{
dprintf(("audit_rexecd_setup()\n"));
event = AUE_rexecd;
}
static void
{
int rc;
struct auditinfo_addr info;
mask.am_success = 0;
mask.am_failure = 0;
if (rc < 0) {
perror("get address");
}
if (rc < 0) {
perror("setaudit");
}
}
void
char *msg; /* message containing failure information */
char *hostname; /* hostname of machine requesting service */
char *user; /* username of user requesting service */
char *cmdbuf; /* command line to be executed locally */
{
int rd; /* audit record descriptor */
char *tbuf; /* temporary buffer */
int tlen;
const char *gtxt;
int rc;
dprintf(("audit_rexecd_fail()\n"));
/*
* check if audit_rexecd_fail() or audit_rexecd_success()
* have been called already.
*/
if (audit_rexecd_status == 1) {
return;
}
if (cannot_audit(0)) {
return;
}
/*
* set status to prevent multiple calls
* to audit_rexecd_fail() and audit_rexecd_success()
*/
audit_rexecd_status = 1;
} else {
}
/* determine if we're preselected */
return;
if (rc < 0) {
perror("get address");
}
/* add subject token */
if (is_system_labeled())
/* add reason for failure */
/* add hostname of machine requesting service */
"Remote execution requested by: %s"), hostname);
/* add username of user requesting service */
"Username: %s"), user);
/* add command line to be executed locally */
return;
}
/* add return token */
#ifdef _LP64
#else
#endif
/* write audit record */
return;
}
}
void
char *hostname; /* hostname of machine requesting service */
char *user; /* username of user requesting service */
char *cmdbuf; /* command line to be executed locally */
{
int rd; /* audit record descriptor */
char *tbuf; /* temporary buffer */
int tlen;
const char *gtxt;
int rc;
dprintf(("audit_rexecd_success()\n"));
/*
* check if audit_rexecd_fail() or audit_rexecd_success()
* have been called already.
*/
if (audit_rexecd_status == 1) {
return;
}
if (cannot_audit(0)) {
return;
}
/*
* set status to prevent multiple calls
* to audit_rexecd_fail() and audit_rexecd_success()
*/
audit_rexecd_status = 1;
} else {
}
/* determine if we're preselected */
goto rexecd_audit_session;
if (rc < 0) {
perror("get address");
}
/* add subject token */
if (is_system_labeled())
/* add hostname of machine requesting service */
"Remote execution requested by: %s"), hostname);
/* add username at machine requesting service */
"Username: %s"), user);
/* add command line to be executed locally */
} else {
/* add return token */
#ifdef _LP64
#else
#endif
/* write audit record */
}
}
}