Accesses system information in the system information database.
Security Library (libc.a)
#include <usersec.h>
#include <userconf.h>
int putconfattrs (Table, Attributes, Count)
char * Table;
dbattr_t * Attributes;
int Count
The putconfattrs subroutine writes one or more attributes into the system information database. If the database is not already open, the subroutine does an implicit open for reading and writing. Data changed by putconfattrs must be explicitly committed by calling the putconfattr subroutine with a Type parameter specifying the SEC_COMMIT value. Until the data is committed, only get subroutine calls within the process return the written data.
Use the setuserdb and enduserdb subroutines to open and close the system information database. Failure to explicitly open and close the system information database can result in loss of memory and performance.
Item | Description |
---|---|
Table | The system information table containing the desired attributes. The list of valid system information tables is defined in the userconf.h header file. |
Attributes | A pointer to an array of one or more elements of type dbattr_t. The list of system attributes is defined in the usersec.h header file. |
Count | The number of array elements in Attributes. |
Files accessed:
Item | Description |
---|---|
Mode | File |
rw | /etc/security/.ids |
rw | /etc/security/audit/config |
rw | /etc/security/audit/events |
rw | /etc/security/audit/objects |
rw | /etc/security/login.cfg |
rw | /etc/security/portlog |
rw | /etc/security/roles |
rw | /usr/lib/security/methods.cfg |
rw | /usr/lib/security/mkuser.sys |
The putconfattrs subroutine, when successfully completed, returns a value of 0. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The putconfattrs subroutine fails if one or more of the following are true:
Item | Description |
---|---|
EACCES | The system information database could not be accessed for writing. |
EINVAL | The Table parameter is the NULL pointer. |
EINVAL | The Attributes parameter does not point to valid data for the requested attribute. Limited testing is possible and all errors might not be detected. |
EINVAL | The Count parameter is less than or equal to 0. |
ENOENT | The specified Table does not exist. |
If the putconfattrs subroutine fails to write an attribute, one or more of the following errors is returned in the attr_flag field of the corresponding Attributes element:
Item | Description |
---|---|
EACCES | The user does not have access to the attribute specified in the attr_name field. |
EINVAL | The attr_type field in the Attributes entry contains an invalid type. |
EINVAL | The attr_un field in the Attributes entry does not point to a valid buffer or to valid data for this type of attribute. Limited testing is possible and all errors might not be detected. |
ENOATTR | The attr_name field in the Attributes entry specifies an attribute that is not defined for this system table. |