Accesses the privileged file security information in the privileged file database.
Security Library (libc.a)
The getpfileattr subroutine reads a specified attribute from the privileged file database. If the database is not open, this subroutine does an implicit open for reading.
Item | Description |
---|---|
File | Specifies the file name. The value must be the full path to the file on the system. This parameter must be specified unless the value of the Type parameter is SEC_COMMIT. |
Attribute | Specifies which attribute is read. The following
possible attributes are defined in the usersec.h file:
|
Value | Specifies a buffer, a pointer to a buffer, or a pointer to a pointer depending on the Attribute and Type parameters. See the Type parameter for more details. |
Type | Specifies the type of attribute expected. The usersec.h file
defines and includes the following valid types:
|
File | Mode |
---|---|
/etc/security/privfiles | rw |
If successful, the getpfileattr subroutine returns a value of zero. Otherwise, a value of -1 is returned and the errno global value is set to indicate the error.
If the getpfileattr subroutine fails, one of the following errno values can be set:
Item | Description |
---|---|
EINVAL | The File parameter is NULL or default. |
EINVAL | The Attribute or Type parameter is NULL or does not contain one of the defined values. |
EINVAL | The Attribute parameter is S_PRIVFILES, but the File parameter is not ALL. |
EINVAL | The Value parameter does not point to a valid buffer for this type of attribute. |
ENOENT | The file specified in the File parameter does not exist. |
ENOATTR | The attribute specified in the Attribute parameter is valid, but no value is defined for the file. |
EPERM | Operation is not permitted. |