Initializes or terminates database.
Trusted AIX® Library ( libmls.a )
The initlabeldb subroutine initializes the label database that the dbfile parameter specifies. When the dbfile parameter is specified to NULL, the initlabeldb subroutine initializes the library data members using the /etc/security/enc/LabelEncodings file. The initlabeldb subroutine succeeds only if the formation of the label file is correct.
Before any operations on a label, must use the initlabeldb subroutine to initialize the database. The database that is initialized will be read only.
The endlabeldb subroutine terminates the database by freeing all of the memory that is allocated. There is no write back in this operation.
Item | Description |
---|---|
dbfile | Specifies the file name that is to be used for label database initialization. |
Access Control: To access the default encodings file /etc/security/enc/LabelEncodings, the process must have the PV_LAB_LEF privilege.
Mode | File |
---|---|
r | /etc/security/enc/LabelEncodings |
If successful, the initlabeldb and endlabeldb subroutines return a value of zero. Otherwise, they return a value of -1.
If the initlabeldb subroutine fails, one of the following errno values can be set:
Item | Description |
---|---|
EBADF | The parameter that is passed is not NULL and is not a regular file. |
EALREADY | The database specified is already initialized with a different encoding file. |
EACCESS | The operation is not permitted. |
ENOENT | The label encoding file is not found. |
Item | Description |
---|---|
ENOTREADY | The database is not initialized. |