| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | enum RCH_status | - |
| 10 | { | - |
| 11 | | - |
| 12 | RC_ok = 2, | - |
| 13 | | - |
| 14 | | - |
| 15 | RC_excluded, | - |
| 16 | | - |
| 17 | | - |
| 18 | RC_inode_changed, | - |
| 19 | | - |
| 20 | | - |
| 21 | | - |
| 22 | RC_do_ordinary_chown, | - |
| 23 | | - |
| 24 | | - |
| 25 | RC_error | - |
| 26 | }; | - |
| 27 | | - |
| 28 | extern void | - |
| 29 | chopt_init (struct Chown_option *chopt) | - |
| 30 | { | - |
| 31 | chopt->verbosity = V_off; | - |
| 32 | chopt->root_dev_ino = | - |
| 33 | ((void *)0) | - |
| 34 | ; | - |
| 35 | chopt->affect_symlink_referent = | - |
| 36 | 1 | - |
| 37 | ; | - |
| 38 | chopt->recurse = | - |
| 39 | 0 | - |
| 40 | ; | - |
| 41 | chopt->force_silent = | - |
| 42 | 0 | - |
| 43 | ; | - |
| 44 | chopt->user_name = | - |
| 45 | ((void *)0) | - |
| 46 | ; | - |
| 47 | chopt->group_name = | - |
| 48 | ((void *)0) | - |
| 49 | ; | - |
| 50 | }executed 144 times by 2 tests: end of block | 144 |
| 51 | | - |
| 52 | extern void | - |
| 53 | chopt_free (struct Chown_option *chopt __attribute__ ((__unused__))) | - |
| 54 | { | - |
| 55 | | - |
| 56 | | - |
| 57 | } | - |
| 58 | | - |
| 59 | | - |
| 60 | | - |
| 61 | | - |
| 62 | | - |
| 63 | extern char * | - |
| 64 | gid_to_name (gid_t gid) | - |
| 65 | { | - |
| 66 | char buf[((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)]; | - |
| 67 | struct group *grp = getgrgid (gid); | - |
| 68 | returnexecuted 1 time by 1 test: return xstrdup (grp ? grp->gr_name : (! ((gid_t) 0 < (gid_t) -1)) ? imaxtostr (gid, buf) : umaxtostr (gid, buf)); xstrdup (grp ? grp->gr_nameexecuted 1 time by 1 test: return xstrdup (grp ? grp->gr_name : (! ((gid_t) 0 < (gid_t) -1)) ? imaxtostr (gid, buf) : umaxtostr (gid, buf)); | 1 |
| 69 | : (! ((gid_t) 0 < (gid_t) -1)) ? imaxtostr (gid, buf)executed 1 time by 1 test: return xstrdup (grp ? grp->gr_name : (! ((gid_t) 0 < (gid_t) -1)) ? imaxtostr (gid, buf) : umaxtostr (gid, buf)); | 1 |
| 70 | : umaxtostr (gid, buf));executed 1 time by 1 test: return xstrdup (grp ? grp->gr_name : (! ((gid_t) 0 < (gid_t) -1)) ? imaxtostr (gid, buf) : umaxtostr (gid, buf)); | 1 |
| 71 | } | - |
| 72 | | - |
| 73 | | - |
| 74 | | - |
| 75 | | - |
| 76 | | - |
| 77 | extern char * | - |
| 78 | uid_to_name (uid_t uid) | - |
| 79 | { | - |
| 80 | char buf[((((((sizeof (intmax_t) * 8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) + 1)]; | - |
| 81 | struct passwd *pwd = getpwuid (uid); | - |
| 82 | return never executed: return xstrdup (pwd ? pwd->pw_name : (! ((uid_t) 0 < (uid_t) -1)) ? imaxtostr (uid, buf) : umaxtostr (uid, buf)); xstrdup (pwd ? pwd->pw_namenever executed: return xstrdup (pwd ? pwd->pw_name : (! ((uid_t) 0 < (uid_t) -1)) ? imaxtostr (uid, buf) : umaxtostr (uid, buf)); | 0 |
| 83 | : (! ((uid_t) 0 < (uid_t) -1)) ? imaxtostr (uid, buf) never executed: return xstrdup (pwd ? pwd->pw_name : (! ((uid_t) 0 < (uid_t) -1)) ? imaxtostr (uid, buf) : umaxtostr (uid, buf)); | 0 |
| 84 | : umaxtostr (uid, buf)); never executed: return xstrdup (pwd ? pwd->pw_name : (! ((uid_t) 0 < (uid_t) -1)) ? imaxtostr (uid, buf) : umaxtostr (uid, buf)); | 0 |
| 85 | } | - |
| 86 | | - |
| 87 | | - |
| 88 | | - |
| 89 | static char * | - |
| 90 | user_group_str (char const *user, char const *group) | - |
| 91 | { | - |
| 92 | char *spec = | - |
| 93 | ((void *)0) | - |
| 94 | ; | - |
| 95 | | - |
| 96 | if (user| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 97 | { | - |
| 98 | if (group| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 99 | { | - |
| 100 | spec = xmalloc (strlen (user) + 1 + strlen (group) + 1); | - |
| 101 | stpcpy (stpcpy (stpcpy (spec, user), ":"), group); | - |
| 102 | } never executed: end of block | 0 |
| 103 | else | - |
| 104 | { | - |
| 105 | spec = xstrdup (user); | - |
| 106 | } never executed: end of block | 0 |
| 107 | } | - |
| 108 | else if (group| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 109 | { | - |
| 110 | spec = xstrdup (group); | - |
| 111 | } never executed: end of block | 0 |
| 112 | | - |
| 113 | return never executed: return spec; spec;never executed: return spec; | 0 |
| 114 | } | - |
| 115 | | - |
| 116 | | - |
| 117 | | - |
| 118 | | - |
| 119 | | - |
| 120 | static void | - |
| 121 | describe_change (const char *file, enum Change_status changed, | - |
| 122 | char const *old_user, char const *old_group, | - |
| 123 | char const *user, char const *group) | - |
| 124 | { | - |
| 125 | const char *fmt; | - |
| 126 | char *old_spec; | - |
| 127 | char *spec; | - |
| 128 | | - |
| 129 | if (changed == CH_NOT_APPLIED| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 130 | { | - |
| 131 | printf ( | - |
| 132 | dcgettext (((void *)0), | - |
| 133 | "neither symbolic link %s nor referent has been changed\n" | - |
| 134 | , 5) | - |
| 135 | , | - |
| 136 | quotearg_style (shell_escape_always_quoting_style, file)); | - |
| 137 | return; never executed: return; | 0 |
| 138 | } | - |
| 139 | | - |
| 140 | spec = user_group_str (user, group); | - |
| 141 | old_spec = user_group_str (user ? old_user : | - |
| 142 | ((void *)0) | - |
| 143 | , group ? old_group : | - |
| 144 | ((void *)0) | - |
| 145 | ); | - |
| 146 | | - |
| 147 | switch (changed) | - |
| 148 | { | - |
| 149 | case never executed: case CH_SUCCEEDED: CH_SUCCEEDED:never executed: case CH_SUCCEEDED: | 0 |
| 150 | fmt = (user| TRUE | never evaluated | | FALSE | never evaluated |
? | 0 |
| 151 | dcgettext (((void *)0), | - |
| 152 | "changed ownership of %s from %s to %s\n" | - |
| 153 | , 5) | - |
| 154 | | - |
| 155 | : group| TRUE | never evaluated | | FALSE | never evaluated |
? | 0 |
| 156 | dcgettext (((void *)0), | - |
| 157 | "changed group of %s from %s to %s\n" | - |
| 158 | , 5) | - |
| 159 | | - |
| 160 | : | - |
| 161 | dcgettext (((void *)0), | - |
| 162 | "no change to ownership of %s\n" | - |
| 163 | , 5) | - |
| 164 | ); | - |
| 165 | break; never executed: break; | 0 |
| 166 | case never executed: case CH_FAILED: CH_FAILED:never executed: case CH_FAILED: | 0 |
| 167 | if (old_spec| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 168 | { | - |
| 169 | fmt = (user| TRUE | never evaluated | | FALSE | never evaluated |
? | 0 |
| 170 | dcgettext (((void *)0), | - |
| 171 | "failed to change ownership of %s from %s to %s\n" | - |
| 172 | , 5) | - |
| 173 | | - |
| 174 | : group| TRUE | never evaluated | | FALSE | never evaluated |
? | 0 |
| 175 | dcgettext (((void *)0), | - |
| 176 | "failed to change group of %s from %s to %s\n" | - |
| 177 | , 5) | - |
| 178 | | - |
| 179 | : | - |
| 180 | dcgettext (((void *)0), | - |
| 181 | "failed to change ownership of %s\n" | - |
| 182 | , 5) | - |
| 183 | ); | - |
| 184 | } never executed: end of block | 0 |
| 185 | else | - |
| 186 | { | - |
| 187 | fmt = (user| TRUE | never evaluated | | FALSE | never evaluated |
? | 0 |
| 188 | dcgettext (((void *)0), | - |
| 189 | "failed to change ownership of %s to %s\n" | - |
| 190 | , 5) | - |
| 191 | | - |
| 192 | : group| TRUE | never evaluated | | FALSE | never evaluated |
? | 0 |
| 193 | dcgettext (((void *)0), | - |
| 194 | "failed to change group of %s to %s\n" | - |
| 195 | , 5) | - |
| 196 | | - |
| 197 | : | - |
| 198 | dcgettext (((void *)0), | - |
| 199 | "failed to change ownership of %s\n" | - |
| 200 | , 5) | - |
| 201 | ); | - |
| 202 | free (old_spec); | - |
| 203 | old_spec = spec; | - |
| 204 | spec = | - |
| 205 | ((void *)0) | - |
| 206 | ; | - |
| 207 | } never executed: end of block | 0 |
| 208 | break; never executed: break; | 0 |
| 209 | case never executed: case CH_NO_CHANGE_REQUESTED: CH_NO_CHANGE_REQUESTED:never executed: case CH_NO_CHANGE_REQUESTED: | 0 |
| 210 | fmt = (user| TRUE | never evaluated | | FALSE | never evaluated |
? | 0 |
| 211 | dcgettext (((void *)0), | - |
| 212 | "ownership of %s retained as %s\n" | - |
| 213 | , 5) | - |
| 214 | | - |
| 215 | : group| TRUE | never evaluated | | FALSE | never evaluated |
? | 0 |
| 216 | dcgettext (((void *)0), | - |
| 217 | "group of %s retained as %s\n" | - |
| 218 | , 5) | - |
| 219 | | - |
| 220 | : | - |
| 221 | dcgettext (((void *)0), | - |
| 222 | "ownership of %s retained\n" | - |
| 223 | , 5) | - |
| 224 | ); | - |
| 225 | break; never executed: break; | 0 |
| 226 | default never executed: default: :never executed: default: | 0 |
| 227 | abort (); never executed: abort (); | 0 |
| 228 | } | - |
| 229 | | - |
| 230 | printf (fmt, quotearg_style (shell_escape_always_quoting_style, file), old_spec, spec); | - |
| 231 | | - |
| 232 | free (old_spec); | - |
| 233 | free (spec); | - |
| 234 | } never executed: end of block | 0 |
| 235 | static enum RCH_status | - |
| 236 | restricted_chown (int cwd_fd, char const *file, | - |
| 237 | struct stat const *orig_st, | - |
| 238 | uid_t uid, gid_t gid, | - |
| 239 | uid_t required_uid, gid_t required_gid) | - |
| 240 | { | - |
| 241 | enum RCH_status status = RC_ok; | - |
| 242 | struct stat st; | - |
| 243 | int open_flags = | - |
| 244 | 04000 | - |
| 245 | | | - |
| 246 | 0400 | - |
| 247 | ; | - |
| 248 | int fd; | - |
| 249 | | - |
| 250 | if (required_uid == (uid_t) -1| TRUE | evaluated 60 times by 2 tests | | FALSE | never evaluated |
&& required_gid == (gid_t) -1| TRUE | evaluated 55 times by 2 tests | | FALSE | evaluated 5 times by 1 test |
) | 0-60 |
| 251 | returnexecuted 55 times by 2 tests: return RC_do_ordinary_chown; RC_do_ordinary_chown;executed 55 times by 2 tests: return RC_do_ordinary_chown; | 55 |
| 252 | | - |
| 253 | if (! | TRUE | never evaluated | | FALSE | evaluated 5 times by 1 test |
| 0-5 |
| 254 | ((((| TRUE | never evaluated | | FALSE | evaluated 5 times by 1 test |
| 0-5 |
| 255 | orig_st->st_mode| TRUE | never evaluated | | FALSE | evaluated 5 times by 1 test |
| 0-5 |
| 256 | )) & 0170000) == (0100000))| TRUE | never evaluated | | FALSE | evaluated 5 times by 1 test |
| 0-5 |
| 257 | ) | - |
| 258 | { | - |
| 259 | if ( | - |
| 260 | ((((| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 261 | orig_st->st_mode| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 262 | )) & 0170000) == (0040000))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 263 | ) | - |
| 264 | open_flags |= never executed: open_flags |= 0200000 ; | 0 |
| 265 | 0200000 never executed: open_flags |= 0200000 ; | 0 |
| 266 | ; never executed: open_flags |= 0200000 ; | 0 |
| 267 | else | - |
| 268 | return never executed: return RC_do_ordinary_chown; RC_do_ordinary_chown;never executed: return RC_do_ordinary_chown; | 0 |
| 269 | } | - |
| 270 | | - |
| 271 | fd = openat (cwd_fd, file, | - |
| 272 | 00 | - |
| 273 | | open_flags); | - |
| 274 | if (! (0 <= fd| TRUE | evaluated 3 times by 1 test | | FALSE | evaluated 2 times by 1 test |
| 2-3 |
| 275 | || ( | - |
| 276 | (*| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
__errno_location ()) | TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 277 | == | TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 278 | 13| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 279 | && | - |
| 280 | ((((| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 281 | orig_st->st_mode| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 282 | )) & 0170000) == (0100000))| TRUE | evaluated 2 times by 1 test | | FALSE | never evaluated |
| 0-2 |
| 283 | | - |
| 284 | && 0 <= (fd = openat (cwd_fd, file, | TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1 time by 1 test |
| 1 |
| 285 | 01 | TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1 time by 1 test |
| 1 |
| 286 | | open_flags))| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1 time by 1 test |
))) | 1 |
| 287 | returnexecuted 1 time by 1 test: return ( (*__errno_location ()) == 13 ? RC_do_ordinary_chown : RC_error); (executed 1 time by 1 test: return ( (*__errno_location ()) == 13 ? RC_do_ordinary_chown : RC_error); | 1 |
| 288 | (*__errno_location ()) executed 1 time by 1 test: return ( (*__errno_location ()) == 13 ? RC_do_ordinary_chown : RC_error); | 1 |
| 289 | == executed 1 time by 1 test: return ( (*__errno_location ()) == 13 ? RC_do_ordinary_chown : RC_error); | 1 |
| 290 | 13 executed 1 time by 1 test: return ( (*__errno_location ()) == 13 ? RC_do_ordinary_chown : RC_error); | 1 |
| 291 | ? RC_do_ordinary_chown : RC_error);executed 1 time by 1 test: return ( (*__errno_location ()) == 13 ? RC_do_ordinary_chown : RC_error); | 1 |
| 292 | | - |
| 293 | if (fstat (fd, &st) != 0| TRUE | never evaluated | | FALSE | evaluated 4 times by 1 test |
) | 0-4 |
| 294 | status = RC_error; never executed: status = RC_error; | 0 |
| 295 | else if (! ((*| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
orig_st).st_ino == (st).st_ino| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
&& (*| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
orig_st).st_dev == (st).st_dev| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
)) | 0-4 |
| 296 | status = RC_inode_changed; never executed: status = RC_inode_changed; | 0 |
| 297 | else if ((required_uid == (uid_t) -1| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
|| required_uid == st.st_uid| TRUE | never evaluated | | FALSE | never evaluated |
) | 0-4 |
| 298 | && (required_gid == (gid_t) -1| TRUE | never evaluated | | FALSE | evaluated 4 times by 1 test |
|| required_gid == st.st_gid| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
)) | 0-4 |
| 299 | { | - |
| 300 | if (fchown (fd, uid, gid) == 0| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
) | 0-4 |
| 301 | { | - |
| 302 | status = (close (fd) == 0| TRUE | evaluated 4 times by 1 test | | FALSE | never evaluated |
| 0-4 |
| 303 | ? RC_ok : RC_error); | - |
| 304 | returnexecuted 4 times by 1 test: return status; status;executed 4 times by 1 test: return status; | 4 |
| 305 | } | - |
| 306 | else | - |
| 307 | { | - |
| 308 | status = RC_error; | - |
| 309 | } never executed: end of block | 0 |
| 310 | } | - |
| 311 | | - |
| 312 | int saved_errno = | - |
| 313 | (*__errno_location ()) | - |
| 314 | ; | - |
| 315 | close (fd); | - |
| 316 | | - |
| 317 | (*__errno_location ()) | - |
| 318 | = saved_errno; | - |
| 319 | return never executed: return status; status;never executed: return status; | 0 |
| 320 | } | - |
| 321 | | - |
| 322 | | - |
| 323 | | - |
| 324 | | - |
| 325 | | - |
| 326 | | - |
| 327 | | - |
| 328 | static | - |
| 329 | _Bool | - |
| 330 | | - |
| 331 | change_file_owner (FTS *fts, FTSENT *ent, | - |
| 332 | uid_t uid, gid_t gid, | - |
| 333 | uid_t required_uid, gid_t required_gid, | - |
| 334 | struct Chown_option const *chopt) | - |
| 335 | { | - |
| 336 | char const *file_full_name = ent->fts_path; | - |
| 337 | char const *file = ent->fts_accpath; | - |
| 338 | struct stat const *file_stats; | - |
| 339 | struct stat stat_buf; | - |
| 340 | | - |
| 341 | _Bool | - |
| 342 | ok = | - |
| 343 | 1 | - |
| 344 | ; | - |
| 345 | | - |
| 346 | _Bool | - |
| 347 | do_chown; | - |
| 348 | | - |
| 349 | _Bool | - |
| 350 | symlink_changed = | - |
| 351 | 1 | - |
| 352 | ; | - |
| 353 | | - |
| 354 | switch (ent->fts_info) | - |
| 355 | { | - |
| 356 | caseexecuted 44 times by 2 tests: case 1: 1:executed 44 times by 2 tests: case 1: | 44 |
| 357 | if (chopt->recurse| TRUE | evaluated 26 times by 2 tests | | FALSE | evaluated 18 times by 2 tests |
) | 18-26 |
| 358 | { | - |
| 359 | if ((chopt->root_dev_ino| TRUE | evaluated 10 times by 2 tests | | FALSE | evaluated 16 times by 1 test |
&& ((*| TRUE | evaluated 4 times by 2 tests | | FALSE | evaluated 6 times by 2 tests |
ent->fts_statp).st_ino == (*chopt->root_dev_ino).st_ino| TRUE | evaluated 4 times by 2 tests | | FALSE | evaluated 6 times by 2 tests |
&& (*| TRUE | evaluated 4 times by 2 tests | | FALSE | never evaluated |
ent->fts_statp).st_dev == (*chopt->root_dev_ino).st_dev| TRUE | evaluated 4 times by 2 tests | | FALSE | never evaluated |
))) | 0-16 |
| 360 | { | - |
| 361 | | - |
| 362 | | - |
| 363 | do { if ((| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 364 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 365 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 366 | ) && __builtin_constant_p (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 367 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 368 | ) && (__s1_len = __builtin_strlen (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 369 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 370 | ), __s2_len = __builtin_strlen (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 371 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 372 | ), (!((size_t)(const void *)((| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 373 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 374 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 375 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 376 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 377 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 378 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 379 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 380 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 381 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 382 | , | TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 383 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 384 | ) : (__builtin_constant_p (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 385 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 386 | ) && ((size_t)(const void *)((| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 387 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 388 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 389 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 390 | ) == 1) && (__s1_len = __builtin_strlen (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 391 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 392 | ), __s1_len < 4) ? (__builtin_constant_p (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 393 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 394 | ) && ((size_t)(const void *)((| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 395 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 396 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 397 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 398 | ) == 1) ? __builtin_strcmp (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 399 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 400 | , | TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 401 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 402 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 403 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 404 | ); int __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 405 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 406 | ))[0] - __s2[0]); if (__s1_len > 0| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 0-2 |
| 407 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 408 | ))[1] - __s2[1]); if (__s1_len > 1| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 0-2 |
| 409 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 410 | ))[2] - __s2[2]); if (__s1_len > 2| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( file_full_name ))[3] - __s2[3]); | TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 0-2 |
| 411 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
never executed: __result = (((const unsigned char *) (const char *) ( file_full_name ))[3] - __s2[3]); | 0-2 |
| 412 | ))[3] - __s2[3]);| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
never executed: __result = (((const unsigned char *) (const char *) ( file_full_name ))[3] - __s2[3]); }never executed: end of block }never executed: end of block __result; }))) : (__builtin_constant_p (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 0-2 |
| 413 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 414 | ) && ((size_t)(const void *)((| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 415 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 416 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 417 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 418 | ) == 1) && (__s2_len = __builtin_strlen (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 419 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 420 | ), __s2_len < 4) ? (__builtin_constant_p (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 421 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 422 | ) && ((size_t)(const void *)((| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 423 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 424 | ) + 1) - (size_t)(const void *)(| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 425 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 426 | ) == 1) ? __builtin_strcmp (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 427 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 428 | , | TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 429 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 430 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 431 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 432 | ); int __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 433 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 434 | ))[0] - __s2[0]); if (__s2_len > 0| TRUE | evaluated 4 times by 2 tests | | FALSE | never evaluated |
&& __result == 0| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 0-4 |
| 435 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 436 | ))[1] - __s2[1]); if (__s2_len > 1| TRUE | never evaluated | | FALSE | evaluated 2 times by 2 tests |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 0-2 |
| 437 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 438 | ))[2] - __s2[2]); if (__s2_len > 2| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( "/" ))[3] - __s2[3]); | TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 0-2 |
| 439 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
never executed: __result = (((const unsigned char *) (const char *) ( "/" ))[3] - __s2[3]); | 0-2 |
| 440 | ))[3] - __s2[3]);| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
never executed: __result = (((const unsigned char *) (const char *) ( "/" ))[3] - __s2[3]); }never executed: end of block } __result; }))) : __builtin_strcmp (| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 0-2 |
| 441 | file_full_name| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 442 | , | TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 443 | "/"| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 444 | )))); }) | TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
| 2 |
| 445 | == 0)| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
) error (0, 0, executed 2 times by 2 tests: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 2 |
| 446 | dcgettext (((void *)0), executed 2 times by 2 tests: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 2 |
| 447 | "it is dangerous to operate recursively on %s"executed 2 times by 2 tests: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 2 |
| 448 | , 5)executed 2 times by 2 tests: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 2 |
| 449 | , quotearg_style (shell_escape_always_quoting_style, file_full_name));executed 2 times by 2 tests: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); else error (0, 0, executed 2 times by 2 tests: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 2 |
| 450 | dcgettext (((void *)0), executed 2 times by 2 tests: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 2 |
| 451 | "it is dangerous to operate recursively on %s (same as %s)"executed 2 times by 2 tests: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 2 |
| 452 | , 5)executed 2 times by 2 tests: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 2 |
| 453 | , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/"));executed 2 times by 2 tests: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); error (0, 0, | 2 |
| 454 | dcgettext (((void *)0), | - |
| 455 | "use --no-preserve-root to override this failsafe" | - |
| 456 | , 5) | - |
| 457 | ); } while (0); | - |
| 458 | | - |
| 459 | fts_set (fts, ent, 4); | - |
| 460 | | - |
| 461 | (__extension__ ({ __typeof__ (fts_read (fts)) __x = (fts_read (fts)); (void) __x; })); | - |
| 462 | returnexecuted 4 times by 2 tests: return 0 ; executed 4 times by 2 tests: return 0 ; | 4 |
| 463 | 0executed 4 times by 2 tests: return 0 ; | 4 |
| 464 | ;executed 4 times by 2 tests: return 0 ; | 4 |
| 465 | } | - |
| 466 | returnexecuted 22 times by 2 tests: return 1 ; executed 22 times by 2 tests: return 1 ; | 22 |
| 467 | 1executed 22 times by 2 tests: return 1 ; | 22 |
| 468 | ;executed 22 times by 2 tests: return 1 ; | 22 |
| 469 | } | - |
| 470 | break;executed 18 times by 2 tests: break; | 18 |
| 471 | | - |
| 472 | caseexecuted 40 times by 2 tests: case 6: 6:executed 40 times by 2 tests: case 6: | 40 |
| 473 | if (! chopt->recurse| TRUE | evaluated 18 times by 2 tests | | FALSE | evaluated 22 times by 2 tests |
) | 18-22 |
| 474 | returnexecuted 18 times by 2 tests: return 1 ; executed 18 times by 2 tests: return 1 ; | 18 |
| 475 | 1executed 18 times by 2 tests: return 1 ; | 18 |
| 476 | ;executed 18 times by 2 tests: return 1 ; | 18 |
| 477 | break;executed 22 times by 2 tests: break; | 22 |
| 478 | | - |
| 479 | caseexecuted 5 times by 2 tests: case 10: 10:executed 5 times by 2 tests: case 10: | 5 |
| 480 | | - |
| 481 | | - |
| 482 | | - |
| 483 | | - |
| 484 | | - |
| 485 | | - |
| 486 | | - |
| 487 | if (ent->fts_level == 0| TRUE | evaluated 4 times by 2 tests | | FALSE | evaluated 1 time by 1 test |
&& ent->fts_number == 0| TRUE | evaluated 2 times by 2 tests | | FALSE | evaluated 2 times by 2 tests |
) | 1-4 |
| 488 | { | - |
| 489 | ent->fts_number = 1; | - |
| 490 | fts_set (fts, ent, 1); | - |
| 491 | returnexecuted 2 times by 2 tests: return 1 ; executed 2 times by 2 tests: return 1 ; | 2 |
| 492 | 1executed 2 times by 2 tests: return 1 ; | 2 |
| 493 | ;executed 2 times by 2 tests: return 1 ; | 2 |
| 494 | } | - |
| 495 | if (! chopt->force_silent| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 2 times by 2 tests |
) | 1-2 |
| 496 | error (0, ent->fts_errno, executed 1 time by 1 test: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot access %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 497 | dcgettext (((void *)0), executed 1 time by 1 test: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot access %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 498 | "cannot access %s"executed 1 time by 1 test: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot access %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 499 | , 5)executed 1 time by 1 test: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot access %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 500 | ,executed 1 time by 1 test: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot access %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 501 | quotearg_style (shell_escape_always_quoting_style, file_full_name));executed 1 time by 1 test: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot access %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 502 | ok = | - |
| 503 | 0 | - |
| 504 | ; | - |
| 505 | break;executed 3 times by 2 tests: break; | 3 |
| 506 | | - |
| 507 | case never executed: case 7: 7:never executed: case 7: | 0 |
| 508 | if (! chopt->force_silent| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 509 | error (0, ent->fts_errno, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, file_full_name)); never executed: error (0, ent->fts_errno, "%s", quotearg_n_style_colon (0, shell_escape_quoting_style, file_full_name)); | 0 |
| 510 | ok = | - |
| 511 | 0 | - |
| 512 | ; | - |
| 513 | break; never executed: break; | 0 |
| 514 | | - |
| 515 | case never executed: case 4: 4:never executed: case 4: | 0 |
| 516 | if (! chopt->force_silent| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 517 | error (0, ent->fts_errno, never executed: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot read directory %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 518 | dcgettext (((void *)0), never executed: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot read directory %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 519 | "cannot read directory %s" never executed: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot read directory %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 520 | , 5) never executed: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot read directory %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 521 | , never executed: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot read directory %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 522 | quotearg_style (shell_escape_always_quoting_style, file_full_name)); never executed: error (0, ent->fts_errno, dcgettext (((void *)0), "cannot read directory %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 523 | ok = | - |
| 524 | 0 | - |
| 525 | ; | - |
| 526 | break; never executed: break; | 0 |
| 527 | | - |
| 528 | case never executed: case 2: 2:never executed: case 2: | 0 |
| 529 | if (cycle_warning_required (fts, ent)| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 530 | { | - |
| 531 | do { error (0, 0, | - |
| 532 | dcgettext (((void *)0), | - |
| 533 | "WARNING: Circular directory structure.\nThis almost certainly means that you have a corrupted file system.\nNOTIFY YOUR SYSTEM MANAGER.\nThe following directory is part of the cycle:\n %s\n" | - |
| 534 | , 5) | - |
| 535 | , quotearg_n_style_colon (0, shell_escape_quoting_style, file_full_name)); } while (0); | - |
| 536 | return never executed: return 0 ; never executed: return 0 ; | 0 |
| 537 | 0 never executed: return 0 ; | 0 |
| 538 | ; never executed: return 0 ; | 0 |
| 539 | } | - |
| 540 | break; never executed: break; | 0 |
| 541 | | - |
| 542 | defaultexecuted 59 times by 2 tests: default: :executed 59 times by 2 tests: default: | 59 |
| 543 | break;executed 59 times by 2 tests: break; | 59 |
| 544 | } | - |
| 545 | | - |
| 546 | if (!ok| TRUE | evaluated 3 times by 2 tests | | FALSE | evaluated 99 times by 2 tests |
) | 3-99 |
| 547 | { | - |
| 548 | do_chown = | - |
| 549 | 0 | - |
| 550 | ; | - |
| 551 | file_stats = | - |
| 552 | ((void *)0) | - |
| 553 | ; | - |
| 554 | }executed 3 times by 2 tests: end of block | 3 |
| 555 | else if (required_uid == (uid_t) -1| TRUE | evaluated 99 times by 2 tests | | FALSE | never evaluated |
&& required_gid == (gid_t) -1| TRUE | evaluated 94 times by 2 tests | | FALSE | evaluated 5 times by 1 test |
| 0-99 |
| 556 | && chopt->verbosity == V_off| TRUE | evaluated 94 times by 2 tests | | FALSE | never evaluated |
| 0-94 |
| 557 | && ! chopt->root_dev_ino| TRUE | evaluated 83 times by 2 tests | | FALSE | evaluated 11 times by 2 tests |
| 11-83 |
| 558 | && ! chopt->affect_symlink_referent| TRUE | evaluated 32 times by 1 test | | FALSE | evaluated 51 times by 2 tests |
) | 32-51 |
| 559 | { | - |
| 560 | do_chown = | - |
| 561 | 1 | - |
| 562 | ; | - |
| 563 | file_stats = ent->fts_statp; | - |
| 564 | }executed 32 times by 1 test: end of block | 32 |
| 565 | else | - |
| 566 | { | - |
| 567 | file_stats = ent->fts_statp; | - |
| 568 | | - |
| 569 | | - |
| 570 | | - |
| 571 | if (chopt->affect_symlink_referent| TRUE | evaluated 61 times by 2 tests | | FALSE | evaluated 6 times by 2 tests |
&& | 6-61 |
| 572 | ((((| TRUE | evaluated 6 times by 2 tests | | FALSE | evaluated 55 times by 2 tests |
| 6-55 |
| 573 | file_stats->st_mode| TRUE | evaluated 6 times by 2 tests | | FALSE | evaluated 55 times by 2 tests |
| 6-55 |
| 574 | )) & 0170000) == (0120000))| TRUE | evaluated 6 times by 2 tests | | FALSE | evaluated 55 times by 2 tests |
| 6-55 |
| 575 | ) | - |
| 576 | { | - |
| 577 | if (fstatat (fts->fts_cwd_fd, file, &stat_buf, 0) != 0| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 5 times by 1 test |
) | 1-5 |
| 578 | { | - |
| 579 | if (! chopt->force_silent| TRUE | evaluated 1 time by 1 test | | FALSE | never evaluated |
) | 0-1 |
| 580 | error (0, executed 1 time by 1 test: error (0, (*__errno_location ()) , dcgettext (((void *)0), "cannot dereference %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 581 | (*__errno_location ())executed 1 time by 1 test: error (0, (*__errno_location ()) , dcgettext (((void *)0), "cannot dereference %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 582 | , executed 1 time by 1 test: error (0, (*__errno_location ()) , dcgettext (((void *)0), "cannot dereference %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 583 | dcgettext (((void *)0), executed 1 time by 1 test: error (0, (*__errno_location ()) , dcgettext (((void *)0), "cannot dereference %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 584 | "cannot dereference %s"executed 1 time by 1 test: error (0, (*__errno_location ()) , dcgettext (((void *)0), "cannot dereference %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 585 | , 5)executed 1 time by 1 test: error (0, (*__errno_location ()) , dcgettext (((void *)0), "cannot dereference %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 586 | ,executed 1 time by 1 test: error (0, (*__errno_location ()) , dcgettext (((void *)0), "cannot dereference %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 587 | quotearg_style (shell_escape_always_quoting_style, file_full_name));executed 1 time by 1 test: error (0, (*__errno_location ()) , dcgettext (((void *)0), "cannot dereference %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 1 |
| 588 | ok = | - |
| 589 | 0 | - |
| 590 | ; | - |
| 591 | }executed 1 time by 1 test: end of block | 1 |
| 592 | | - |
| 593 | file_stats = &stat_buf; | - |
| 594 | }executed 6 times by 2 tests: end of block | 6 |
| 595 | | - |
| 596 | do_chown = (ok| TRUE | evaluated 66 times by 2 tests | | FALSE | evaluated 1 time by 1 test |
| 1-66 |
| 597 | && (required_uid == (uid_t) -1| TRUE | evaluated 66 times by 2 tests | | FALSE | never evaluated |
| 0-66 |
| 598 | || required_uid == file_stats->st_uid| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 599 | && (required_gid == (gid_t) -1| TRUE | evaluated 61 times by 2 tests | | FALSE | evaluated 5 times by 1 test |
| 5-61 |
| 600 | || required_gid == file_stats->st_gid| TRUE | evaluated 5 times by 1 test | | FALSE | never evaluated |
)); | 0-5 |
| 601 | }executed 67 times by 2 tests: end of block | 67 |
| 602 | | - |
| 603 | | - |
| 604 | if (ok| TRUE | evaluated 98 times by 2 tests | | FALSE | evaluated 4 times by 2 tests |
| 4-98 |
| 605 | && ((| TRUE | evaluated 18 times by 2 tests | | FALSE | evaluated 80 times by 2 tests |
ent)->fts_info == 1| TRUE | evaluated 18 times by 2 tests | | FALSE | evaluated 80 times by 2 tests |
|| (| TRUE | never evaluated | | FALSE | evaluated 80 times by 2 tests |
ent)->fts_info == 2| TRUE | never evaluated | | FALSE | evaluated 80 times by 2 tests |
|| (| TRUE | evaluated 22 times by 2 tests | | FALSE | evaluated 58 times by 2 tests |
ent)->fts_info == 6| TRUE | evaluated 22 times by 2 tests | | FALSE | evaluated 58 times by 2 tests |
|| (| TRUE | never evaluated | | FALSE | evaluated 58 times by 2 tests |
ent)->fts_info == 4| TRUE | never evaluated | | FALSE | evaluated 58 times by 2 tests |
) | 0-80 |
| 606 | && (chopt->root_dev_ino| TRUE | evaluated 6 times by 2 tests | | FALSE | evaluated 34 times by 2 tests |
&& ((*| TRUE | never evaluated | | FALSE | evaluated 6 times by 2 tests |
file_stats).st_ino == (*chopt->root_dev_ino).st_ino| TRUE | never evaluated | | FALSE | evaluated 6 times by 2 tests |
&& (*| TRUE | never evaluated | | FALSE | never evaluated |
file_stats).st_dev == (*chopt->root_dev_ino).st_dev| TRUE | never evaluated | | FALSE | never evaluated |
))) | 0-34 |
| 607 | { | - |
| 608 | do { if ((| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 609 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 610 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 611 | ) && __builtin_constant_p (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 612 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 613 | ) && (__s1_len = __builtin_strlen (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 614 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 615 | ), __s2_len = __builtin_strlen (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 616 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 617 | ), (!((size_t)(const void *)((| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 618 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 619 | ) + 1) - (size_t)(const void *)(| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 620 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 621 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 622 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 623 | ) + 1) - (size_t)(const void *)(| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 624 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 625 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 626 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 627 | , | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 628 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 629 | ) : (__builtin_constant_p (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 630 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 631 | ) && ((size_t)(const void *)((| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 632 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 633 | ) + 1) - (size_t)(const void *)(| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 634 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 635 | ) == 1) && (__s1_len = __builtin_strlen (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 636 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 637 | ), __s1_len < 4) ? (__builtin_constant_p (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 638 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 639 | ) && ((size_t)(const void *)((| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 640 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 641 | ) + 1) - (size_t)(const void *)(| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 642 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 643 | ) == 1) ? __builtin_strcmp (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 644 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 645 | , | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 646 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 647 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 648 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 649 | ); int __result = (((const unsigned char *) (const char *) (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 650 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 651 | ))[0] - __s2[0]); if (__s1_len > 0| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 652 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 653 | ))[1] - __s2[1]); if (__s1_len > 1| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 654 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 655 | ))[2] - __s2[2]); if (__s1_len > 2| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( file_full_name ))[3] - __s2[3]); | 0 |
| 656 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( file_full_name ))[3] - __s2[3]); | 0 |
| 657 | ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 658 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 659 | ) && ((size_t)(const void *)((| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 660 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 661 | ) + 1) - (size_t)(const void *)(| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 662 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 663 | ) == 1) && (__s2_len = __builtin_strlen (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 664 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 665 | ), __s2_len < 4) ? (__builtin_constant_p (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 666 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 667 | ) && ((size_t)(const void *)((| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 668 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 669 | ) + 1) - (size_t)(const void *)(| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 670 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 671 | ) == 1) ? __builtin_strcmp (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 672 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 673 | , | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 674 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 675 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 676 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 677 | ); int __result = (((const unsigned char *) (const char *) (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 678 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 679 | ))[0] - __s2[0]); if (__s2_len > 0| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 680 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 681 | ))[1] - __s2[1]); if (__s2_len > 1| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) { __result = (((const unsigned char *) (const char *) (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 682 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 683 | ))[2] - __s2[2]); if (__s2_len > 2| TRUE | never evaluated | | FALSE | never evaluated |
&& __result == 0| TRUE | never evaluated | | FALSE | never evaluated |
) __result = (((const unsigned char *) (const char *) (never executed: __result = (((const unsigned char *) (const char *) ( "/" ))[3] - __s2[3]); | 0 |
| 684 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
never executed: __result = (((const unsigned char *) (const char *) ( "/" ))[3] - __s2[3]); | 0 |
| 685 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 686 | file_full_name| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 687 | , | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 688 | "/"| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 689 | )))); }) | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 690 | == 0)| TRUE | never evaluated | | FALSE | never evaluated |
) error (0, 0, never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 691 | dcgettext (((void *)0), never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 692 | "it is dangerous to operate recursively on %s" never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 693 | , 5) never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 694 | , quotearg_style (shell_escape_always_quoting_style, file_full_name)); never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file_full_name)); else error (0, 0, never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 0 |
| 695 | dcgettext (((void *)0), never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 0 |
| 696 | "it is dangerous to operate recursively on %s (same as %s)" never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 0 |
| 697 | , 5) never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 0 |
| 698 | , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, file_full_name), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); error (0, 0, | 0 |
| 699 | dcgettext (((void *)0), | - |
| 700 | "use --no-preserve-root to override this failsafe" | - |
| 701 | , 5) | - |
| 702 | ); } while (0); | - |
| 703 | return never executed: return 0 ; never executed: return 0 ; | 0 |
| 704 | 0 never executed: return 0 ; | 0 |
| 705 | ; never executed: return 0 ; | 0 |
| 706 | } | - |
| 707 | | - |
| 708 | if (do_chown| TRUE | evaluated 98 times by 2 tests | | FALSE | evaluated 4 times by 2 tests |
) | 4-98 |
| 709 | { | - |
| 710 | if ( ! chopt->affect_symlink_referent| TRUE | evaluated 38 times by 2 tests | | FALSE | evaluated 60 times by 2 tests |
) | 38-60 |
| 711 | { | - |
| 712 | ok = (lchownat (fts->fts_cwd_fd, file, uid, gid) == 0); | - |
| 713 | | - |
| 714 | | - |
| 715 | | - |
| 716 | | - |
| 717 | if (!ok| TRUE | never evaluated | | FALSE | evaluated 38 times by 2 tests |
&& | 0-38 |
| 718 | (*| TRUE | never evaluated | | FALSE | never evaluated |
__errno_location ()) | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 719 | == | TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 720 | 95| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 721 | ) | - |
| 722 | { | - |
| 723 | ok = | - |
| 724 | 1 | - |
| 725 | ; | - |
| 726 | symlink_changed = | - |
| 727 | 0 | - |
| 728 | ; | - |
| 729 | } never executed: end of block | 0 |
| 730 | }executed 38 times by 2 tests: end of block | 38 |
| 731 | else | - |
| 732 | { | - |
| 733 | enum RCH_status err | - |
| 734 | = restricted_chown (fts->fts_cwd_fd, file, file_stats, uid, gid, | - |
| 735 | required_uid, required_gid); | - |
| 736 | switch (err) | - |
| 737 | { | - |
| 738 | caseexecuted 4 times by 1 test: case RC_ok: RC_ok:executed 4 times by 1 test: case RC_ok: | 4 |
| 739 | break;executed 4 times by 1 test: break; | 4 |
| 740 | | - |
| 741 | caseexecuted 56 times by 2 tests: case RC_do_ordinary_chown: RC_do_ordinary_chown:executed 56 times by 2 tests: case RC_do_ordinary_chown: | 56 |
| 742 | ok = (chownat (fts->fts_cwd_fd, file, uid, gid) == 0); | - |
| 743 | break;executed 56 times by 2 tests: break; | 56 |
| 744 | | - |
| 745 | case never executed: case RC_error: RC_error:never executed: case RC_error: | 0 |
| 746 | ok = | - |
| 747 | 0 | - |
| 748 | ; | - |
| 749 | break; never executed: break; | 0 |
| 750 | | - |
| 751 | case never executed: case RC_inode_changed: RC_inode_changed:never executed: case RC_inode_changed: | 0 |
| 752 | | - |
| 753 | case never executed: case RC_excluded: RC_excluded:never executed: case RC_excluded: | 0 |
| 754 | do_chown = | - |
| 755 | 0 | - |
| 756 | ; | - |
| 757 | ok = | - |
| 758 | 0 | - |
| 759 | ; | - |
| 760 | break; never executed: break; | 0 |
| 761 | | - |
| 762 | default never executed: default: :never executed: default: | 0 |
| 763 | abort (); never executed: abort (); | 0 |
| 764 | } | - |
| 765 | } | - |
| 766 | if (do_chown| TRUE | evaluated 98 times by 2 tests | | FALSE | never evaluated |
&& !ok| TRUE | never evaluated | | FALSE | evaluated 98 times by 2 tests |
&& ! chopt->force_silent| TRUE | never evaluated | | FALSE | never evaluated |
) | 0-98 |
| 767 | error (0, never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 768 | (*__errno_location ()) never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 769 | , (uid != (uid_t) -1 never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 770 | ? never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 771 | dcgettext (((void *)0), never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 772 | "changing ownership of %s" never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 773 | , 5) never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 774 | never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 775 | : never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 776 | dcgettext (((void *)0), never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 777 | "changing group of %s" never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 778 | , 5) never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 779 | ), never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 780 | quotearg_style (shell_escape_always_quoting_style, file_full_name)); never executed: error (0, (*__errno_location ()) , (uid != (uid_t) -1 ? dcgettext (((void *)0), "changing ownership of %s" , 5) : dcgettext (((void *)0), "changing group of %s" , 5) ), quotearg_style (shell_escape_always_quoting_style, file_full_name)); | 0 |
| 781 | }executed 98 times by 2 tests: end of block | 98 |
| 782 | | - |
| 783 | if (chopt->verbosity != V_off| TRUE | never evaluated | | FALSE | evaluated 102 times by 2 tests |
) | 0-102 |
| 784 | { | - |
| 785 | | - |
| 786 | _Bool | - |
| 787 | changed = | - |
| 788 | ((do_chown| TRUE | never evaluated | | FALSE | never evaluated |
&& ok| TRUE | never evaluated | | FALSE | never evaluated |
&& symlink_changed| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 789 | && ! ((uid == (uid_t) -1| TRUE | never evaluated | | FALSE | never evaluated |
|| uid == file_stats->st_uid| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 790 | && (gid == (gid_t) -1| TRUE | never evaluated | | FALSE | never evaluated |
|| gid == file_stats->st_gid| TRUE | never evaluated | | FALSE | never evaluated |
))); | 0 |
| 791 | | - |
| 792 | if (changed| TRUE | never evaluated | | FALSE | never evaluated |
|| chopt->verbosity == V_high| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 793 | { | - |
| 794 | enum Change_status ch_status = | - |
| 795 | (!ok| TRUE | never evaluated | | FALSE | never evaluated |
? CH_FAILED | 0 |
| 796 | : !symlink_changed| TRUE | never evaluated | | FALSE | never evaluated |
? CH_NOT_APPLIED | 0 |
| 797 | : !changed| TRUE | never evaluated | | FALSE | never evaluated |
? CH_NO_CHANGE_REQUESTED | 0 |
| 798 | : CH_SUCCEEDED); | - |
| 799 | char *old_usr = file_stats| TRUE | never evaluated | | FALSE | never evaluated |
? uid_to_name (file_stats->st_uid) : | 0 |
| 800 | ((void *)0) | - |
| 801 | ; | - |
| 802 | char *old_grp = file_stats| TRUE | never evaluated | | FALSE | never evaluated |
? gid_to_name (file_stats->st_gid) : | 0 |
| 803 | ((void *)0) | - |
| 804 | ; | - |
| 805 | describe_change (file_full_name, ch_status, | - |
| 806 | old_usr, old_grp, | - |
| 807 | chopt->user_name, chopt->group_name); | - |
| 808 | free (old_usr); | - |
| 809 | free (old_grp); | - |
| 810 | } never executed: end of block | 0 |
| 811 | } never executed: end of block | 0 |
| 812 | | - |
| 813 | if ( ! chopt->recurse| TRUE | evaluated 54 times by 2 tests | | FALSE | evaluated 48 times by 2 tests |
) | 48-54 |
| 814 | fts_set (fts, ent, 4);executed 54 times by 2 tests: fts_set (fts, ent, 4); | 54 |
| 815 | | - |
| 816 | returnexecuted 102 times by 2 tests: return ok; ok;executed 102 times by 2 tests: return ok; | 102 |
| 817 | } | - |
| 818 | extern | - |
| 819 | _Bool | - |
| 820 | | - |
| 821 | chown_files (char **files, int bit_flags, | - |
| 822 | uid_t uid, gid_t gid, | - |
| 823 | uid_t required_uid, gid_t required_gid, | - |
| 824 | struct Chown_option const *chopt) | - |
| 825 | { | - |
| 826 | | - |
| 827 | _Bool | - |
| 828 | ok = | - |
| 829 | 1 | - |
| 830 | ; | - |
| 831 | | - |
| 832 | | - |
| 833 | int stat_flags = ((required_uid != (uid_t) -1| TRUE | never evaluated | | FALSE | evaluated 73 times by 2 tests |
|| required_gid != (gid_t) -1| TRUE | evaluated 5 times by 1 test | | FALSE | evaluated 68 times by 2 tests |
| 0-73 |
| 834 | || chopt->affect_symlink_referent| TRUE | evaluated 46 times by 2 tests | | FALSE | evaluated 22 times by 2 tests |
| 22-46 |
| 835 | || chopt->verbosity != V_off| TRUE | never evaluated | | FALSE | evaluated 22 times by 2 tests |
) | 0-22 |
| 836 | ? 0 | - |
| 837 | : 0x0008); | - |
| 838 | | - |
| 839 | FTS *fts = xfts_open (files, bit_flags | stat_flags, | - |
| 840 | ((void *)0) | - |
| 841 | ); | - |
| 842 | | - |
| 843 | while (1) | - |
| 844 | { | - |
| 845 | FTSENT *ent; | - |
| 846 | | - |
| 847 | ent = fts_read (fts); | - |
| 848 | if (ent == | TRUE | evaluated 73 times by 2 tests | | FALSE | evaluated 148 times by 2 tests |
| 73-148 |
| 849 | ((void *)0)| TRUE | evaluated 73 times by 2 tests | | FALSE | evaluated 148 times by 2 tests |
| 73-148 |
| 850 | ) | - |
| 851 | { | - |
| 852 | if ( | - |
| 853 | (*| TRUE | never evaluated | | FALSE | evaluated 73 times by 2 tests |
__errno_location ()) | TRUE | never evaluated | | FALSE | evaluated 73 times by 2 tests |
| 0-73 |
| 854 | != 0| TRUE | never evaluated | | FALSE | evaluated 73 times by 2 tests |
) | 0-73 |
| 855 | { | - |
| 856 | | - |
| 857 | if (! chopt->force_silent| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 858 | error (0, never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), "fts_read failed" , 5) ); | 0 |
| 859 | (*__errno_location ()) never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), "fts_read failed" , 5) ); | 0 |
| 860 | , never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), "fts_read failed" , 5) ); | 0 |
| 861 | dcgettext (((void *)0), never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), "fts_read failed" , 5) ); | 0 |
| 862 | "fts_read failed" never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), "fts_read failed" , 5) ); | 0 |
| 863 | , 5) never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), "fts_read failed" , 5) ); | 0 |
| 864 | ); never executed: error (0, (*__errno_location ()) , dcgettext (((void *)0), "fts_read failed" , 5) ); | 0 |
| 865 | ok = | - |
| 866 | 0 | - |
| 867 | ; | - |
| 868 | } never executed: end of block | 0 |
| 869 | break;executed 73 times by 2 tests: break; | 73 |
| 870 | } | - |
| 871 | | - |
| 872 | ok &= change_file_owner (fts, ent, uid, gid, | - |
| 873 | required_uid, required_gid, chopt); | - |
| 874 | }executed 148 times by 2 tests: end of block | 148 |
| 875 | | - |
| 876 | if (fts_close (fts) != 0| TRUE | never evaluated | | FALSE | evaluated 73 times by 2 tests |
) | 0-73 |
| 877 | { | - |
| 878 | error (0, | - |
| 879 | (*__errno_location ()) | - |
| 880 | , | - |
| 881 | dcgettext (((void *)0), | - |
| 882 | "fts_close failed" | - |
| 883 | , 5) | - |
| 884 | ); | - |
| 885 | ok = | - |
| 886 | 0 | - |
| 887 | ; | - |
| 888 | } never executed: end of block | 0 |
| 889 | | - |
| 890 | returnexecuted 73 times by 2 tests: return ok; ok;executed 73 times by 2 tests: return ok; | 73 |
| 891 | } | - |
| | |