2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH GETPATHBYLABEL 3TSOL "Jul 20, 2007"
8 getpathbylabel \- return the zone pathname
12 \fBcc\fR [\fIflags\fR...] \fIfile\fR... \fB-ltsol\fR [\fIlibrary\fR...]
17 #include <tsol/label.h>
19 \fBchar *\fR\fBgetpathbylabel\fR(\fBconst char *\fR\fIpath\fR, \fBchar *\fR\fIresolved_path\fR,
20 \fBsize_t\fR \fIbufsize\fR, \fBconst m_label_t *\fR\fIsl\fR);
26 The \fBgetpathbylabel()\fR function expands all symbolic links and resolves
27 references to '/./', '/../', extra '/' characters, and stores the zone pathname
28 in the buffer named by \fIresolved_path\fR. The \fIbufsize\fR argument
29 specifies the size in bytes of this buffer. The resulting path will have no
30 symbolic links components, nor any '/./', '/.\|./'. This function can only be
31 called from the global zone.
34 The zone pathname is relative to the sensitivity label \fIsl\fR. To specify a
35 sensitivity label for a zone name which does not exist, the process must assert
36 either the \fBPRIV_FILE_UPGRADE_SL\fR or \fBPRIV_FILE_DOWNGRADE_SL\fR privilege
37 depending on whether the specified sensitivity label dominates or does not
38 dominate the process sensitivity label.
42 The \fBgetpathbylabel()\fR function returns a pointer to the
43 \fIresolved_path\fR on success. Otherwise it returns \fINULL\fR and sets
44 \fIerrno\fR to indicate the error.
48 The \fBgetpathbylabel()\fR function will fail if:
55 Search permission is denied for a component of the path prefix of \fIpath\fR.
64 \fIresolved_path\fR extends outside the process's allocated address space or
65 beyond \fIbufsize\fR bytes.
74 \fIpath\fR or \fIresolved_path\fR was \fINULL\fR, current zone is not the
75 global zone, or \fIsl\fR is invalid.
84 An \fBI/O\fR error occurred while reading from or writing to the file system.
93 Too many symbolic links were encountered in translating \fIpath\fR.
99 \fB\fBENAMETOOLONG\fR\fR
102 The length of the path argument exceeds \fIPATH_MAX\fR, or a pathname component
103 is longer than \fINAME_MAX\fR (see \fBsysconf\fR(3C)) while
104 \fB_POSIX_NO_TRUNC\fR is in effect (see \fBpathconf\fR(2)).
113 The named file does not exist.
119 See \fBattributes\fR(5) for descriptions of the following attributes:
127 ATTRIBUTE TYPE ATTRIBUTE VALUE
129 Interface Stability Committed
137 \fBreadlink\fR(2), \fBgetzonerootbyid\fR(3TSOL), \fBlibtsol\fR(3LIB),
138 \fBattributes\fR(5), \fBlabels\fR(5)
142 The \fBgetpathbylabel()\fR function indirectly invokes the \fBreadlink\fR(2)
143 system call, and hence inherits the possibility of hanging due to inaccessible
144 file system resources.
148 The functionality described on this manual page is available only if the system
149 is configured with Trusted Extensions.