aboutsummaryrefslogtreecommitdiffstats
path: root/src/fseccomp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fseccomp')
-rw-r--r--src/fseccomp/seccomp.c2
-rw-r--r--src/fseccomp/seccomp_print.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/src/fseccomp/seccomp.c b/src/fseccomp/seccomp.c
index ef7dd5c54..028cd76a9 100644
--- a/src/fseccomp/seccomp.c
+++ b/src/fseccomp/seccomp.c
@@ -165,7 +165,7 @@ void seccomp_default_drop(const char *fname1, const char *fname2, char *list, in
165 165
166void seccomp_keep(const char *fname1, const char *fname2, char *list) { 166void seccomp_keep(const char *fname1, const char *fname2, char *list) {
167 (void) fname2; 167 (void) fname2;
168 168
169 // open file for pre-exec filter 169 // open file for pre-exec filter
170 int fd = open(fname1, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); 170 int fd = open(fname1, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
171 if (fd < 0) { 171 if (fd < 0) {
diff --git a/src/fseccomp/seccomp_print.c b/src/fseccomp/seccomp_print.c
index e8df2bda5..ffc65e7c3 100644
--- a/src/fseccomp/seccomp_print.c
+++ b/src/fseccomp/seccomp_print.c
@@ -68,7 +68,7 @@ static int detect_filter_type(void) {
68 assert(filter); 68 assert(filter);
69 69
70 printf("SECCOMP Filter\n"); 70 printf("SECCOMP Filter\n");
71 71
72 // testing for main seccomp filter, protocol, mdwe - platform architecture 72 // testing for main seccomp filter, protocol, mdwe - platform architecture
73 const struct sock_filter start_main[] = { 73 const struct sock_filter start_main[] = {
74 VALIDATE_ARCHITECTURE, 74 VALIDATE_ARCHITECTURE,
@@ -79,7 +79,7 @@ static int detect_filter_type(void) {
79 EXAMINE_SYSCALL 79 EXAMINE_SYSCALL
80#endif 80#endif
81 }; 81 };
82 82
83 if (memcmp(&start_main[0], filter, sizeof(start_main)) == 0) { 83 if (memcmp(&start_main[0], filter, sizeof(start_main)) == 0) {
84 printf(" VALIDATE_ARCHITECTURE\n"); 84 printf(" VALIDATE_ARCHITECTURE\n");
85 printf(" EXAMINE_SYSCALL\n"); 85 printf(" EXAMINE_SYSCALL\n");
@@ -88,26 +88,26 @@ static int detect_filter_type(void) {
88#endif 88#endif
89 return sizeof(start_main) / sizeof(struct sock_filter); 89 return sizeof(start_main) / sizeof(struct sock_filter);
90 } 90 }
91 91
92 92
93 // testing for secondary 64 bit filter 93 // testing for secondary 64 bit filter
94 const struct sock_filter start_secondary_64[] = { 94 const struct sock_filter start_secondary_64[] = {
95 VALIDATE_ARCHITECTURE_64, 95 VALIDATE_ARCHITECTURE_64,
96 EXAMINE_SYSCALL, 96 EXAMINE_SYSCALL,
97 }; 97 };
98 98
99 if (memcmp(&start_secondary_64[0], filter, sizeof(start_secondary_64)) == 0) { 99 if (memcmp(&start_secondary_64[0], filter, sizeof(start_secondary_64)) == 0) {
100 printf(" VALIDATE_ARCHITECTURE_64\n"); 100 printf(" VALIDATE_ARCHITECTURE_64\n");
101 printf(" EXAMINE_SYSCALL\n"); 101 printf(" EXAMINE_SYSCALL\n");
102 return sizeof(start_secondary_64) / sizeof(struct sock_filter); 102 return sizeof(start_secondary_64) / sizeof(struct sock_filter);
103 } 103 }
104 104
105 // testing for secondary 32 bit filter 105 // testing for secondary 32 bit filter
106 const struct sock_filter start_secondary_32[] = { 106 const struct sock_filter start_secondary_32[] = {
107 VALIDATE_ARCHITECTURE_32, 107 VALIDATE_ARCHITECTURE_32,
108 EXAMINE_SYSCALL, 108 EXAMINE_SYSCALL,
109 }; 109 };
110 110
111 if (memcmp(&start_secondary_32[0], filter, sizeof(start_secondary_32)) == 0) { 111 if (memcmp(&start_secondary_32[0], filter, sizeof(start_secondary_32)) == 0) {
112 printf(" VALIDATE_ARCHITECTURE_32\n"); 112 printf(" VALIDATE_ARCHITECTURE_32\n");
113 printf(" EXAMINE_SYSCALL\n"); 113 printf(" EXAMINE_SYSCALL\n");
@@ -132,7 +132,7 @@ static int detect_filter_type(void) {
132#endif 132#endif
133 return sizeof(start_secondary_block) / sizeof(struct sock_filter); 133 return sizeof(start_secondary_block) / sizeof(struct sock_filter);
134 } 134 }
135 135
136 return 0; // filter unrecognized 136 return 0; // filter unrecognized
137} 137}
138 138
@@ -146,7 +146,7 @@ void filter_print(const char *fname) {
146 printf("Invalid seccomp filter %s\n", fname); 146 printf("Invalid seccomp filter %s\n", fname);
147 return; 147 return;
148 } 148 }
149 149
150 // loop trough the rest of commands 150 // loop trough the rest of commands
151 while (i < filter_cnt) { 151 while (i < filter_cnt) {
152 // minimal parsing! 152 // minimal parsing!