summaryrefslogtreecommitdiff
path: root/static/v10/man3/labeq.3
blob: e858faca632a2882ed76dc9444a4fa2a395e56f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.TH LABEQ 3
.SH NAME
labeq, lable, labmax, labmin \- compare security labels
.SH SYNOPSIS
.B #include <sys/label.h>
.PP
.B labEQ(x, y)
.br
.B struct label *x, *y;
.PP
.B labLE(x, y)
.br
.B struct label *x, *y;
.PP
.B struct label labMAX(x, y)
.br
.B struct label *x, *y;
.PP
.B struct label labMIN(x, y)
.br
.B struct label *x, *y;
.SH DESCRIPTION
.I LabEQ
returns 1 if 
.I x
and
.I y
point to equal labels, otherwise 0.
The result is 1 if and only if neither argument is 0, the
flag fields are the same, and, when the flag fields are
.BR L_BITS ,
the lattice values are the same.
.PP
.I LabLE
returns 1 if the security label pointed to by 
.I x
compares less than or equal to the security label pointed to by
.I y.
An improper argument is treated as if it had flag
.BR L_NO .
If one of the labels has flag
.BR L_YES ,
the result is 1; otherwise if one of the labels has flag
.BR L_NO ,
the result is 0;
otherwise the the result is 1
if and only if the lattice value of
.I x
is bitwise less than or
equal to the lattice value of 
.I y.
(Inequalities involving
.BR L_YES
and
.BR L_NO
are not transitive.)
.PP
.I LabMAX
and
.I labMIN
respectively return the maximum (bitwise OR) and
minimum (bitwise AND) of lattice values of labels
pointed to by
.I x
and
.I y.
An improper argument is treated as if it had flag
.BR L_NO .
If one of the labels has flag
.BR L_YES ,
the result is the other label; otherwise
if one of the labels has flag
.BR L_NO ,
the result has flag
.BR L_NO .
.PP
The privilege and frozen-label
fields of the labels are disregarded by all of these functions.
.SH SEE ALSO
.IR getflab (2)