Trusted Solaris Developer's Guide

System Calls

These system calls get and set a file or process CMW label, or get the file system label range.


Caution - Caution -

Every process that sets a label on another process or file system object must set a valid label as defined in the label_encodings file, and must pass the correct binary form of the label. The text to binary translation functions correct the label as much as possible to ensure a correct binary label results from the translation. However, you might still use the bslvalid(3TSOL) routine to check that the label is valid. A correctly constructed binary label can be invalid for a given system or user and should be checked that it falls within the system or user accreditation range with the blinset(3TSOL) routine.


File CMW Label

These system calls get and set the file CMW label by the path name or file descriptor. Refer to the setcmwlabel(2) and getcmwlabel(2) man pages.

int setcmwlabel(const char *path,
	const bclabel_t *label, const setting_flag_t flag);
int getcmwlabel(const char *path, const bclabel_t *label);

int fsetcmwlabel(const int fd, const bclabel_t *label,
	const setting_flag_t flag);
int fgetcmwlabel(const int fd, bclabel_t *label);

int lsetcmwlabel(const int fd,
	const bclabel_t *label, const setting_flag_t flag);
int lgetcmwlabel(const int fd, bclabel_t *label);

Process CMW Label

These system calls get and set the process CMW label. Refer to the setcmwplabel(2) and getcmwplabel(2) man pages.

int setcmwplabel(const bclabel_t *label, const setting_flag_t flag);
int getcmwplabel(const bclabel_t *label);

File System Label Range

These system calls get the file system label range. Refer to the getcmwfsrange(2) man page.

int getcmwfsrange(char *path, brange_t *range);
int fgetcmwfsrange(int fd, brange_t *range);