1priv_addset(3C)          Standard C Library Functions          priv_addset(3C)
2
3
4

NAME

6       priv_addset,  priv_allocset,  priv_copyset, priv_delset, priv_emptyset,
7       priv_fillset, priv_freeset, priv_intersect, priv_inverse, priv_isempty‐
8       set,  priv_isequalset,  priv_isfullset,  priv_ismember,  priv_issubset,
9       priv_union - privilege set manipulation functions
10

SYNOPSIS

12       #include <priv.h>
13
14       int priv_addset(priv_set_t *sp, const char *priv);
15
16
17       priv_set_t *priv_allocset(void);
18
19
20       void priv_copyset(const priv_set_t *src, priv_set_t *dst);
21
22
23       int priv_delset(priv_set_t *sp, const char *priv);
24
25
26       void priv_emptyset(priv_set_t *sp);
27
28
29       void priv_fillset(priv_set_t *sp);
30
31
32       void priv_freeset(priv_set_t *sp);
33
34
35       void priv_intersect(const priv_set_t *src, priv_set_t *dst);
36
37
38       void priv_inverse(priv_set_t *sp);
39
40
41       boolean_t priv_isemptyset(const priv_set_t *sp);
42
43
44       boolean_t priv_isequalset(const priv_set_t *src, const priv_set_t *dst);
45
46
47       boolean_t priv_isfullset(const priv_set_t *sp);
48
49
50       boolean_t priv_ismember(const priv_set_t *sp, const char *priv);
51
52
53       boolean_t priv_issubset(const priv_set_t *src, const priv_set_t *dst);
54
55
56       void priv_union(const priv_set_t *src, priv_set_t *dst);
57
58

DESCRIPTION

60       The sp, src, and dst arguments point to privilege sets. The priv  argu‐
61       ment points to a named privilege.
62
63
64       The priv_addset() function adds the named privilege priv to sp.
65
66
67       The  priv_allocset()  function allocates sufficient memory to contain a
68       privilege set. The value of the returned privilege  set  is  indetermi‐
69       nate.  The  function returns NULL and sets errno when it fails to allo‐
70       cate memory.
71
72
73       The priv_copyset() function copies the set src to dst.
74
75
76       The priv_delset() function removes the named privilege priv from sp.
77
78
79       The priv_emptyset() function clears all privileges from sp.
80
81
82       The priv_fillset() function asserts all privileges in sp, including the
83       privileges not currently defined in the system.
84
85
86       The  priv_freeset() function frees the storage allocated by priv_alloc‐
87       set().
88
89
90       The priv_intersect() function intersects src with dst  and  places  the
91       results in dst.
92
93
94       The priv_inverse() function inverts the privilege set given as argument
95       in place.
96
97
98       The priv_isemptyset() function checks whether the argument is an  empty
99       set.
100
101
102       The  priv_isequalset() function checks whether the privilege set src is
103       equal to dst.
104
105
106       The priv_isfullset() function checks whether the  argument  is  a  full
107       set.  A  full set is a set with all bits set, regardless of whether the
108       privilege is currently defined in the system.
109
110
111       The priv_ismember() function checks whether the named privilege priv is
112       a member of sp.
113
114
115       The priv_issubset() function checks whether src is a subset of dst.
116
117
118       The priv_union() function takes the union of src and dst and places the
119       result in dst.
120

RETURN VALUES

122       Upon successful completion, priv_allocset() returns  a  pointer  to  an
123       opaque  data  structure. It returns NULL if memory allocation fails and
124       sets errno to indicate the error.
125
126
127       Upon  successful   completion,   priv_isemptyset(),   priv_isfullset(),
128       priv_isequalset(),  priv_issubset(), and priv_ismember() return B_TRUE.
129       Otherwise, they return B_FALSE.
130
131
132       Upon successful completion, priv_delset() and priv_addset()  return  0.
133       Otherwise, they return -1 and set errno to indicate the error.
134

ERRORS

136       The priv_allocset() function will fail if:
137
138       ENOMEM    The  physical limits of the system are exceeded by the memory
139                 allocation needed to hold a privilege set.
140
141
142       EAGAIN    There is insufficient memory for allocation to hold a  privi‐
143                 lege set. The application can try again later.
144
145
146
147       The priv_delset() and priv_addset() functions will fail if:
148
149       EINVAL    The privilege argument is not a valid privilege name.
150
151

ATTRIBUTES

153       See attributes(5) for descriptions of the following attributes:
154
155
156
157
158       ┌─────────────────────────────┬─────────────────────────────┐
159       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
160       ├─────────────────────────────┼─────────────────────────────┤
161       │Interface Stability          │Evolving                     │
162       ├─────────────────────────────┼─────────────────────────────┤
163       │MT-Level                     │MT-Safe                      │
164       └─────────────────────────────┴─────────────────────────────┘
165

SEE ALSO

167       setppriv(2),  malloc(3C),  priv_str_to_set(3C),  attributes(5),  privi‐
168       leges(5)
169

NOTES

171       The functions that compare sets operate on all bits of the set, regard‐
172       less  of  whether  the specific privileges are currently defined in the
173       system.
174
175
176
177SunOS 5.11                        28 Jan 2005                  priv_addset(3C)
Impressum