/*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#define XSERV_t
#define TRANS_SERVER
#include "misc.h"
#include "osdep.h"
#include "dixstruct.h"
#ifdef HAVE_LIBBSM /* Solaris auditing implementation */
#include <ucred.h>
#include <bsm/adt_event.h>
#ifdef ADT_xconnect
# define OS_AUDIT_IMPLEMENTED
typedef struct {
static void
{
int saveid;
if (saveid != 0) {
/* reset privs back to root */
if (seteuid(0) < 0) {
saveid = 0;
}
}
goto end;
}
goto end;
}
ErrorF("OSAuditClientInit: adt_set_from_ucred: %s\n",
}
ucred_free(uc);
} else {
}
}
end:
if (saveid != 0) {
/* set privs back to user */
}
}
}
static void
{
int saveid;
return;
}
return;
}
/* fill in event */
switch (event_id) {
case ADT_xconnect:
} else {
peer = -1;
}
break;
case ADT_xdisconnect:
break;
default:
}
if (saveid != 0) {
/* reset privs back to root */
if (seteuid(0) < 0) {
saveid = 0;
}
}
}
if (saveid != 0) {
/* set privs back to user */
}
}
}
/* Called when new client connects or existing client disconnects */
static void
{
switch (pClient->clientState) {
case ClientStateInitial: /* client attempting to connect */
break;
case ClientStateRunning: /* connection accepted */
break;
case ClientStateGone: /* connection terminating */
else /* successful connection that ran for a while */
break;
default:
return; /* skip over setting prevState to an unknown state */
}
}
#endif /* ADT_xconnect */
#endif /* HAVE_LIBBSM -- Solaris auditing implementation */
/* Generic code to initialize all OS auditing implementations */
void
OSAuditInit(void)
{
#ifdef OS_AUDIT_IMPLEMENTED
/* Reserve room in the client privates for the audit data */
sizeof(OSAuditClientPrivateRec)))
FatalError("could not allocate OSAuditPrivKey\n");
/* Register callback to be called on every client connect & disconnect */
FatalError("could not register OSAuditClientStateChange callback\n");
#else
/* nothing implemented for this OS */
return;
#endif
}