summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/firejail/appimage_size.c5
-rw-r--r--src/firejail/sbox.c8
-rw-r--r--src/fnet/main.c6
3 files changed, 9 insertions, 10 deletions
diff --git a/src/firejail/appimage_size.c b/src/firejail/appimage_size.c
index 64fff6901..3f5c3150c 100644
--- a/src/firejail/appimage_size.c
+++ b/src/firejail/appimage_size.c
@@ -41,7 +41,6 @@ e_shoff + ( e_shentsize * e_shnum ) = 126584
41typedef Elf32_Nhdr Elf_Nhdr; 41typedef Elf32_Nhdr Elf_Nhdr;
42 42
43static Elf64_Ehdr ehdr; 43static Elf64_Ehdr ehdr;
44static Elf64_Phdr *phdr;
45 44
46#if __BYTE_ORDER == __LITTLE_ENDIAN 45#if __BYTE_ORDER == __LITTLE_ENDIAN
47#define ELFDATANATIVE ELFDATA2LSB 46#define ELFDATANATIVE ELFDATA2LSB
@@ -75,7 +74,7 @@ static uint64_t file64_to_cpu(uint64_t val) {
75// return 0 if error 74// return 0 if error
76static long unsigned int read_elf32(int fd) { 75static long unsigned int read_elf32(int fd) {
77 Elf32_Ehdr ehdr32; 76 Elf32_Ehdr ehdr32;
78 ssize_t ret, i; 77 ssize_t ret;
79 78
80 ret = pread(fd, &ehdr32, sizeof(ehdr32), 0); 79 ret = pread(fd, &ehdr32, sizeof(ehdr32), 0);
81 if (ret < 0 || (size_t)ret != sizeof(ehdr)) 80 if (ret < 0 || (size_t)ret != sizeof(ehdr))
@@ -92,7 +91,7 @@ static long unsigned int read_elf32(int fd) {
92// return 0 if error 91// return 0 if error
93static long unsigned int read_elf64(int fd) { 92static long unsigned int read_elf64(int fd) {
94 Elf64_Ehdr ehdr64; 93 Elf64_Ehdr ehdr64;
95 ssize_t ret, i; 94 ssize_t ret;
96 95
97 ret = pread(fd, &ehdr64, sizeof(ehdr64), 0); 96 ret = pread(fd, &ehdr64, sizeof(ehdr64), 0);
98 if (ret < 0 || (size_t)ret != sizeof(ehdr)) 97 if (ret < 0 || (size_t)ret != sizeof(ehdr))
diff --git a/src/firejail/sbox.c b/src/firejail/sbox.c
index d3ef2578c..d1225c3bc 100644
--- a/src/firejail/sbox.c
+++ b/src/firejail/sbox.c
@@ -23,6 +23,7 @@
23#include <unistd.h> 23#include <unistd.h>
24#include <net/if.h> 24#include <net/if.h>
25#include <stdarg.h> 25#include <stdarg.h>
26 #include <sys/wait.h>
26#include "../include/seccomp.h" 27#include "../include/seccomp.h"
27 28
28static struct sock_filter filter[] = { 29static struct sock_filter filter[] = {
@@ -112,7 +113,7 @@ typedef struct sbox_config {
112 113
113int sbox_run(unsigned filter, int num, ...) { 114int sbox_run(unsigned filter, int num, ...) {
114 EUID_ROOT(); 115 EUID_ROOT();
115 char *path = NULL; 116
116 int i; 117 int i;
117 va_list valist; 118 va_list valist;
118 va_start(valist, num); 119 va_start(valist, num);
@@ -159,7 +160,10 @@ printf("\n");
159 else if (filter & SBOX_USER) 160 else if (filter & SBOX_USER)
160 drop_privs(1); 161 drop_privs(1);
161 162
162 execvp(arg[0], arg); 163 if (arg[0]) // get rid of scan-build warning
164 execvp(arg[0], arg);
165 else
166 assert(0);
163 perror("execl"); 167 perror("execl");
164 _exit(1); 168 _exit(1);
165 } 169 }
diff --git a/src/fnet/main.c b/src/fnet/main.c
index 88f71c4b3..f17287cb9 100644
--- a/src/fnet/main.c
+++ b/src/fnet/main.c
@@ -17,11 +17,7 @@
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#include <stdio.h> 20#include "fnet.h"
21#include <stdlib.h>
22#include <errno.h>
23#include <sys/prctl.h>
24#include <linux/capability.h>
25 21
26static void usage(void) { 22static void usage(void) {
27 printf("Usage:\n"); 23 printf("Usage:\n");