Chapter Contents |
Previous |
Next |
fchaudit |
Portability: | SAS/C extension |
SYNOPSIS | |
DESCRIPTION | |
PORTABILITY | |
RETURN VALUE | |
EXAMPLE | |
RELATED FUNCTIONS |
SYNOPSIS |
#include <sys/stat.h> int fchaudit(int fileDescriptor, int auditFlags, int securityType);
DESCRIPTION |
fchaudit
changes the audit flags for the file specified by the
fileDescriptor
argument. The
audit flags control the type of file requests that the USS OS/390 security
product audits. The
fchaudit
function can change either user audit flags or security auditor audit flags,
depending on the setting of the
securityType
argument.
The
auditFlags
argument is formed by ORing any of the following flags, which are defined
in
<sys/stat.h>
:
AUDTREADFAIL
AUDTREADSUCC
AUDTWRITEFAIL
AUDTWRITESUCC
AUDTEXECFAIL
AUDTEXECSUCC
The flags for the
securityType
argument are also defined in
<sys/stat.h>
and can
be either of the following:
AUDT_USER
AUDT_AUDITOR
securityType
argument can only be specified by a user with security
auditor authority.
PORTABILITY |
The
fchaudit
function is useful in USS applications; however, it is not
defined by the POSIX.1 standard and should not be used in portable applications.
RETURN VALUE |
fchaudit
returns
0
if successful and
-1
if
unsuccessful.
EXAMPLE |
The following example illustrates the
use of
fchaudit
to change
a file's user audit flags.
Note:
You must specify the
posix
option when compiling this
example.
#include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <string.h> #include <stdio.h> main() { int fd; char words[] = "Test File"; /* Create a test file. */ if ((fd = creat("test.file", S_IRUSR|S_IWUSR)) == -1) { perror("creat error"); _exit(1); } else write(fd, words, strlen(words)); /* change the user audit flags. */ if (fchaudit(fd, AUDTREADFAIL|AUDTWRITEFAIL, AUDT_USER) != 0) perror("fchaudit error"); close(fd); }
RELATED FUNCTIONS |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.