aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-02-19 17:57:48 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-02-20 18:02:37 -0300
commitab1f8af8d0ac1ff8466d8758dc11d06dbfe8df25 (patch)
tree7ff503cf1ad951be3c2dc88caea1f4e1d6c70699
parent*.sh: use consistent indentation (diff)
downloadfirejail-ab1f8af8d0ac1ff8466d8758dc11d06dbfe8df25.tar.gz
firejail-ab1f8af8d0ac1ff8466d8758dc11d06dbfe8df25.tar.zst
firejail-ab1f8af8d0ac1ff8466d8758dc11d06dbfe8df25.zip
Fix inconsistent leading spaces
Changes: * Fix spaces being used for indentation in some lines in C * Remove leading spaces before some goto labels * Remove leading spaces before the start of some multiline comments * Change leading spaces to tabs in some multiline macros * Add missing asterisk to some multiline comments (to match other multiline comments and because they are false positives in the commands below) Note: Leading spaces can be used for alignment (such as in function parameters and function arguments in C) and for line continuation (such as in long commands in shell scripts). However, in the above changes the leading spaces are used for other reasons and do not seem to fit with the style used. Commands used to search for errors: $ git grep -In '^ [^*]' | grep -E -v \ -e '(COPYING|README|RELNOTES|configure(.ac)?):' \ -e '^[^:]+.(md|yml|py):' -e '(bash|zsh)_completion/' \ -e '^contrib/syntax/' -e '^etc/templates/.*\.txt:' -e '^m4/' \ -e '^platform/debian/' -e '^src/man/.*\.txt:' \ -e '.*mkrpm.sh:' -e '.*extract_errnos.sh:'
-rw-r--r--src/fbuilder/main.c2
-rw-r--r--src/fcopy/main.c2
-rw-r--r--src/firejail/appimage_size.c3
-rw-r--r--src/firejail/dbus.c2
-rw-r--r--src/firejail/firejail.h2
-rw-r--r--src/firejail/main.c4
-rw-r--r--src/firejail/selinux.c2
-rw-r--r--src/fldd/main.c6
-rw-r--r--src/fnet/fnet.h2
-rw-r--r--src/fnet/interface.c2
-rw-r--r--src/fnet/main.c10
-rw-r--r--src/fnet/veth.c4
-rw-r--r--src/fnetfilter/main.c2
-rw-r--r--src/fsec-optimize/main.c2
-rw-r--r--src/fsec-print/main.c2
-rw-r--r--src/fseccomp/main.c2
-rw-r--r--src/include/gcov_wrapper.h4
-rw-r--r--src/include/seccomp.h24
-rw-r--r--src/libtrace/libtrace.c10
-rw-r--r--src/profstats/main.c2
20 files changed, 45 insertions, 44 deletions
diff --git a/src/fbuilder/main.c b/src/fbuilder/main.c
index ebb273f12..7fdf9af68 100644
--- a/src/fbuilder/main.c
+++ b/src/fbuilder/main.c
@@ -32,7 +32,7 @@ int main(int argc, char **argv) {
32system("cat /proc/self/status"); 32system("cat /proc/self/status");
33int i; 33int i;
34for (i = 0; i < argc; i++) 34for (i = 0; i < argc; i++)
35 printf("*%s* ", argv[i]); 35 printf("*%s* ", argv[i]);
36printf("\n"); 36printf("\n");
37} 37}
38#endif 38#endif
diff --git a/src/fcopy/main.c b/src/fcopy/main.c
index da24fb3f7..ce2efb295 100644
--- a/src/fcopy/main.c
+++ b/src/fcopy/main.c
@@ -92,7 +92,7 @@ static void selinux_relabel_path(const char *path, const char *inside_path) {
92 printf("Cannot relabel %s: %s\n", path, strerror(errno)); 92 printf("Cannot relabel %s: %s\n", path, strerror(errno));
93 } 93 }
94 freecon(fcon); 94 freecon(fcon);
95 close: 95close:
96 close(fd); 96 close(fd);
97#else 97#else
98 (void) path; 98 (void) path;
diff --git a/src/firejail/appimage_size.c b/src/firejail/appimage_size.c
index c3f1620bc..60c4c0364 100644
--- a/src/firejail/appimage_size.c
+++ b/src/firejail/appimage_size.c
@@ -17,8 +17,9 @@
17 * with this program; if not, write to the Free Software Foundation, Inc., 17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */ 19 */
20
20/* 21/*
21 This code borrows heavily from src/libappimage_shared/elf.c in libappimage 22 * This code borrows heavily from src/libappimage_shared/elf.c in libappimage
22 */ 23 */
23/* 24/*
24Compile with: 25Compile with:
diff --git a/src/firejail/dbus.c b/src/firejail/dbus.c
index a41071305..b2f9fe2d2 100644
--- a/src/firejail/dbus.c
+++ b/src/firejail/dbus.c
@@ -263,7 +263,7 @@ static char *find_user_socket_by_format(char *format) {
263 if (!S_ISSOCK(s.st_mode)) 263 if (!S_ISSOCK(s.st_mode))
264 goto fail; 264 goto fail;
265 return dbus_user_socket; 265 return dbus_user_socket;
266 fail: 266fail:
267 free(dbus_user_socket); 267 free(dbus_user_socket);
268 return NULL; 268 return NULL;
269} 269}
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h
index 30c1b441c..824164c8a 100644
--- a/src/firejail/firejail.h
+++ b/src/firejail/firejail.h
@@ -266,7 +266,7 @@ static inline int any_ip6_dhcp(void) {
266} 266}
267 267
268static inline int any_dhcp(void) { 268static inline int any_dhcp(void) {
269 return any_ip_dhcp() || any_ip6_dhcp(); 269 return any_ip_dhcp() || any_ip6_dhcp();
270} 270}
271 271
272extern int arg_private; // mount private /home 272extern int arg_private; // mount private /home
diff --git a/src/firejail/main.c b/src/firejail/main.c
index ed31efb6c..9bd65dda5 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -47,8 +47,8 @@
47#endif 47#endif
48 48
49#ifdef __ia64__ 49#ifdef __ia64__
50/* clone(2) has a different interface on ia64, as it needs to know 50/* clone(2) has a different interface on ia64, as it needs to know the size of
51 the size of the stack */ 51 * the stack */
52int __clone2(int (*fn)(void *), 52int __clone2(int (*fn)(void *),
53 void *child_stack_base, size_t stack_size, 53 void *child_stack_base, size_t stack_size,
54 int flags, void *arg, ... 54 int flags, void *arg, ...
diff --git a/src/firejail/selinux.c b/src/firejail/selinux.c
index 5beda294d..08f3b3122 100644
--- a/src/firejail/selinux.c
+++ b/src/firejail/selinux.c
@@ -78,7 +78,7 @@ void selinux_relabel_path(const char *path, const char *inside_path)
78 } 78 }
79 79
80 freecon(fcon); 80 freecon(fcon);
81 close: 81close:
82 close(fd); 82 close(fd);
83#else 83#else
84 (void) path; 84 (void) path;
diff --git a/src/fldd/main.c b/src/fldd/main.c
index 390f7a1bc..4b645b1b3 100644
--- a/src/fldd/main.c
+++ b/src/fldd/main.c
@@ -193,9 +193,9 @@ static void parse_elf(const char *exe) {
193 } 193 }
194 goto close; 194 goto close;
195 195
196 error_close: 196error_close:
197 perror("copy libs"); 197 perror("copy libs");
198 close: 198close:
199 if (base) 199 if (base)
200 munmap(base, s.st_size); 200 munmap(base, s.st_size);
201 201
@@ -295,7 +295,7 @@ int main(int argc, char **argv) {
295//system("cat /proc/self/status"); 295//system("cat /proc/self/status");
296int i; 296int i;
297for (i = 0; i < argc; i++) 297for (i = 0; i < argc; i++)
298 printf("*%s* ", argv[i]); 298 printf("*%s* ", argv[i]);
299printf("\n"); 299printf("\n");
300} 300}
301#endif 301#endif
diff --git a/src/fnet/fnet.h b/src/fnet/fnet.h
index c9d40ec1d..f9b09d7ea 100644
--- a/src/fnet/fnet.h
+++ b/src/fnet/fnet.h
@@ -1,4 +1,4 @@
1 /* 1/*
2 * Copyright (C) 2014-2023 Firejail Authors 2 * Copyright (C) 2014-2023 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
diff --git a/src/fnet/interface.c b/src/fnet/interface.c
index 873252d40..ca7c744ed 100644
--- a/src/fnet/interface.c
+++ b/src/fnet/interface.c
@@ -1,4 +1,4 @@
1 /* 1/*
2 * Copyright (C) 2014-2023 Firejail Authors 2 * Copyright (C) 2014-2023 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
diff --git a/src/fnet/main.c b/src/fnet/main.c
index 1c48622a0..96c4f1478 100644
--- a/src/fnet/main.c
+++ b/src/fnet/main.c
@@ -1,4 +1,4 @@
1 /* 1/*
2 * Copyright (C) 2014-2023 Firejail Authors 2 * Copyright (C) 2014-2023 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
@@ -47,7 +47,7 @@ static void usage(void) {
47 printf("\tfnet config mac addr\n"); 47 printf("\tfnet config mac addr\n");
48 printf("\tfnet config ipv6 dev ip\n"); 48 printf("\tfnet config ipv6 dev ip\n");
49 printf("\tfnet ifup dev\n"); 49 printf("\tfnet ifup dev\n");
50 printf("\tfnet waitll dev\n"); 50 printf("\tfnet waitll dev\n");
51} 51}
52 52
53int main(int argc, char **argv) { 53int main(int argc, char **argv) {
@@ -144,9 +144,9 @@ printf("\n");
144 else if (argc == 5 && strcmp(argv[1], "config") == 0 && strcmp(argv[2], "ipv6") == 0) { 144 else if (argc == 5 && strcmp(argv[1], "config") == 0 && strcmp(argv[2], "ipv6") == 0) {
145 net_if_ip6(argv[3], argv[4]); 145 net_if_ip6(argv[3], argv[4]);
146 } 146 }
147 else if (argc == 3 && strcmp(argv[1], "waitll") == 0) { 147 else if (argc == 3 && strcmp(argv[1], "waitll") == 0) {
148 net_if_waitll(argv[2]); 148 net_if_waitll(argv[2]);
149 } 149 }
150 else { 150 else {
151 fprintf(stderr, "Error fnet: invalid arguments\n"); 151 fprintf(stderr, "Error fnet: invalid arguments\n");
152 return 1; 152 return 1;
diff --git a/src/fnet/veth.c b/src/fnet/veth.c
index 2a23c6bd4..2111cfa56 100644
--- a/src/fnet/veth.c
+++ b/src/fnet/veth.c
@@ -24,8 +24,8 @@
24 * 24 *
25 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> 25 * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
26 * 26 *
27 */ 27*/
28 /* 28/*
29 * Copyright (C) 2014-2023 Firejail Authors 29 * Copyright (C) 2014-2023 Firejail Authors
30 * 30 *
31 * This file is part of firejail project 31 * This file is part of firejail project
diff --git a/src/fnetfilter/main.c b/src/fnetfilter/main.c
index 978d145b3..8c0f6c297 100644
--- a/src/fnetfilter/main.c
+++ b/src/fnetfilter/main.c
@@ -1,4 +1,4 @@
1 /* 1/*
2 * Copyright (C) 2014-2023 Firejail Authors 2 * Copyright (C) 2014-2023 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project
diff --git a/src/fsec-optimize/main.c b/src/fsec-optimize/main.c
index 0a9b7c9b9..0bc521c0d 100644
--- a/src/fsec-optimize/main.c
+++ b/src/fsec-optimize/main.c
@@ -33,7 +33,7 @@ int main(int argc, char **argv) {
33//system("cat /proc/self/status"); 33//system("cat /proc/self/status");
34int i; 34int i;
35for (i = 0; i < argc; i++) 35for (i = 0; i < argc; i++)
36 printf("*%s* ", argv[i]); 36 printf("*%s* ", argv[i]);
37printf("\n"); 37printf("\n");
38} 38}
39#endif 39#endif
diff --git a/src/fsec-print/main.c b/src/fsec-print/main.c
index de93f260e..696c6bc0c 100644
--- a/src/fsec-print/main.c
+++ b/src/fsec-print/main.c
@@ -47,7 +47,7 @@ int main(int argc, char **argv) {
47//system("cat /proc/self/status"); 47//system("cat /proc/self/status");
48int i; 48int i;
49for (i = 0; i < argc; i++) 49for (i = 0; i < argc; i++)
50 printf("*%s* ", argv[i]); 50 printf("*%s* ", argv[i]);
51printf("\n"); 51printf("\n");
52} 52}
53#endif 53#endif
diff --git a/src/fseccomp/main.c b/src/fseccomp/main.c
index 1edbad764..57a5a6d67 100644
--- a/src/fseccomp/main.c
+++ b/src/fseccomp/main.c
@@ -58,7 +58,7 @@ int main(int argc, char **argv) {
58//system("cat /proc/self/status"); 58//system("cat /proc/self/status");
59int i; 59int i;
60for (i = 0; i < argc; i++) 60for (i = 0; i < argc; i++)
61 printf("*%s* ", argv[i]); 61 printf("*%s* ", argv[i]);
62printf("\n"); 62printf("\n");
63} 63}
64#endif 64#endif
diff --git a/src/include/gcov_wrapper.h b/src/include/gcov_wrapper.h
index b56b4e736..7c8f89d59 100644
--- a/src/include/gcov_wrapper.h
+++ b/src/include/gcov_wrapper.h
@@ -33,8 +33,8 @@
33 */ 33 */
34#if __GNUC__ > 11 || (__GNUC__ == 11 && __GNUC_MINOR__ >= 1) 34#if __GNUC__ > 11 || (__GNUC__ == 11 && __GNUC_MINOR__ >= 1)
35static void __gcov_flush(void) { 35static void __gcov_flush(void) {
36 __gcov_dump(); 36 __gcov_dump();
37 __gcov_reset(); 37 __gcov_reset();
38} 38}
39#endif 39#endif
40#else 40#else
diff --git a/src/include/seccomp.h b/src/include/seccomp.h
index ef3fe6c3a..fc07b75ce 100644
--- a/src/include/seccomp.h
+++ b/src/include/seccomp.h
@@ -194,24 +194,24 @@
194#endif 194#endif
195 195
196#define VALIDATE_ARCHITECTURE \ 196#define VALIDATE_ARCHITECTURE \
197 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \ 197 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \
198 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_NR, 1, 0), \ 198 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_NR, 1, 0), \
199 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW) 199 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW)
200 200
201#define VALIDATE_ARCHITECTURE_KILL \ 201#define VALIDATE_ARCHITECTURE_KILL \
202 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \ 202 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \
203 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_NR, 1, 0), \ 203 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_NR, 1, 0), \
204 KILL_OR_RETURN_ERRNO 204 KILL_OR_RETURN_ERRNO
205 205
206#define VALIDATE_ARCHITECTURE_64 \ 206#define VALIDATE_ARCHITECTURE_64 \
207 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \ 207 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \
208 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_64, 1, 0), \ 208 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_64, 1, 0), \
209 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW) 209 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW)
210 210
211#define VALIDATE_ARCHITECTURE_32 \ 211#define VALIDATE_ARCHITECTURE_32 \
212 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \ 212 BPF_STMT(BPF_LD+BPF_W+BPF_ABS, (offsetof(struct seccomp_data, arch))), \
213 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_32, 1, 0), \ 213 BPF_JUMP(BPF_JMP+BPF_JEQ+BPF_K, ARCH_32, 1, 0), \
214 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW) 214 BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_ALLOW)
215 215
216#ifndef X32_SYSCALL_BIT 216#ifndef X32_SYSCALL_BIT
217#define X32_SYSCALL_BIT 0x40000000 217#define X32_SYSCALL_BIT 0x40000000
diff --git a/src/libtrace/libtrace.c b/src/libtrace/libtrace.c
index 231e09882..25f0cc12e 100644
--- a/src/libtrace/libtrace.c
+++ b/src/libtrace/libtrace.c
@@ -35,11 +35,11 @@
35#include "../include/rundefs.h" 35#include "../include/rundefs.h"
36 36
37#define tprintf(fp, args...) \ 37#define tprintf(fp, args...) \
38 do { \ 38 do { \
39 if (!fp)\ 39 if (!fp)\
40 init(); \ 40 init(); \
41 fprintf(fp, args); \ 41 fprintf(fp, args); \
42 } while(0) 42 } while(0)
43 43
44// break recursivity on fopen call 44// break recursivity on fopen call
45typedef FILE *(*orig_fopen_t)(const char *pathname, const char *mode); 45typedef FILE *(*orig_fopen_t)(const char *pathname, const char *mode);
diff --git a/src/profstats/main.c b/src/profstats/main.c
index 491cec736..d5e57e7cc 100644
--- a/src/profstats/main.c
+++ b/src/profstats/main.c
@@ -1,4 +1,4 @@
1 /* 1/*
2 * Copyright (C) 2014-2023 Firejail Authors 2 * Copyright (C) 2014-2023 Firejail Authors
3 * 3 *
4 * This file is part of firejail project 4 * This file is part of firejail project