Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | #include <config.h> | - |
20 | | - |
21 | #include <selinux/selinux.h> | - |
22 | | - |
23 | #include <sys/types.h> | - |
24 | #include <errno.h> | - |
25 | #include <string.h> | - |
26 | | - |
27 | | - |
28 | | - |
29 | #ifndef ENODATA | - |
30 | # define ENODATA ENOTSUP | - |
31 | #endif | - |
32 | | - |
33 | #undef getfilecon | - |
34 | #undef lgetfilecon | - |
35 | #undef fgetfilecon | - |
36 | int getfilecon (char const *file, security_context_t *con); | - |
37 | int lgetfilecon (char const *file, security_context_t *con); | - |
38 | int fgetfilecon (int fd, security_context_t *con); | - |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | static int | - |
49 | map_to_failure (int ret, security_context_t *con) | - |
50 | { | - |
51 | if (ret == 0)TRUE | never evaluated | FALSE | evaluated 160 times by 2 tests |
| 0-160 |
52 | { | - |
53 | errno = ENOTSUP; | - |
54 | return -1; never executed: return -1; | 0 |
55 | } | - |
56 | | - |
57 | if (ret == 10 && strcmp (*con, "unlabeled") == 0) never executed: __result = (((const unsigned char *) (const char *) ( *con ))[3] - __s2[3]); never executed: end of block never executed: end of block never executed: __result = (((const unsigned char *) (const char *) ( "unlabeled" ))[3] - __s2[3]); never executed: end of block never executed: end of block TRUE | never evaluated | FALSE | evaluated 160 times by 2 tests |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0-160 |
58 | { | - |
59 | freecon (*con); | - |
60 | *con = NULL; | - |
61 | errno = ENODATA; | - |
62 | return -1; never executed: return -1; | 0 |
63 | } | - |
64 | | - |
65 | return ret;executed 160 times by 2 tests: return ret; | 160 |
66 | } | - |
67 | | - |
68 | int | - |
69 | rpl_getfilecon (char const *file, security_context_t *con) | - |
70 | { | - |
71 | int ret = getfilecon (file, con); | - |
72 | return map_to_failure (ret, con); never executed: return map_to_failure (ret, con); | 0 |
73 | } | - |
74 | | - |
75 | int | - |
76 | rpl_lgetfilecon (char const *file, security_context_t *con) | - |
77 | { | - |
78 | int ret = lgetfilecon (file, con); | - |
79 | return map_to_failure (ret, con);executed 160 times by 2 tests: return map_to_failure (ret, con); | 160 |
80 | } | - |
81 | | - |
82 | int | - |
83 | rpl_fgetfilecon (int fd, security_context_t *con) | - |
84 | { | - |
85 | int ret = fgetfilecon (fd, con); | - |
86 | return map_to_failure (ret, con); never executed: return map_to_failure (ret, con); | 0 |
87 | } | - |
| | |