| Skip Navigation Links | |
| Exit Print View | |
![]() | man pages section 2: System Calls Oracle Solaris 11 Information Library |
- get file sensitivity label
cc [flags...]file...-ltsol [library...]
#include <tsol/label.h>intgetlabel(const char *path,m_label_t *label_p);
intfgetlabel(intfd,m_label_t *label_p);
Thegetlabel() function obtains the sensitivity label of the file that isnamed bypath. Discretionary read, write or execute permission to the finalcomponent ofpath is not required, but all directories in the pathprefix ofpath must be searchable.
Thefgetlabel() function obtains the label of an open file that isreferred to by the argument descriptor, such as would be obtained byanopen(2) call.
Thelabel_p argument is a pointer to an opaque label structure. Thecaller must allocate space forlabel_p by usingm_label_alloc(3TSOL).
Upon successful completion,getlabel() andfgetlabel() return 0. Otherwise they return -1and seterrno to indicate the error.
Thegetlabel() function will fail if:
Search permission is denied for a component of the path prefix ofpath. To override this restriction, the calling process can assert thePRIV_FILE_DAC_SEARCH privilege.
label_p orpath points to an invalid address.
An I/O error occurred while reading from or writing to the file system.
Too many symbolic links were encountered in translatingpath.
The length of the path argument exceedsPATH_MAX, or a pathname component is longer thanNAME_MAX while_POSIX_NO_TRUNC is in effect (seepathconf(2)).
The file referred to bypath does not exist.
A component of the path prefix ofpath is not a directory.
Thefgetlabel() function will fail if:
Thefd argument is not a valid open file descriptor.
Thelabel_p argument points to an invalid address.
An I/O error occurred while reading from or writing to the file system.
Seeattributes(5) for descriptions of the following attributes:
|
open(2),pathconf(2),m_label_alloc(3TSOL),attributes(5),labels(5)
Obtaining a File Label inOracle Solaris Trusted Extensions Developer’s Guide
The functionality described on this manual page is available only if thesystem is configured with Trusted Extensions.
Copyright © 2011, Oracle and/or its affiliates. All rights reserved.Legal Notices | ![]() ![]() |