mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
Improve errExit error messages
Changes:
* Move msg to the end of errExit (right before perror(3p))
* Include the full file path (within the repository)
* Add "()" to function name for clarity
Before:
Error malloc: main.c:123 main: Cannot allocate memory
After:
Error src/firejail/main.c:123 main(): malloc: Cannot allocate memory
Note: This clarifies which is the exact file that the error message
comes from, as there are many source files with the same name. For
example:
$ git ls-files 'src/*/main.c' | wc -l
20
This commit is contained in:
parent
e06c3e99d8
commit
b963fe41ae
28 changed files with 29 additions and 3 deletions
|
|
@ -83,7 +83,7 @@ LDFLAGS=@LDFLAGS@
|
|||
# Project variables
|
||||
EXTRA_CFLAGS =@EXTRA_CFLAGS@
|
||||
COMMON_CFLAGS = \
|
||||
-ggdb -O2 -DVERSION='"$(VERSION)"' \
|
||||
-ggdb -O2 -DVERSION='"$(VERSION)"' -DMOD_DIR='"$(MOD_DIR)"' \
|
||||
-Wall -Wextra $(HAVE_FATAL_WARNINGS) \
|
||||
-Wformat -Wformat-security \
|
||||
-fstack-protector-all -D_FORTIFY_SOURCE=2 \
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/etc-cleanup
|
||||
PROG = etc-cleanup
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fbuilder
|
||||
PROG = fbuilder
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fcopy
|
||||
PROG = fcopy
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fids
|
||||
PROG = fids
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/firecfg
|
||||
PROG = firecfg
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/firejail
|
||||
PROG = firejail
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/firemon
|
||||
PROG = firemon
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fldd
|
||||
PROG = fldd
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fnet
|
||||
PROG = fnet
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fnetfilter
|
||||
PROG = fnetfilter
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fnettrace-dns
|
||||
PROG = fnettrace-dns
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fnettrace-icmp
|
||||
PROG = fnettrace-icmp
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fnettrace-sni
|
||||
PROG = fnettrace-sni
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fnettrace
|
||||
PROG = fnettrace
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fsec-optimize
|
||||
PROG = fsec-optimize
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fsec-print
|
||||
PROG = fsec-print
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fseccomp
|
||||
PROG = fseccomp
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/ftee
|
||||
PROG = ftee
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/fzenity
|
||||
PROG = fzenity
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@
|
|||
|
||||
#define errExit(msg) do { \
|
||||
char msgout[500]; \
|
||||
snprintf(msgout, 500, "Error %s: %s:%d %s", msg, __FILE__, __LINE__, __func__); \
|
||||
snprintf(msgout, 500, "Error %s/%s:%d %s(): %s", \
|
||||
MOD_DIR, __FILE__, __LINE__, __func__, msg); \
|
||||
perror(msgout); \
|
||||
exit(1); \
|
||||
} while (0)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/jailcheck
|
||||
PROG = jailcheck
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/lib
|
||||
TARGET = lib
|
||||
|
||||
include $(ROOT)/src/prog.mk
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/libpostexecseccomp
|
||||
SO = libpostexecseccomp.so
|
||||
TARGET = $(SO)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/libtrace
|
||||
SO = libtrace.so
|
||||
TARGET = $(SO)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/libtracelog
|
||||
SO = libtracelog.so
|
||||
TARGET = $(SO)
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
ROOT = ../..
|
||||
-include $(ROOT)/config.mk
|
||||
|
||||
MOD_DIR = src/profstats
|
||||
PROG = profstats
|
||||
TARGET = $(PROG)
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ after 100
|
|||
send -- "firejail --appimage appimage.sh\r"
|
||||
expect {
|
||||
timeout {puts "TESTING ERROR 2\n";exit}
|
||||
"Error mounting appimage"
|
||||
-re "Error .*mounting appimage"
|
||||
}
|
||||
after 100
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue