token.c revision 42096647a1cb1ee493b238f2713f001b8b039514
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <ctype.h>
#include <dirent.h>
#include <grp.h>
#include <libintl.h>
#include <limits.h>
#include <locale.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/inttypes.h>
#include <rpc/auth_unix.h>
#include <unistd.h>
#include <bsm/audit_record.h>
#include "praudit.h"
#include "toktable.h"
#include <netdb.h>
static char *anchor_path(char *);
static char *collapse_path(char *);
/*
* -----------------------------------------------------------------------
* is_file_token:
* Tests whether the specified token id represents a type
* of file token.
* return codes : 1 - tokenid is a file token type
* : 0 - otherwise
* -----------------------------------------------------------------------
*/
int
is_file_token(int tokenid)
{
return (1);
return (0);
}
/*
* -----------------------------------------------------------------------
* is_header_token:
* Tests whether the specified token id represents a type
* of header token (signifying the start of a record).
* return codes : 1 - tokenid is a header type
* : 0 - otherwise
* -----------------------------------------------------------------------
*/
int
is_header_token(int tokenid)
{
(tokenid == AUT_HEADER64_EX))
return (1);
return (0);
}
/*
* -----------------------------------------------------------------------
* is_token:
* Tests whether the specified token id represents a true
* token, as opposed to a regular tag.
* return codes : 1 - tokenid is a true token
* : 0 - otherwise
* -----------------------------------------------------------------------
*/
int
{
return (1);
return (0);
}
/*
* -----------------------------------------------------------------------
* exit_token() : Process information label token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the label token id has been retrieved
*
* Format of exit token:
* exit token id adr_char
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
int retval;
return (returnstat);
else
} else {
}
}
if (returnstat == 0)
}
/*
* ------------------------------------------------------------------
* file_token() : prints out seconds of time and other file name
* return codes : -1 - error
* : 0 - successful, valid file token fields
* At the time of entry, the file token ID has already been retrieved
*
* Format of file token:
* file token id adr_char
* seconds of time adr_u_int
* name of other file adr_string
* ------------------------------------------------------------------
*/
int
{
int returnstat;
/* other file name */
return (returnstat);
}
int
{
int returnstat;
/* other file name */
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* header_token() : Process record header token and display contents
* return codes : -1 - error
* : 0 - successful
* : 1 - warning, password entry not found
*
* NOTE: At the time of call, the header token id has been retrieved
*
* Format of header token:
* header token id adr_char
* record byte count adr_u_int
* event type adr_u_short (printed either ASCII or raw)
* event class adr_u_int (printed either ASCII or raw)
* event action adr_u_int
* seconds of time adr_u_int (printed either ASCII or raw)
* nanoseconds of time adr_u_int
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
/* version ID */
/* event type */
/* event modifier */
/* time from nsec */
return (returnstat);
}
int
{
int returnstat;
/* version ID */
/* event type */
/* event modifier */
/* time from nsec */
return (returnstat);
}
int
{
int returnstat;
/* version ID */
/* event type */
/* event modifier */
/* machine name */
/* time from nsec */
return (returnstat);
}
int
{
int returnstat;
/* version ID */
/* event type */
/* event modifier */
/* machine name */
/* time from nsec */
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* trailer_token() : Process record trailer token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the trailer token id has already been
* retrieved
*
* Format of trailer token:
* trailer token id adr_char
* record sequence no adr_u_short (should be AUT_TRAILER_MAGIC)
* record byte count adr_u_int
* -----------------------------------------------------------------------
*/
int
{
short magic_number;
"praudit: Cannot retrieve trailer magic number\n"));
return (-1);
} else {
if (magic_number != AUT_TRAILER_MAGIC) {
"praudit: Invalid trailer magic number\n"));
return (-1);
} else
/* Do not display trailer in XML mode */
int retstat;
return (retstat);
} else {
}
}
}
/*
* -----------------------------------------------------------------------
* arbitrary_data_token():
* Process arbitrary data token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the arbitrary data token id has already
* been retrieved
*
* Format of arbitrary data token:
* arbitrary data token id adr char
* how to print adr_char
* From audit_record.h, this may be either:
* AUP_BINARY binary
* AUP_OCTAL octal
* AUP_DECIMAL decimal
* AUP_HEX hexadecimal
* basic unit adr_char
* From audit_record.h, this may be either:
* AUR_BYTE byte
* AUR_CHAR char
* AUR_SHORT short
* AUR_INT32 int32_t
* AUR_INT64 int64_t
* unit count adr_char, specifying number of units of
* data in the "data items" parameter below
* data items depends on basic unit
*
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
int i;
char c1;
short c2;
char *p;
int index = 0;
char *pformat = "%*s";
return (returnstat);
return (returnstat);
return (returnstat);
} else {
}
return (returnstat);
return (returnstat);
return (returnstat);
} else {
}
return (returnstat);
return (returnstat);
return (returnstat);
return (returnstat);
return (returnstat);
return (returnstat);
/* Done with attributes; force end of token open */
return (returnstat);
/* get the field width in case we need to format output */
p = (char *)malloc(80);
/* now get the data items and print them */
for (i = 0; (i < unit_count); i++) {
switch (basic_unit) {
/* case AUR_BYTE: */
case AUR_CHAR:
(void) convert_char_to_string(how_to_print,
c1, p);
else {
free(p);
return (-1);
}
break;
case AUR_SHORT:
(void) convert_short_to_string(how_to_print,
c2, p);
else {
free(p);
return (-1);
}
break;
case AUR_INT32:
(void) convert_int32_to_string(how_to_print,
c3, p);
else {
free(p);
return (-1);
}
break;
case AUR_INT64:
(void) convert_int64_to_string(how_to_print,
c4, p);
else {
free(p);
return (-1);
}
break;
default:
free(p);
return (-1);
/*NOTREACHED*/
}
/*
* At this point, we have successfully retrieved a data
* item and converted it into an ASCII string pointed to
* by p. If all output is to be printed on one line,
* simply separate the data items by a space (or by the
* delimiter if this is the last data item), otherwise, we
* need to format the output before display.
*/
else
} else { /* format output */
if ((returnstat >= 0) &&
(i == (unit_count - 1)))) {
index = 0;
}
} /* else if PRF_ONELINE */
if (returnstat < 0) {
free(p);
return (returnstat);
}
}
free(p);
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* opaque_token() : Process opaque token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the opaque token id has already been
* retrieved
*
* Format of opaque token:
* opaque token id adr_char
* size adr_short
* data adr_char, size times
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
short size;
char *charp;
/* print the size of the token */
} else
returnstat = -1;
/* now print out the data field in hexadecimal */
if (returnstat >= 0) {
/* try to allocate memory for the character string */
returnstat = -1;
else {
size)) == 0) {
/* print out in hexadecimal format */
if (uval.string_val) {
&uval, 1);
}
}
}
}
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* path_token() : Process path token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the path token id has been retrieved
*
* Format of path token:
* token id adr_char
* path adr_string
* -----------------------------------------------------------------------
*/
int
{
char *path; /* path */
char *apath; /* anchored path */
char *cpath; /* collapsed path */
short length;
int returnstat;
/*
* We need to know how much space to allocate for our string, so
* read the length first, then call pr_adr_char to read those bytes.
*/
returnstat = -1;
if (*path != '/') {
} else
} else {
returnstat = -1;
}
return (returnstat);
} else
return (-1);
}
/*
* anchor a path name with a slash
*/
char *
anchor_path(char *sp)
{
char *dp; /* destination path */
char *tp; /* temporary path */
return ((char *)0);
*dp++ = '/';
return (tp);
}
/*
* copy path to collapsed path.
* collapsed path does not contain:
* successive slashes
* instances of dot-slash
* instances of dot-dot-slash
* passed path must be anchored with a '/'
*/
char *
collapse_path(char *s)
{
int id; /* index of where we are in destination string */
int is; /* index of where we are in source string */
int slashseen; /* have we seen a slash */
int ls; /* length of source string */
slashseen = 0;
/* thats all folks, we've reached the end of input */
if (s[is] == '\0') {
--id;
}
s[id++] = '\0';
break;
}
/* previous character was a / */
if (slashseen) {
if (s[is] == '/')
continue; /* another slash, ignore it */
} else if (s[is] == '/') {
/* we see a /, just copy it and try again */
slashseen = 1;
s[id++] = '/';
continue;
}
/* /./ seen */
is += 1;
continue;
}
/* XXX/. seen */
if (id > 1)
id--;
continue;
}
/* XXX/.. seen */
is += 1;
if (id > 0)
id--;
continue;
id++;
continue;
}
/* XXX/../ seen */
is += 2;
if (id > 0)
id--;
continue;
id++;
continue;
}
continue;
is--;
}
return (s);
}
/*
* -----------------------------------------------------------------------
* cmd_token() : Process cmd token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the cmd token id has been retrieved
*
* Format of command token:
* token id adr_char
* argc adr_short
* N*argv[i] adr_string (short, string)
* env cnt adr_short
* N*arge[i] adr_string (short, string)
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
short num;
if (returnstat < 0)
return (returnstat);
if (returnstat < 0)
return (returnstat);
}
returnstat, 0)) < 0)
return (returnstat);
}
return (returnstat);
if (returnstat < 0)
return (returnstat);
}
if (returnstat < 0)
return (returnstat);
}
returnstat, 0)) < 0)
return (returnstat);
}
if (num)
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* argument32_token() : Process argument token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the arg token id has been retrieved
*
* Format of argument token:
* current directory token id adr_char
* argument number adr_char
* argument value adr_int32
* argument description adr_string
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* argument64_token() : Process argument token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the arg token id has been retrieved
*
* Format of 64 bit argument token:
* current directory token id adr_char
* argument number adr_char
* argument value adr_int64
* argument description adr_string
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* process_token() : Process process token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the process token id has been retrieved
*
* Format of process token:
* process token id adr_char
* auid adr_u_int32
* euid adr_u_int32
* egid adr_u_int32
* ruid adr_u_int32
* egid adr_u_int32
* pid adr_u_int32
* sid adr_u_int32
* tid adr_u_int32, adr_u_int32
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
/* auid */
/* uid */
/* gid */
/* ruid */
/* rgid */
/* pid */
/* sid */
/* tid */
return (returnstat);
}
int
{
int returnstat;
/* auid */
/* uid */
/* gid */
/* ruid */
/* rgid */
/* pid */
/* sid */
/* tid */
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* process_ex_token() : Process process token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the process token id has been retrieved
*
* Format of extended process token:
* process token id adr_char
* auid adr_u_int32
* euid adr_u_int32
* egid adr_u_int32
* ruid adr_u_int32
* egid adr_u_int32
* pid adr_u_int32
* sid adr_u_int32
* tid adr_u_int32, adr_u_int32, 4*adr_u_int32
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
/* auid */
/* uid */
/* gid */
/* ruid */
/* rgid */
/* pid */
/* sid */
/* tid */
return (returnstat);
}
int
{
int returnstat;
/* auid */
/* uid */
/* gid */
/* ruid */
/* rgid */
/* pid */
/* sid */
/* tid */
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* return_value32_token(): Process return value and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the return value token id has been retrieved
*
* Format of return value token:
* return value token id adr_char
* error number adr_char
* return value adr_int32
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
bool_t used_ret_val = 0;
/*
* Every audit record generated contains a return token.
*
* The return token is a special token. It indicates the success
* or failure of the event that contains it.
* The return32 token contains two pieces of data:
*
* char number;
* int32_t return_value;
*
* For audit records generated by the kernel:
* The kernel always puts a positive value in "number".
* Upon success "number" is 0.
* Upon failure "number" is a positive errno value that is less than
* sys_nerr.
*
* For audit records generated at the user level:
* Upon success "number" is 0.
* Upon failure "number" is -1.
*
* For both kernel and user land the value of "return_value" is
* arbitrary. For the kernel it contains the return value of
* the system call. For user land it contains an arbitrary return
* value if it is less than ADT_FAIL_VALUE; ADT_FAIL_VALUE
* and above are messages defined in adt_event.h. ADT_FAIL_PAM and
* above are messages from pam_strerror(). No interpretation is done
* on "return_value" if it is outside the range of ADT_FAIL_VALUE_* or
* ADT_FAIL_PAM values.
*/
return (returnstat);
used_ret_val = 1;
return (returnstat);
return (returnstat);
return (returnstat);
if ((returnstat = pr_adr_int32(
return (returnstat);
} else {
if ((char)number == -1)
else
}
}
if (used_ret_val) {
if (returnstat == 0)
return (returnstat);
}
if (!returnstat)
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* return_value64_token(): Process return value and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the return value token id has been retrieved
*
* Format of return value token:
* return value token id adr_char
* error number adr_char
* return value adr_int64
*
* HOWEVER, the 64 bit return value is a concatenation of two
* 32 bit return values; the first of which is the same as is
* carried in the return32 token. The second 32 bits are ignored
* here so that the displayed return token will have the same
* number whether the application is 32 or 64 bits.
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
/*
* Every audit record generated contains a return token.
*
* The return token is a special token. It indicates the success
* or failure of the event that contains it.
* The return64 token contains two pieces of data:
*
* char number;
* int64_t return_value;
*
* For audit records generated by the kernel:
* The kernel always puts a positive value in "number".
* Upon success "number" is 0.
* Upon failure "number" is a positive errno value that is less than
* sys_nerr.
*
* For audit records generated at the user level:
* Upon success "number" is 0.
* Upon failure "number" is -1.
*
* For both kernel and user land the value of "return_value" is
* arbitrary. For the kernel it contains the return value of
* the system call. For user land it contains an arbitrary return
* value if it is less than ADT_FAIL_VALUE; ADT_FAIL_VALUE
* and above are messages defined in adt_event.h. ADT_FAIL_PAM and
* above are messages from pam_strerror(). No interpretation is done
* on "return_value" if it is outside the range of ADT_FAIL_VALUE_* or
* ADT_FAIL_PAM values.
*
* The 64 bit return value consists of two 32bit parts; for
* system calls, the first part is the value returned by the
* system call and the second part depends on the system call
* implementation. In most cases, the second part is either 0
* or garbage; because of that, it is omitted from the praudit
* output.
*/
return (returnstat);
return (returnstat);
return (returnstat);
return (returnstat);
return (returnstat);
} else {
if ((char)number == -1)
else
return (returnstat);
return (returnstat);
return (returnstat);
return (returnstat);
}
} else {
return (returnstat);
}
if (returnstat == 0)
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* subject32_token() : Process subject token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the subject token id has been retrieved
*
* Format of subject token:
* subject token id adr_char
* auid adr_u_int32
* euid adr_u_int32
* egid adr_u_int32
* ruid adr_u_int32
* egid adr_u_int32
* pid adr_u_int32
* sid adr_u_int32
* tid adr_u_int32, adr_u_int32
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
/* auid */
/* uid */
/* gid */
/* ruid */
/* rgid */
/* pid */
/* sid */
/* tid */
return (returnstat);
}
int
{
int returnstat;
/* auid */
/* uid */
/* gid */
/* ruid */
/* rgid */
/* pid */
/* sid */
/* tid */
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* subject_ex_token(): Process subject token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the subject token id has been retrieved
*
* Format of extended subject token:
* subject token id adr_char
* auid adr_u_int32
* euid adr_u_int32
* egid adr_u_int32
* ruid adr_u_int32
* egid adr_u_int32
* pid adr_u_int32
* sid adr_u_int32
* tid adr_u_int32, adr_u_int32
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
/* auid */
/* uid */
/* gid */
/* ruid */
/* rgid */
/* pid */
/* sid */
/* tid */
return (returnstat);
}
int
{
int returnstat;
/* auid */
/* uid */
/* gid */
/* ruid */
/* rgid */
/* pid */
/* sid */
/* tid */
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* s5_IPC_token() : Process System V IPC token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the System V IPC id has been retrieved
*
* Format of System V IPC token:
* System V IPC token id adr_char
* object id adr_int32
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
/*
* TRANSLATION_NOTE
* These names refer to the type of System V IPC object:
* message queue, semaphore, shared memory.
*/
return (returnstat);
/* print in ASCII form */
switch (ipctype) {
case AT_IPC_MSG:
break;
case AT_IPC_SEM:
break;
case AT_IPC_SHM:
break;
}
}
/* print in integer form */
}
return (returnstat);
/* next get and print ipc id */
} else {
/* cannot retrieve ipc type */
return (-1);
}
}
/*
* -----------------------------------------------------------------------
* text_token() : Process text token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the text token id has been retrieved
*
* Format of text token:
* text token id adr_char
* text adr_string
* -----------------------------------------------------------------------
*/
int
{
}
/*
* -----------------------------------------------------------------------
* tid_token() : Process a generic terminal id token / AUT_TID
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the token id has been retrieved
*
* Format of tid token:
* ip token id adr_char
* terminal type adr_char
* terminal type = AU_IPADR:
* remote port: adr_short
* local port: adr_short
* IP type: adt_int32 -- AU_IPv4 or AU_IPv6
* address: adr_int32 if IPv4, else 4 * adr_int32
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
return (returnstat);
return (returnstat);
switch (type) {
default:
return (-1); /* other than IP type is not implemented */
case AU_IPADR:
break;
}
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* ip_addr_token() : Process ip token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the ip token id has been retrieved
*
* Format of ip address token:
* ip token id adr_char
* address adr_int32 (printed in hex)
* -----------------------------------------------------------------------
*/
int
{
}
int
{
int returnstat;
char *ipstring;
char buf[256];
/* get address type */
return (returnstat);
/* legal address types are either AU_IPv4 or AU_IPv6 only */
return (-1);
/* get address (4/16) */
return (returnstat);
}
return (-1);
} else {
}
sizeof (buf));
}
}
/*
* -----------------------------------------------------------------------
* ip_token() : Process ip header token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the ip token id has been retrieved
*
* Format of ip header token:
* ip header token id adr_char
* version adr_char (printed in hex)
* type of service adr_char (printed in hex)
* length adr_short
* id adr_u_short
* offset adr_u_short
* ttl adr_char (printed in hex)
* protocol adr_char (printed in hex)
* checksum adr_u_short
* source address adr_int32 (printed in hex)
* destination address adr_int32 (printed in hex)
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* iport_token() : Process ip port address token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At time of call, the ip port address token id has been retrieved
*
* Format of ip port token:
* ip port address token id adr_char
* port address adr_short (in_port_t == uint16_t)
* -----------------------------------------------------------------------
*/
int
{
}
/*
* -----------------------------------------------------------------------
* socket_token() : Process socket token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At time of call, the socket token id has been retrieved
*
* Format of socket token:
* ip socket token id adr_char
* socket type adr_short (in hex)
* foreign port adr_short (in hex)
* foreign internet address adr_hostname/adr_int32 (in ascii/hex)
* -----------------------------------------------------------------------
*
* Note: local port and local internet address have been removed for 5.x
*/
int
{
int returnstat;
if (returnstat != 0)
return (returnstat);
return (returnstat);
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* socket_ex_token() : Process socket token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At time of call, the extended socket token id has been retrieved
*
* Format of extended socket token:
* token id adr_char
* socket domain adr_short (in hex)
* socket type adr_short (in hex)
* IP address type adr_short (in hex) [not displayed]
* local port adr_short (in hex)
* local internet address adr_hostname/adr_int32 (in ascii/hex)
* foreign port adr_short (in hex)
* foreign internet address adr_hostname/adr_int32 (in ascii/hex)
* -----------------------------------------------------------------------
*
* Note: local port and local internet address have been removed for 5.x
*/
int
{
int returnstat;
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* sequence_token() : Process sequence token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At time of call, the socket token id has been retrieved
*
* Format of sequence token:
* sequence token id adr_char
* sequence number adr_u_int32 (in hex)
* -----------------------------------------------------------------------
*/
int
{
}
/*
* -----------------------------------------------------------------------
* acl_token() : Process access control list term
* return codes : -1 - error
* : 0 - successful
*
* Format of acl token:
* token id adr_char
* term type adr_u_int32
* term value adr_u_int32 (depends on type)
* file mode adr_u_int (in octal)
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
}
/*
* -----------------------------------------------------------------------
* return codes : -1 - error
* : 0 - successful
*
* Format of ace token:
* token id adr_char
* term mask adr_u_int32
* term flags adr_u_int16
* term type adr_u_int16
* -----------------------------------------------------------------------
*/
int
{
}
/*
* -----------------------------------------------------------------------
* attribute_token() : Process attribute token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the attribute token id has been retrieved
*
* Format of attribute token:
* attribute token id adr_char
* mode adr_u_int (printed in octal)
* uid adr_u_int
* gid adr_u_int
* file system id adr_int
*
* node id adr_int (attribute_token
* pre SunOS 5.7)
* device adr_u_int
* or
* node id adr_int64 (attribute32_token)
* device adr_u_int
* or
* node id adr_int64 (attribute64_token)
* device adr_u_int64
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
return (returnstat);
}
int
{
int returnstat;
return (returnstat);
}
int
{
int returnstat;
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* group_token() : Process group token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the group token id has been retrieved
*
* Format of group token:
* group token id adr_char
* group list adr_long, 16 times
* -----------------------------------------------------------------------
*/
int
{
int returnstat = 0;
int i;
for (i = 0; i < NGROUPS_MAX - 1; i++) {
returnstat, 0)) < 0)
return (returnstat);
}
}
/*
* -----------------------------------------------------------------------
* newgroup_token() : Process group token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the group token id has been retrieved
*
* Format of new group token:
* group token id adr_char
* group number adr_short
* group list adr_int32, group number times
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
int i, num;
short n_groups;
if (returnstat != 0)
return (returnstat);
if (num == 0) {
}
return (returnstat);
}
for (i = 0; i < num - 1; i++) {
returnstat, 0)) < 0)
return (returnstat);
}
}
static int
{
int returnstat;
int num;
if (returnstat != 0)
return (returnstat);
if (returnstat != 0)
return (returnstat);
}
if (num == 0)
returnstat, 0))) < 0)
return (returnstat);
}
}
int
{
}
int
{
}
int
{
}
/*
* -----------------------------------------------------------------------
* s5_IPC_perm_token() : Process System V IPC permission token and display
* contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the System V IPC permission token id
* has been retrieved
*
* Format of System V IPC permission token:
* System V IPC permission token id adr_char
* uid adr_u_int32
* gid adr_u_int32
* cuid adr_u_int32
* cgid adr_u_int32
* mode adr_u_int32
* seq adr_u_int32
* key adr_int32
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* host_token() : Process host token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the host token id has been retrieved
*
* Format of host token:
* host token id adr_char
* hostid adr_u_int32
* -----------------------------------------------------------------------
*/
int
{
}
/*
* -----------------------------------------------------------------------
* liaison_token() : Process liaison token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the liaison token id has been retrieved
*
* Format of liaison token:
* liaison token id adr_char
* liaison adr_u_int32
* -----------------------------------------------------------------------
*/
int
{
}
/*
* -----------------------------------------------------------------------
* useofauth_token(): Process useofauth token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the uauth token id has been retrieved
*
* Format of useofauth token:
* uauth token id adr_char
* uauth adr_string
* -----------------------------------------------------------------------
*/
int
{
}
/*
* -----------------------------------------------------------------------
* zonename_token(): Process zonename token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the zonename token id has been retrieved
*
* Format of zonename token:
* zonename token id adr_char
* zone name adr_string
* -----------------------------------------------------------------------
*/
int
{
}
/*
* -----------------------------------------------------------------------
* fmri_token(): Process fmri token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the fmri token id has been retrieved
*
* Format of fmri token:
* fmri token id adr_char
* service instance name adr_string
* -----------------------------------------------------------------------
*/
int
{
}
/*
* -----------------------------------------------------------------------
* xatom_token() : Process Xatom token and display contents in hex.
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the xatom token id has been retrieved
*
* Format of xatom token:
* token id adr_char
* length adr_short
* atom adr_char length times
* -----------------------------------------------------------------------
*/
int
{
}
int
{
return (pa_xgeneric(context));
}
int
{
return (pa_xgeneric(context));
}
int
{
return (pa_xgeneric(context));
}
int
{
return (pa_xgeneric(context));
}
int
{
return (pa_xgeneric(context));
}
int
{
return (pa_xgeneric(context));
}
/*
* -----------------------------------------------------------------------
* xproperty_token(): Process Xproperty token and display contents
*
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the xproperty token id has been retrieved
*
* Format of xproperty token:
* token id adr_char
* XID adr_u_int32
* creator UID adr_u_int32
* text adr_text
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
/* Done with attributes; force end of token open */
if (returnstat == 0)
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* xselect_token(): Process Xselect token and display contents in hex
*
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the xselect token id has been retrieved
*
* Format of xselect token
* text token id adr_char
* property text adr_string
* property type adr_string
* property data adr_string
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* xclient_token(): Process Xclient token and display contents in hex.
*
* return codes : -1 - error
* : 0 - successful
*
* Format of xclient token:
* token id adr_char
* client adr_int32
* -----------------------------------------------------------------------
*/
int
{
}
/*
* -----------------------------------------------------------------------
* label_token() : Process label token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the label token id has been retrieved
*
* Format of label token:
* label token id adr_char
* label ID adr_char
* label compartment length adr_char
* label classification adr_short
* label compartment words <compartment length> * 4 adr_char
* -----------------------------------------------------------------------
*/
/*ARGSUSED*/
int
{
int len;
int returnstat;
return (-1);
}
}
return (-1);
}
/* print in ASCII form */
DEF_NAMES) == 0) {
} else /* cannot convert to string */
returnstat = 1;
}
/* print in hexadecimal form */
if (uval.string_val) {
}
}
}
return (returnstat);
}
/*
* -----------------------------------------------------------------------
* useofpriv_token() : Process priv token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the useofpriv token id has been retrieved
*
* Format of useofpriv token:
* useofpriv token id adr_char
* priv adr_int32 (Trusted Solaris)
* priv_set '\0' separated privileges.
* -----------------------------------------------------------------------
*/
/*ARGSUSED*/
int
{
int returnstat;
char sf;
return (returnstat);
}
/* print in ASCII form */
return (returnstat);
if (sf) {
} else {
}
if (returnstat == 0)
/* Done with attributes; force end of token open */
if (returnstat == 0)
} else {
/* print in hexadecimal form */
return (returnstat);
if (returnstat == 0)
/* Done with attributes; force end of token open */
if (returnstat == 0)
}
}
/*
* -----------------------------------------------------------------------
* privilege_token() : Process privilege token and display contents
* return codes : -1 - error
* : 0 - successful
* NOTE: At the time of call, the privilege token id has been retrieved
*
* Format of privilege token:
* privilege token id adr_char
* privilege type adr_string
* privilege adr_string
* -----------------------------------------------------------------------
*/
int
{
int returnstat;
/* privilege type: */
/* Done with attributes; force end of token open */
if (returnstat == 0)
/* privilege: */
}