acl_delete_fd() — Delete an ACL by file descriptor

Standards

Standards / Extensions C or C++ Dependencies

z/OS UNIX

both z/OS V1R3

Format

#define _OPEN_SYS	1
#include <sys/acl.h>

int     acl_delete_fd (int fd, int type_d);	

General description

Use access control lists (ACLs) in conjunction with permission bits to control access to files and directories. Currently, ACLs are supported by the HFS, TFS, and zFS file systems. You must know whether your security product supports ACLs and what rules are used when determining file access. See z/OS UNIX System Services Planning for details.

The acl_delete_fd() function deletes the type_d ACL. That means that all extended ACL entries are deleted for type_d ACL. A file/dir subject must match the owner of the directory/file or the subject must have appropriate privileges.

The effective UID of the process must match the owner of the directory/file or the process must have appropriate privileges. If the type_d is the directory/file default and the object referred to by fd is not a directory, then the function will fail. An attempt to delete an ACL from a file that does not have that ACL is not considered an error.

Upon successful completion, the acl_delete_fd() will delete the type ACL associated with the file referred by argument fd. If unsuccessful, the type ACL associated with the file object referred by argument fd will not be changed.

Returned value

Upon successful completion, the function returns a value of zero.

If any of the following conditions occur, the acl_delete_fd() function returns -1 and sets errno to the corresponding value:

Error Code
Description
EBADF
The fd argument is not a valid file descriptor.
EINVAL
Argument type_d is not a valid ACL type.
ENOTDIR
The type specifies directory/file default ACL and the argument fd does not refer to a directory object.
EACCES
The process does not have appropriate privilege to delete the type ACL.

Related information