acl_delete_file() — Delete an ACL by file name

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_file (const char *path_p, 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_file() function deletes the type_d ACL. That means that all extended ACL entries are deleted for type_d ACL. A file/directory always has base ACL entries so they cannot be deleted. 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_file() will delete the type ACL associated with the file referred by argument path_p. If unsuccessful, the type ACL associated with the file object referred by argument path_p 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_file() function returns -1 and sets errno to the corresponding value:

Error Code
Description
EACCES
Search permission is denied for a component of the path prefix or the object exists and the subject does not have appropriate access rights.
EINVAL
Argument type_d is not a valid ACL type.
ENAMETOOLONG
The length of the path name argument exceeds PATH_MAX, or a path name component is longer than NAME_MAX and {_POSIX_NO_TRUNC} is in effect for that file. For symbolic links, the length of the path name string substituted for a symbolic link exceeds PATH_MAX. PATH_MAX and NAME_MAX values can be determined by using pathconf().
ENOENT
The named object does not exist or the path_p argument points to an empty string.
ENOTDIR
The type specified was directory/file default but the argument path_p is not a directory or a component of the path prefix is not a directory.

Related information