dg_setoacl(2) C2 Trusted DG/UX 5.4.2T dg_setoacl(2)
NAME
dgsetoacl - set the access control list (ACL) on an object
SYNOPSIS
#include <sys/types.h>
#include <sys/dgtparms.h>
#include <sys/acl.h>
int dgsetoacl(targtype, targ, type, acl, aclsize,
textacl, textaclsize)
int targtype;
void *targ;
int type;
aclstructt *acl;
int aclsize;
char *textacl;
int textaclsize;
where:
targtype A token that identifies the type of object whose ACL is
to be set. The available tokens are defined in
sys/dgtparms.h as follows:
TFILE The object is a file identified by a path name.
TFD The object is a file identified by a file
descriptor.
targ The address of the identifier of the object whose ACL is
to be set. The value of targtype determines the type
of entity that targ points to as follows:
TFILE targ points to a path name string.
TFD targ points to a file descriptor.
type type indicates whether this is an access ACL or a
default ACL; it must be set to either ACL_TYPE_DEFAULT
or ACL_TYPE_ACCESS. Note that since default ACLs may
only be set on directories, when type is
ACL_TYPE_DEFAULT targ must reference a directory.
acl The address of an aclstructt containing the binary ACL
to be set on the file.
aclsize The size, in bytes, of the aclstructt pointed to by
acl. An aclstructt is actually a variable size
structure with a fixed ``header'' (see sys/acl.h). Note
that the macro SIZEOF_ACL_STRUCT(N) can be used to
compute the size of an ACL with N entries.
textacl The ASCII text ACL that is stored with the object. If
no text ACL exists, the textaclsize parameter must be
set to zero.
Licensed material--property of copyright holder(s) 1
dg_setoacl(2) C2 Trusted DG/UX 5.4.2T dg_setoacl(2)
Note that there is no assurance that the binary ACL
stored with the object would match the binary ACL
generated by converting the ASCII text ACL to binary.
Only the binary ACL is used by the reference monitor for
access control decisions.
textaclsize The size in bytes of the text ACL. If this parameter is
zero, dgsetoacl assumes that there is no text ACL to be
set.
DESCRIPTION
The dgsetoacl system call sets the ACL on the object identified by
targtype and targ to the ACL passed via the acl parameter. The ACL
passed must be a properly formed and valid ACL. To delete a default
ACL, write a default ACL with an aclsize of 0.
ACCESS CONTROL
To set an ACL on an object, a process's effective user id must be
that of the object's owner or the process must have appropriate
privilege.
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:
EINVAL The ACL pointed to by acl is not a properly formed ACL,
or the aclsize parameter value is inconsistent with the
internal values in the ACL.
EINVAL The ACL type type is not one of ACL_TYPE_DEFAULT or
ACL_TYPE_ACCESS.
EINVAL The target type targtype parameter is not valid.
EINVAL The aclsize is zero but type is not ACL_TYPE_DEFAULT.
EOPNOTSUPP The target type targtype does not support default and/or
access ACL.
ENOTDIR The process attempted to set a default ACL on some object
other than a directory.
EPERM The caller did not have sufficient privilege or is not
the owner of the object.
EFAULT One of the parameters specified an area of memory not
accessible to the calling process.
ENOMEM The operating system was unable to allocate internal
memory to process the system call.
Licensed material--property of copyright holder(s) 2
dg_setoacl(2) C2 Trusted DG/UX 5.4.2T dg_setoacl(2)
SEE ALSO
dggetoacl(2)
Trusted Facility Manual for the C2 Trusted DG/UX System
Licensed material--property of copyright holder(s) 3