Skip to content

Commit

Permalink
llvm scan
Browse files Browse the repository at this point in the history
  • Loading branch information
netblue30 committed Nov 29, 2015
1 parent 5061532 commit 4e22add
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,9 @@ deb: dist
extras: all
$(MAKE) -C extras/firetools

cppcheck: clean
cppcheck --force .

scan-build: clean
scan-build make

1 change: 1 addition & 0 deletions src/firejail/fs_logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void fs_logger_print(void) {
}

int rv = chown(RUN_FSLOGGER_FILE, getuid(), getgid());
(void) rv; // best effort!
rv = chmod(RUN_FSLOGGER_FILE, 0600);
(void) rv; // best effort!

Expand Down
4 changes: 3 additions & 1 deletion src/firejail/fs_whitelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,10 @@ void fs_whitelist(void) {
// mark symbolic links
if (is_link(new_name))
entry->link = new_name;
else
else {
free(new_name);
new_name = NULL;
}

// change file name in entry->data
if (strcmp(fname, entry->data + 10) != 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/firejail/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ void net_set_mtu(const char *ifname, int mtu) {
ifr.ifr_addr.sa_family = AF_INET;
strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
ifr.ifr_mtu = mtu;
if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) == 0)
mtu = ifr.ifr_mtu;
if (ioctl(s, SIOCSIFMTU, (caddr_t)&ifr) != 0)
fprintf(stderr, "Warning: cannot set mtu for interface %s\n", ifname);
close(s);
}

Expand Down
4 changes: 2 additions & 2 deletions src/libtrace/libtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,9 @@ int socket(int domain, int type, int protocol) {

str = translate(socket_protocol, protocol);
if (str == NULL)
ptr += sprintf(ptr, "%d", protocol);
sprintf(ptr, "%d", protocol);
else
ptr += sprintf(ptr, "%s", str);
sprintf(ptr, "%s", str);

printf("%s\n", buf);
return rv;
Expand Down
2 changes: 1 addition & 1 deletion todo
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ I was messing around with my fstab, and found out that firejail can't have /usr/
/dev/mapper/asdf-usr--local /usr/local ext4 defaults,nosuid,noatime,ro 0 2
/dev/mapper/asdf-usr--sbin /usr/sbin ext4 defaults,nosuid,,noatime,ro 0 2
/dev/mapper/asdf-var /var ext4 discard,noatime,nodev,nosuid 0 2
tmpfs /tmp tmpfs noatime,nosuid,nodev,size=2G 0 1
tmpfs /tmp tmpfs noatime,nosuid,nodev,size=2G 0 1

0 comments on commit 4e22add

Please sign in to comment.