Trusted Solaris Developer's Guide

Privilege ID to String

In this example, priv_id is initialized to the manifest constant name PRIV_FILE_DAC_WRITE and passed to priv_to_str(3TSOL) routine to convert it to the external name.

The header files and declarations for the code segments in this section are provided in the first program.

#include <tsol/priv.h>

main()
{
	priv_t priv_id = PRIV_FILE_DAC_WRITE;
	char *string;

	string = priv_to_str(priv_id);
	printf("Priv string = %s\n", string);
}

The printf statement prints the following:


Priv string = file_dac_write