Opens and closes the role database.
#include <usersec.h>
int setroledb(Mode) int Mode;
int endroledb
These functions may be used to open and close access to the role database. Programs that call the getroleattr subroutine should call the setroledb subroutine to open the role database and the endroledb subroutine to close the role database.
The setroledb subroutine opens the role database in the specified mode, if it is not already open. The open count is increased by 1.
The endroledb subroutine decreases the open count by 1 and closes the role database when this count goes to 0. Any uncommitted changed data is lost.
Mode | Specifies the mode of the open. This parameter may contain one or more of the following values defined in the usersec.h file: |
The setroledb and endroledb subroutines return a value of 0 to indicate success. Otherwise, a value of -1 is returned and the errno global variable is set to indicate the error.
The setroledb
subroutine fails if the following is true:
EACCES | Access permission is denied for the data request. |
Both subroutines return errors from other subroutines.
Files Accessed: The calling process must have access to the role data.
Mode File rw/etc/security/roles
The getroleattr, nextrole, or putroleattr subroutine.