audit_rshd.c revision 45916cd2fec6e79bca5dee0421bd39e3c2910d1e
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.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 <locale.h>
#include <unistd.h>
#include <generic.h>
static void generate_record(char *, char *, char *, int, char *);
static void setup_session(char *);
int
{
return (0);
}
/* ARGSUSED */
int
char *msg; /* message containing failure information */
char *hostname; /* hostname of machine requesting service */
char *remuser; /* username at machine requesting service */
char *locuser; /* username of local machine */
char *cmdbuf; /* command line to be executed locally */
{
if (cannot_audit(0)) {
return (0);
}
return (0);
}
/* ARGSUSED */
int
char *hostname; /* hostname of machine requesting service */
char *remuser; /* username at machine requesting service */
char *locuser; /* username at local machine */
char *cmdbuf; /* command line to be executed locally */
{
if (cannot_audit(0)) {
return (0);
}
return (0);
}
#include <pwd.h>
static void
char *locuser, /* username of local machine */
char *cmdbuf, /* command line to be executed locally */
int sf_flag, /* success (0) or failure (-1) flag */
char *msg) /* message containing failure information */
{
int rd; /* audit record descriptor */
char *tbuf; /* temporary buffer */
int tlen;
const char *gtxt;
struct auditinfo_addr info;
if (cannot_audit(0)) {
return;
}
uid = -1;
gid = -1;
} else {
}
return;
/* see if terminal id already set */
perror("getaudit");
}
if (is_system_labeled())
return;
}
"remote user %s"), remuser);
}
if (sf_flag == -1) {
"local user %s"), locuser);
}
#ifdef _LP64
#else
#endif
}
}
static int
{
char naflags[512];
if (uid < 0) {
if (rc == 0)
} else {
}
if (sf == 0)
else if (sf == -1)
else
sorf = AU_PRS_BOTH;
return (rc);
}
static void
setup_session(char *locuser)
{
int rc;
struct auditinfo_addr info;
uid = -1;
else
/* see if terminal id already set */
perror("getaudit");
}
mask.am_success = 0;
mask.am_failure = 0;
if (rc < 0) {
perror("setaudit");
}
}