OpenCoverage

selinux.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/selinux.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3static int-
4computecon (char const *path, mode_t mode, char **con)-
5{-
6 char *scon = -
7 ((void *)0)-
8 ;-
9 char *tcon = -
10 ((void *)0)-
11 ;-
12 security_class_t tclass;-
13 int rc = -1;-
14-
15 char *dir = dir_name (path);-
16 if (!dir
!dirDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
17 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
18 if (getcon (&scon) < 0
getcon (&scon) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
19 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
20 if (rpl_getfilecon (dir, &tcon) < 0
rpl_getfilecon...ir, &tcon) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
21 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
22 tclass = mode_to_security_class (mode);-
23 if (!tclass
!tclassDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
24 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
25 rc = security_compute_create (scon, tcon, tclass, con);-
26-
27quit:
code before this statement never executed: quit:
0
28 free (dir);-
29 freecon (scon);-
30 freecon (tcon);-
31 return
never executed: return rc;
rc;
never executed: return rc;
0
32}-
33int-
34defaultcon (char const *path, mode_t mode)-
35{-
36 int rc = -1;-
37 char *scon = -
38 ((void *)0)-
39 ;-
40 char *tcon = -
41 ((void *)0)-
42 ;-
43 context_t scontext = 0, tcontext = 0;-
44 const char *contype;-
45 char *constr;-
46 char *newpath = -
47 ((void *)0)-
48 ;-
49-
50 if (! ((((
(((path)[0]) == '/')Description
TRUEnever evaluated
FALSEnever evaluated
path)[0]) == '/')
(((path)[0]) == '/')Description
TRUEnever evaluated
FALSEnever evaluated
|| 0 != 0
0 != 0Description
TRUEnever evaluated
FALSEnever evaluated
))
0
51 {-
52-
53-
54 newpath = canonicalize_filename_mode (path, CAN_MISSING);-
55 if (! newpath
! newpathDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
56 ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
!!sizeof (struct { _Static_assert (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
57 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
58 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
59 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
60 ,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
61 (*__errno_location ())
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
62 ,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
63 dcgettext (((void *)0),
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
64 "error canonicalizing %s"
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
65 , 5)
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
66 , quotearg_style (shell_escape_always_quoting_style, path)), ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
67 0
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
68 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
69 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
70 ,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
71 (*__errno_location ())
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
72 ,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
73 dcgettext (((void *)0),
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
74 "error canonicalizing %s"
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
75 , 5)
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
76 , quotearg_style (shell_escape_always_quoting_style, path)), ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
77 0
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
78 ) ? (void) 0 : __builtin_unreachable ()))))
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
79 ;
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
80 path = newpath;-
81 }
never executed: end of block
0
82-
83 if (matchpathcon (path, mode, &scon) < 0
matchpathcon (...de, &scon) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
84 {-
85-
86-
87-
88-
89-
90 if (-
91 (*
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEnever evaluated
0
92 ==
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEnever evaluated
0
93 2
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEnever evaluated
0
94 )-
95 -
96 (*
never executed: (*__errno_location ()) = 61 ;
__errno_location ())
never executed: (*__errno_location ()) = 61 ;
0
97 =
never executed: (*__errno_location ()) = 61 ;
0
98 61
never executed: (*__errno_location ()) = 61 ;
0
99 ;
never executed: (*__errno_location ()) = 61 ;
0
100 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
101 }-
102 if (computecon (path, mode, &tcon) < 0
computecon (pa...de, &tcon) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
103 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
104 if (!(scontext = context_new (scon))
!(scontext = c...xt_new (scon))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
105 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
106 if (!(tcontext = context_new (tcon))
!(tcontext = c...xt_new (tcon))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
107 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
108-
109 if (!(contype = context_type_get (scontext))
!(contype = co...et (scontext))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
110 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
111 if (context_type_set (tcontext, contype)
context_type_s...text, contype)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
112 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
113 if (!(constr = context_str (tcontext))
!(constr = con...tr (tcontext))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
114 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
115-
116 rc = setfscreatecon (constr);-
117-
118quit:
code before this statement never executed: quit:
0
119 context_free (scontext);-
120 context_free (tcontext);-
121 freecon (scon);-
122 freecon (tcon);-
123 free (newpath);-
124 return
never executed: return rc;
rc;
never executed: return rc;
0
125}-
126static int-
127restorecon_private (char const *path, -
128 _Bool -
129 local)-
130{-
131 int rc = -1;-
132 struct stat sb;-
133 char *scon = -
134 ((void *)0)-
135 ;-
136 char *tcon = -
137 ((void *)0)-
138 ;-
139 context_t scontext = 0, tcontext = 0;-
140 const char *contype;-
141 char *constr;-
142 int fd;-
143-
144 if (local
localDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
145 {-
146 if (getfscreatecon (&tcon) < 0
getfscreatecon (&tcon) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
147 return
never executed: return rc;
rc;
never executed: return rc;
0
148 if (!tcon
!tconDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
149 {-
150 -
151 (*__errno_location ()) -
152 = -
153 61-
154 ;-
155 return
never executed: return rc;
rc;
never executed: return rc;
0
156 }-
157 rc = lsetfilecon (path, tcon);-
158 freecon (tcon);-
159 return
never executed: return rc;
rc;
never executed: return rc;
0
160 }-
161-
162 fd = open (path, -
163 00 -
164 | -
165 0400000-
166 );-
167 if (fd == -1
fd == -1Description
TRUEnever evaluated
FALSEnever evaluated
&& (
( (*__errno_lo...on ()) != 40 )Description
TRUEnever evaluated
FALSEnever evaluated
0
168 (*__errno_location ())
( (*__errno_lo...on ()) != 40 )Description
TRUEnever evaluated
FALSEnever evaluated
0
169 !=
( (*__errno_lo...on ()) != 40 )Description
TRUEnever evaluated
FALSEnever evaluated
0
170 40
( (*__errno_lo...on ()) != 40 )Description
TRUEnever evaluated
FALSEnever evaluated
0
171 )
( (*__errno_lo...on ()) != 40 )Description
TRUEnever evaluated
FALSEnever evaluated
)
0
172 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
173-
174 if (fd != -1
fd != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
175 {-
176 if (fstat (fd, &sb) < 0
fstat (fd, &sb) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
177 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
178 }
never executed: end of block
0
179 else-
180 {-
181 if (lstat (path, &sb) < 0
lstat (path, &sb) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
182 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
183 }
never executed: end of block
0
184-
185 if (matchpathcon (path, sb.st_mode, &scon) < 0
matchpathcon (...de, &scon) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
186 {-
187-
188-
189-
190-
191-
192 if (-
193 (*
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEnever evaluated
0
194 ==
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEnever evaluated
0
195 2
(*__errno_location ()) == 2Description
TRUEnever evaluated
FALSEnever evaluated
0
196 )-
197 -
198 (*
never executed: (*__errno_location ()) = 61 ;
__errno_location ())
never executed: (*__errno_location ()) = 61 ;
0
199 =
never executed: (*__errno_location ()) = 61 ;
0
200 61
never executed: (*__errno_location ()) = 61 ;
0
201 ;
never executed: (*__errno_location ()) = 61 ;
0
202 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
203 }-
204 if (!(scontext = context_new (scon))
!(scontext = c...xt_new (scon))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
205 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
206-
207 if (fd != -1
fd != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
208 {-
209 if (rpl_fgetfilecon (fd, &tcon) < 0
rpl_fgetfileco...fd, &tcon) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
210 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
211 }
never executed: end of block
0
212 else-
213 {-
214 if (rpl_lgetfilecon (path, &tcon) < 0
rpl_lgetfileco...th, &tcon) < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
215 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
216 }
never executed: end of block
0
217-
218 if (!(tcontext = context_new (tcon))
!(tcontext = c...xt_new (tcon))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
219 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
220-
221 if (!(contype = context_type_get (scontext))
!(contype = co...et (scontext))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
222 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
223 if (context_type_set (tcontext, contype)
context_type_s...text, contype)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
224 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
225 if (!(constr = context_str (tcontext))
!(constr = con...tr (tcontext))Description
TRUEnever evaluated
FALSEnever evaluated
)
0
226 goto
never executed: goto quit;
quit;
never executed: goto quit;
0
227-
228 if (fd != -1
fd != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
229 rc = fsetfilecon (fd, constr);
never executed: rc = fsetfilecon (fd, constr);
0
230 else-
231 rc = lsetfilecon (path, constr);
never executed: rc = lsetfilecon (path, constr);
0
232-
233quit:
code before this statement never executed: quit:
0
234 if (fd != -1
fd != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
235 close (fd);
never executed: close (fd);
0
236 context_free (scontext);-
237 context_free (tcontext);-
238 freecon (scon);-
239 freecon (tcon);-
240 return
never executed: return rc;
rc;
never executed: return rc;
0
241}-
242-
243_Bool-
244-
245restorecon (char const *path, -
246 _Bool -
247 recurse, -
248 _Bool -
249 local)-
250{-
251 char *newpath = -
252 ((void *)0)-
253 ;-
254 FTS *fts;-
255 -
256 _Bool -
257 ok = -
258 1-
259 ;-
260-
261 if (! ((((
(((path)[0]) == '/')Description
TRUEnever evaluated
FALSEnever evaluated
path)[0]) == '/')
(((path)[0]) == '/')Description
TRUEnever evaluated
FALSEnever evaluated
|| 0 != 0
0 != 0Description
TRUEnever evaluated
FALSEnever evaluated
) && ! local
! localDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
262 {-
263-
264-
265-
266-
267 newpath = canonicalize_filename_mode (path, CAN_MISSING);-
268 if (! newpath
! newpathDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
269 ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
!!sizeof (struct { _Static_assert (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
270 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
271 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
272 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
273 ,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
274 (*__errno_location ())
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
275 ,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
276 dcgettext (((void *)0),
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
277 "error canonicalizing %s"
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
278 , 5)
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
279 , quotearg_style (shell_escape_always_quoting_style, path)), ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
280 0
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
281 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
282 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
283 ,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
284 (*__errno_location ())
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
285 ,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
286 dcgettext (((void *)0),
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
287 "error canonicalizing %s"
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
288 , 5)
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
289 , quotearg_style (shell_escape_always_quoting_style, path)), ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
290 0
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
291 ) ? (void) 0 : __builtin_unreachable ()))))
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
292 ;
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, (*__errno_location ()), dcgettext (((void *)0), \"error canonicalizing %s\", 5), quotearg_style (shell_escape_always_quoting_style, path)), assume (false))" ")"); int _gl_dummy...(( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , (*__errno_location ()) , dcgettext (((void *)0), "error canonicalizing %s" , 5) , quotearg_style (shell_escape_always_quoting_style, path)), (( 0 ) ? (void) 0 : __builtin_unreachable ())))) ;
0
293 }
never executed: end of block
0
294-
295 const char *ftspath[2] = { newpath ? newpath : path, -
296 ((void *)0) -
297 };-
298-
299 if (! recurse
! recurseDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
300 {-
301 ok = restorecon_private (*ftspath, local) != -1;-
302 free (newpath);-
303 return
never executed: return ok;
ok;
never executed: return ok;
0
304 }-
305-
306 fts = xfts_open ((char *const *) ftspath, 0x0010, -
307 ((void *)0)-
308 );-
309 while (1)-
310 {-
311 FTSENT *ent;-
312-
313 ent = fts_read (fts);-
314 if (ent ==
ent == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
315 ((void *)0)
ent == ((void *)0)Description
TRUEnever evaluated
FALSEnever evaluated
0
316 )-
317 {-
318 if (-
319 (*
(*__errno_location ()) != 0Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
320 != 0
(*__errno_location ()) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
321 {-
322 error (0, -
323 (*__errno_location ())-
324 , -
325 dcgettext (((void *)0), -
326 "fts_read failed"-
327 , 5)-
328 );-
329 ok = -
330 0-
331 ;-
332 }
never executed: end of block
0
333 break;
never executed: break;
0
334 }-
335-
336 ok &= restorecon_private (fts->fts_path, local) != -1;-
337 }
never executed: end of block
0
338-
339 if (fts_close (fts) != 0
fts_close (fts) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
340 {-
341 error (0, -
342 (*__errno_location ())-
343 , -
344 dcgettext (((void *)0), -
345 "fts_close failed"-
346 , 5)-
347 );-
348 ok = -
349 0-
350 ;-
351 }
never executed: end of block
0
352-
353 free (newpath);-
354 return
never executed: return ok;
ok;
never executed: return ok;
0
355}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2