dg_get_required_cap(2) DG/UX B2 Security R4.12MU02 dg_get_required_cap(2)
NAME
dggetrequiredcap - read an object's required capability set.
SYNOPSIS
#include <sys/capability.h>
#include <sys/dgtparms.h>
int dggetrequiredcap(targtype, targ, rcapp)
const int targtype;
const void *targ;
caprequiredt *rcapp;
where:
targtype A token that identifies the type of object whose required
capability set is to be read. The available tokens are
defined in sys/dgtparms.h as follows:
TFILE The object is a file identified by a pathname.
TFD The object is a file, socket or pipe identified
by a descriptor.
TMSG The object is a message queue identified by a
message queue identifier.
TSHM The object is a shared memory segment identified
by a shared memory segment identifier.
TSEM The object is a semaphore identified by a
semaphore set identifier.
targ The address of the identifier of the object whose required
capability set is to be read. The value of targtype
determines the type of entity that targ points to as
follows:
TFILE targ points to a pathname string.
TFD targ points to a file, socket or pipe
descriptor.
TMSG targ points to a message queue identifier.
TSHM targ points to a shared memory segment
identifier.
TSEM targ points to a semaphore set identifier.
rcapp Points to the structure into which the target's
caprequiredt is read.
DESCRIPTION
This system call copies the required capability set structure
(caprequiredt) from targ to the structure pointed to by rcapp.
When the object has no required set the call fails and rcapp is not
modified.
ACCESS CONTROL
The required set is read if the caller has search access to the
pathname given by targ, or when targ is not a pathname but is a valid
identifier of an object. On a system with DG/UX information
security, when MAC is configured the caller must also have MAC read
access to the target.
RETURN VALUE
0 Successful completion.
-1 An error occurred. errno is set to indicate the error.
EXCEPTIONS
errno may be set to one of the following error codes:
ENOSYS This system call was made on a system that does not have
the POSIXCAP configuration option enabled.
EACCES Search permission is denied for a non-terminal component
of targ.
EACCES On a system with DG/UX information security, MAC read
access is denied.
EFAULT The parameter rcapp points to a memory area not
accessible to the calling process.
ENOENT The object that targ resolved to does not exist or a
non-terminal component of the pathname does not exist.
EDGNOATTR The object given by targ does not have a required
capability set.
ENAMETOOLONG The value of targtype is TFILE and the pathname
exceeds the length limit for pathnames.
ELOOP The number of symbolic links encountered during pathname
resolution exceeded MAXSYMLINKS. A symbolic link cycle
is suspected.
ENOTDIR A non-terminal component of a given path name is not a
directory.
EOPNOTSUPP This operation is not supported for the specified
object.
SEE ALSO
dgsetrequiredcap(2), capdefaults(5)
Licensed material--property of copyright holder(s)