1getpathbylabel(3TSOL)Trusted Extensions Library Functionsgetpathbylabel(3TSOL)
2
3
4

NAME

6       getpathbylabel - return the zone pathname
7

SYNOPSIS

9       cc [flags...] file... -ltsol [library...]
10
11
12       #include <tsol/label.h>
13
14       char *getpathbylabel(const char *path, char *resolved_path,
15            size_t bufsize, const m_label_t *sl);
16
17

DESCRIPTION

19       The  getpathbylabel()  function expands all symbolic links and resolves
20       references to '/./', '/../', extra '/' characters, and stores the  zone
21       pathname  in  the  buffer  named by resolved_path. The bufsize argument
22       specifies the size in bytes of this buffer.  The  resulting  path  will
23       have no symbolic links components, nor any '/./', '/../'. This function
24       can only be called from the global zone.
25
26
27       The zone pathname is relative to the sensitivity label sl. To specify a
28       sensitivity  label  for  a  zone name which does not exist, the process
29       must assert either the PRIV_FILE_UPGRADE_SL  or  PRIV_FILE_DOWNGRADE_SL
30       privilege  depending  on  whether the specified sensitivity label domi‐
31       nates or does not dominate the process sensitivity label.
32

RETURN VALUES

34       The getpathbylabel() function returns a pointer to the resolved_path on
35       success.  Otherwise  it  returns  NULL  and  sets errno to indicate the
36       error.
37

ERRORS

39       The getpathbylabel() function will fail if:
40
41       EACCES          Search permission is denied for a component of the path
42                       prefix of path.
43
44
45       EFAULT          resolved_path  extends  outside the process's allocated
46                       address space or beyond bufsize bytes.
47
48
49       EINVAL          path or resolved_path was NULL, current zone is not the
50                       global zone, or sl is invalid.
51
52
53       EIO             An  I/O error occurred while reading from or writing to
54                       the file system.
55
56
57       ELOOP           Too many symbolic links were encountered in translating
58                       path.
59
60
61       ENAMETOOLONG    The  length of the path argument exceeds PATH_MAX, or a
62                       pathname  component  is  longer  than   NAME_MAX   (see
63                       sysconf(3C))  while  _POSIX_NO_TRUNC  is in effect (see
64                       pathconf(2)).
65
66
67       ENOENT          The named file does not exist.
68
69

ATTRIBUTES

71       See attributes(5) for descriptions of the following attributes:
72
73
74
75
76       ┌─────────────────────────────┬─────────────────────────────┐
77       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
78       ├─────────────────────────────┼─────────────────────────────┤
79       │Interface Stability          │Committed                    │
80       ├─────────────────────────────┼─────────────────────────────┤
81       │MT-Level                     │MT-Safe                      │
82       └─────────────────────────────┴─────────────────────────────┘
83

SEE ALSO

85       readlink(2),  getzonerootbyid(3TSOL),   libtsol(3LIB),   attributes(5),
86       labels(5)
87

WARNINGS

89       The getpathbylabel() function indirectly invokes the readlink(2) system
90       call, and hence inherits the possibility of hanging due to inaccessible
91       file system resources.
92

NOTES

94       The  functionality  described  on this manual page is available only if
95       the system is configured with Trusted Extensions.
96
97
98
99SunOS 5.11                        20 Jul 2007            getpathbylabel(3TSOL)
Impressum