Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ././../../../../../../usr/man/man2/getlabel.2
Real path: /usr/share/man/man2/getlabel.2
Zurück
'\" te .\" Copyright (c) 2006, 2023, Oracle and/or its affiliates. .TH getlabel 2 "30 Jan 2023" "Oracle Solaris 11.4" "System Calls" .SH NAME getlabel, fgetlabel \- get file sensitivity label .SH SYNOPSIS .LP .nf \fBcc\fR [\fIflags\fR...] \fIfile\fR... \fB-ltsol\fR [\fIlibrary\fR...] .fi .LP .nf #include <tsol/label.h> \fBint\fR \fBgetlabel\fR(\fBconst char *\fR\fIpath\fR, \fBm_label_t *\fR\fIlabel_p\fR); .fi .LP .nf \fBint\fR \fBfgetlabel\fR(\fBint\fR \fIfd\fR, \fBm_label_t *\fR\fIlabel_p\fR); .fi .SH DESCRIPTION .sp .LP The \fBgetlabel()\fR function obtains the sensitivity label of the file that is named by \fIpath\fR. Discretionary read, write, or execute permission to the final component of \fIpath\fR is not required, but all directories in the path prefix of \fIpath\fR must be searchable. .sp .LP The \fBfgetlabel()\fR function obtains the label of an open file that is referred to by the argument descriptor, such as would be obtained by an \fBopen\fR(2) call. .sp .LP The \fIlabel_p\fR argument is a pointer to an opaque label structure. The caller must allocate space for \fIlabel_p\fR by using \fBm_label_alloc\fR(3TSOL). .SH RETURN VALUES .sp .LP Upon successful completion, \fBgetlabel()\fR and \fBfgetlabel()\fR return 0. Otherwise they return \(mi1 and set \fBerrno\fR to indicate the error. .SH ERRORS .sp .LP The \fBgetlabel()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEACCES\fR\fR .ad .RS 16n .rt Search permission is denied for a component of the path prefix of \fIpath\fR. To override this restriction, the calling process can assert the \fBPRIV_FILE_DAC_SEARCH\fR privilege. .RE .sp .ne 2 .mk .na \fB\fBEFAULT\fR\fR .ad .RS 16n .rt \fIlabel_p\fR or \fIpath\fR points to an invalid address. .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 16n .rt Unable to get the label; this may occur if \fIpath\fR or \fIfd\fR is not a regular file or directory, or if there is an unexpected error with the file. .RE .sp .ne 2 .mk .na \fB\fBELOOP\fR\fR .ad .RS 16n .rt Too many symbolic links were encountered in translating \fIpath\fR. .RE .sp .ne 2 .mk .na \fB\fBENAMETOOLONG\fR\fR .ad .RS 16n .rt The length of the path argument exceeds \fIPATH_MAX\fR, or a pathname component is longer than \fINAME_MAX\fR while \fB_POSIX_NO_TRUNC\fR is in effect (see \fBpathconf\fR(2)). .RE .sp .ne 2 .mk .na \fB\fBENOENT\fR\fR .ad .RS 16n .rt The file referred to by \fIpath\fR does not exist. .RE .sp .ne 2 .mk .na \fB\fBENOTDIR\fR\fR .ad .RS 16n .rt A component of the path prefix of \fIpath\fR is not a directory. .RE .sp .LP The \fBfgetlabel()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEBADF\fR\fR .ad .RS 10n .rt The \fIfd\fR argument is not a valid open file descriptor. .RE .sp .ne 2 .mk .na \fB\fBEFAULT\fR\fR .ad .RS 10n .rt The \fIlabel_p\fR argument points to an invalid address. .RE .sp .ne 2 .mk .na \fB\fBEIO\fR\fR .ad .RS 10n .rt An \fBI/O\fR error occurred while reading from or writing to the file system. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Committed _ MT-Level MT-Safe _ Standard None .TE .sp .SH SEE ALSO .sp .LP \fBopen\fR(2), \fBpathconf\fR(2), \fBm_label_alloc\fR(3TSOL), \fBattributes\fR(7), \fBlabels\fR(7) .SH HISTORY .sp .LP The \fBgetlabel()\fR and \fBfgetlabel()\fR functions were added to Solaris in Solaris 10 4/08 (Update 5). Prior to that they were included in the Trusted Extensions add-on for Solaris.