Housekeeping

Make sure all files end with a newline
Strip extra newlines and trailing whitespace from files
This commit is contained in:
Fred-Barclay 2019-02-17 17:04:02 -06:00
parent 222d8977e1
commit 6181f75e3f
No known key found for this signature in database
GPG key ID: 7338CE369A928102
28 changed files with 18 additions and 43 deletions

1
.gitignore vendored
View file

@ -40,4 +40,3 @@ seccomp.64
seccomp.block_secondary
seccomp.mdwx
src/common.mk

View file

@ -32,4 +32,3 @@ CFLAGS += -ggdb $(HAVE_FATAL_WARNINGS) -O2 -DVERSION='"$(VERSION)"' $(HAVE_GCOV
LDFLAGS += -pie -Wl,-z,relro -Wl,-z,now -lpthread
EXTRA_LDFLAGS +=@EXTRA_LDFLAGS@
EXTRA_CFLAGS +=@EXTRA_CFLAGS@

View file

@ -314,4 +314,3 @@ void build_dev(const char *fname, FILE *fp) {
fprintf(fp, "\n");
}
}

View file

@ -189,4 +189,3 @@ void build_protocol(const char *fname, FILE *fp) {
fprintf(fp, "netfilter\n");
}
}

View file

@ -67,4 +67,4 @@ FileDB *filedb_add(FileDB *head, const char *fname);
FileDB *filedb_find(FileDB *head, const char *fname);
void filedb_print(FileDB *head, const char *prefix, FILE *fp);
#endif
#endif

View file

@ -76,4 +76,3 @@ void filedb_print(FileDB *head, const char *prefix, FILE *fp) {
ptr = ptr->next;
}
}

View file

@ -322,5 +322,3 @@ void fix_desktop_files(char *homedir) {
closedir(dir);
free(user_apps_dir);
}

View file

@ -48,4 +48,3 @@ void sound(void);
// desktop_files.c
void fix_desktop_files(char *homedir);

View file

@ -65,4 +65,3 @@ errexit:
fprintf(stderr, "Error: cannot configure sound file\n");
exit(1);
}

View file

@ -308,8 +308,3 @@ void fslib_install_system(void) {
ptr++;
}
}

View file

@ -378,4 +378,4 @@ void net_print(pid_t pid) {
enter_network_namespace(pid);
sbox_run(SBOX_ROOT | SBOX_CAPS_NETWORK | SBOX_SECCOMP, 2, PATH_FNET_MAIN, "printif");
}
}

View file

@ -189,4 +189,3 @@ void preproc_clean_run(void) {
free(pidarr);
}

View file

@ -63,7 +63,7 @@ void shut(pid_t pid) {
while (monsec) {
sleep(1);
monsec--;
FILE *fp = fopen(monfile, "r");
if (!fp) {
killdone = 1;

View file

@ -27,4 +27,4 @@
struct sock_filter *duplicate(struct sock_filter *filter, int entries);
int optimize(struct sock_filter * filter, int entries);
#endif
#endif

View file

@ -133,4 +133,3 @@ struct sock_filter *duplicate(struct sock_filter *filter, int entries) {
memcpy(rv, filter, len);
return rv;
}

View file

@ -29,4 +29,4 @@ void print(struct sock_filter *filter, int entries);
// syscall_list.c
const char *syscall_find_nr(int nr);
#endif
#endif

View file

@ -330,4 +330,3 @@ void print(struct sock_filter *filter, int entries) {
printf("\n");
}
}

View file

@ -43,4 +43,4 @@ int is_lib_64(const char *exe);
#endif
#endif

View file

@ -19,4 +19,3 @@ for app in $LIST; do
echo "TESTING SKIP: $app not found"
fi
done

View file

@ -20,7 +20,7 @@ int main(int argc, char **argv) {
usage();
return 1;
}
if (strcmp(argv[1], "mmap") == 0) {
// open some file
int fd = open("memwrexe.c", O_RDONLY);
@ -28,13 +28,13 @@ int main(int argc, char **argv) {
fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
return 1;
}
int size = lseek(fd, 0, SEEK_END);
if (size == -1) {
fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
return 1;
}
void *p = mmap (0, size, PROT_WRITE|PROT_READ|PROT_EXEC, MAP_SHARED, fd, 0);
printf("mmap successful\n");
@ -51,19 +51,19 @@ int main(int argc, char **argv) {
fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
return 1;
}
int size = lseek(fd, 0, SEEK_END);
if (size == -1) {
fprintf(stderr, "TESTING ERROR: file not found, cannot run mmap test\n");
return 1;
}
void *p = mmap (0, size, PROT_READ, MAP_SHARED, fd, 0);
if (!p) {
fprintf(stderr, "TESTING ERROR: cannot map file for mprotect test\n");
return 1;
}
mprotect(p, size, PROT_READ|PROT_WRITE|PROT_EXEC);
printf("mprotect successful\n");
@ -73,4 +73,3 @@ int main(int argc, char **argv) {
return 0;
}
}

View file

@ -16,4 +16,3 @@
-A OUTPUT -p tcp --dport 3478 -j DROP
-A OUTPUT -p tcp --dport 3479 -j DROP
COMMIT

View file

@ -9,11 +9,10 @@
#-A INPUT -p icmp --$ARG1 echo-reply -j ACCEPT
-A INPUT -p icmp --$ARG1 $ARG2 -j ACCEPT
-A INPUT -p icmp --$ARG1 $ARG3 -j ACCEPT
-A INPUT -p icmp --$ARG1 $ARG4 -j ACCEPT
-A INPUT -p icmp --$ARG1 $ARG4 -j ACCEPT
# disable STUN
-A OUTPUT -p udp --dport $ARG5 -j DROP
-A OUTPUT -p udp --dport $ARG6 -j DROP
-A OUTPUT -p tcp --dport $ARG5 -j DROP
-A OUTPUT -p tcp --dport $ARG6 -j DROP
COMMIT

View file

@ -23,5 +23,3 @@ $ cat /proc/mounts | grep proc
proc /proc proc rw,nosuid,nodev,noexec,relatime,gid=618,hidepid=2 0 0
3. Test "firejail --list", "firejail --top", "firejail --tree", "firejail --netstats"

View file

@ -35,7 +35,7 @@ int main(int argc, char **argv) {
return 1;
}
int portno = atoi(argv[1]);
// init socket
fd = socket(AF_INET, SOCK_STREAM, 0);
if (fd < 0) {
@ -82,7 +82,7 @@ int main(int argc, char **argv) {
if (pid == 0) {
// child
close(fd);
#define MAXBUF 4096
#define MAXBUF 4096
char buf[MAXBUF];
memset(buf, 0, MAXBUF);
@ -103,6 +103,6 @@ int main(int argc, char **argv) {
else
close(newfd);
}
return 0;
}

View file

@ -43,4 +43,3 @@ do
echo "TESTING: $PROFILE"
./test-profile.exp $PROFILE
done

View file

@ -1 +1 @@
include test3.profile
include test3.profile

View file

@ -37,4 +37,3 @@ after 100
puts "\nall done\n"

View file

@ -1 +1 @@
caps.keep chown,kill
caps.keep chown,kill