aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-06-16 15:42:20 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-06-28 04:00:13 -0300
commitb963fe41ae2cd669e5819aded531375ddaebc8b2 (patch)
treea82794efe2b8b925d24a3fd413663cef1e987926 /src
parentcommon.h: use __func__ instead of __FUNCTION__ (diff)
downloadfirejail-b963fe41ae2cd669e5819aded531375ddaebc8b2.tar.gz
firejail-b963fe41ae2cd669e5819aded531375ddaebc8b2.tar.zst
firejail-b963fe41ae2cd669e5819aded531375ddaebc8b2.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/etc-cleanup/Makefile1
-rw-r--r--src/fbuilder/Makefile1
-rw-r--r--src/fcopy/Makefile1
-rw-r--r--src/fids/Makefile1
-rw-r--r--src/firecfg/Makefile1
-rw-r--r--src/firejail/Makefile1
-rw-r--r--src/firemon/Makefile1
-rw-r--r--src/fldd/Makefile1
-rw-r--r--src/fnet/Makefile1
-rw-r--r--src/fnetfilter/Makefile1
-rw-r--r--src/fnettrace-dns/Makefile1
-rw-r--r--src/fnettrace-icmp/Makefile1
-rw-r--r--src/fnettrace-sni/Makefile1
-rw-r--r--src/fnettrace/Makefile1
-rw-r--r--src/fsec-optimize/Makefile1
-rw-r--r--src/fsec-print/Makefile1
-rw-r--r--src/fseccomp/Makefile1
-rw-r--r--src/ftee/Makefile1
-rw-r--r--src/fzenity/Makefile1
-rw-r--r--src/include/common.h3
-rw-r--r--src/jailcheck/Makefile1
-rw-r--r--src/lib/Makefile1
-rw-r--r--src/libpostexecseccomp/Makefile1
-rw-r--r--src/libtrace/Makefile1
-rw-r--r--src/libtracelog/Makefile1
-rw-r--r--src/profstats/Makefile1
26 files changed, 27 insertions, 1 deletions
diff --git a/src/etc-cleanup/Makefile b/src/etc-cleanup/Makefile
index c3c482bdb..296ed41d8 100644
--- a/src/etc-cleanup/Makefile
+++ b/src/etc-cleanup/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/etc-cleanup
5PROG = etc-cleanup 6PROG = etc-cleanup
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fbuilder/Makefile b/src/fbuilder/Makefile
index 634bf725f..1f6a28780 100644
--- a/src/fbuilder/Makefile
+++ b/src/fbuilder/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fbuilder
5PROG = fbuilder 6PROG = fbuilder
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fcopy/Makefile b/src/fcopy/Makefile
index a3c4abe9d..f82d3a073 100644
--- a/src/fcopy/Makefile
+++ b/src/fcopy/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fcopy
5PROG = fcopy 6PROG = fcopy
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fids/Makefile b/src/fids/Makefile
index 76388a03d..c03740e3d 100644
--- a/src/fids/Makefile
+++ b/src/fids/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fids
5PROG = fids 6PROG = fids
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/firecfg/Makefile b/src/firecfg/Makefile
index de4639ab6..322ce3e3f 100644
--- a/src/firecfg/Makefile
+++ b/src/firecfg/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/firecfg
5PROG = firecfg 6PROG = firecfg
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/firejail/Makefile b/src/firejail/Makefile
index d3a4b4f81..a817b1757 100644
--- a/src/firejail/Makefile
+++ b/src/firejail/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/firejail
5PROG = firejail 6PROG = firejail
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/firemon/Makefile b/src/firemon/Makefile
index 09387f3eb..649bad0af 100644
--- a/src/firemon/Makefile
+++ b/src/firemon/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/firemon
5PROG = firemon 6PROG = firemon
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fldd/Makefile b/src/fldd/Makefile
index 7fec70a33..00173d18e 100644
--- a/src/fldd/Makefile
+++ b/src/fldd/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fldd
5PROG = fldd 6PROG = fldd
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fnet/Makefile b/src/fnet/Makefile
index 50bfdfffd..04a200951 100644
--- a/src/fnet/Makefile
+++ b/src/fnet/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fnet
5PROG = fnet 6PROG = fnet
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fnetfilter/Makefile b/src/fnetfilter/Makefile
index 156af3ed0..d38185fb1 100644
--- a/src/fnetfilter/Makefile
+++ b/src/fnetfilter/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fnetfilter
5PROG = fnetfilter 6PROG = fnetfilter
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fnettrace-dns/Makefile b/src/fnettrace-dns/Makefile
index bbd4772e2..fb1054261 100644
--- a/src/fnettrace-dns/Makefile
+++ b/src/fnettrace-dns/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fnettrace-dns
5PROG = fnettrace-dns 6PROG = fnettrace-dns
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fnettrace-icmp/Makefile b/src/fnettrace-icmp/Makefile
index 0d26dc2fc..4791e0b9f 100644
--- a/src/fnettrace-icmp/Makefile
+++ b/src/fnettrace-icmp/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fnettrace-icmp
5PROG = fnettrace-icmp 6PROG = fnettrace-icmp
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fnettrace-sni/Makefile b/src/fnettrace-sni/Makefile
index 554741fc8..09a444db0 100644
--- a/src/fnettrace-sni/Makefile
+++ b/src/fnettrace-sni/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fnettrace-sni
5PROG = fnettrace-sni 6PROG = fnettrace-sni
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fnettrace/Makefile b/src/fnettrace/Makefile
index 94381d299..fe74afda2 100644
--- a/src/fnettrace/Makefile
+++ b/src/fnettrace/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fnettrace
5PROG = fnettrace 6PROG = fnettrace
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fsec-optimize/Makefile b/src/fsec-optimize/Makefile
index 5a14726a0..12ac5f1a9 100644
--- a/src/fsec-optimize/Makefile
+++ b/src/fsec-optimize/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fsec-optimize
5PROG = fsec-optimize 6PROG = fsec-optimize
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fsec-print/Makefile b/src/fsec-print/Makefile
index d55167796..a506c1106 100644
--- a/src/fsec-print/Makefile
+++ b/src/fsec-print/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fsec-print
5PROG = fsec-print 6PROG = fsec-print
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fseccomp/Makefile b/src/fseccomp/Makefile
index f8c35d41f..a7d88eb83 100644
--- a/src/fseccomp/Makefile
+++ b/src/fseccomp/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fseccomp
5PROG = fseccomp 6PROG = fseccomp
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/ftee/Makefile b/src/ftee/Makefile
index 0c27b4cbc..1b1cdec43 100644
--- a/src/ftee/Makefile
+++ b/src/ftee/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/ftee
5PROG = ftee 6PROG = ftee
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/fzenity/Makefile b/src/fzenity/Makefile
index 148babbe8..cb80ec0bc 100644
--- a/src/fzenity/Makefile
+++ b/src/fzenity/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/fzenity
5PROG = fzenity 6PROG = fzenity
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/include/common.h b/src/include/common.h
index 23b00b6f8..4a2b8c1bf 100644
--- a/src/include/common.h
+++ b/src/include/common.h
@@ -41,7 +41,8 @@
41 41
42#define errExit(msg) do { \ 42#define errExit(msg) do { \
43 char msgout[500]; \ 43 char msgout[500]; \
44 snprintf(msgout, 500, "Error %s: %s:%d %s", msg, __FILE__, __LINE__, __func__); \ 44 snprintf(msgout, 500, "Error %s/%s:%d %s(): %s", \
45 MOD_DIR, __FILE__, __LINE__, __func__, msg); \
45 perror(msgout); \ 46 perror(msgout); \
46 exit(1); \ 47 exit(1); \
47} while (0) 48} while (0)
diff --git a/src/jailcheck/Makefile b/src/jailcheck/Makefile
index 3b0b83412..0b57861c6 100644
--- a/src/jailcheck/Makefile
+++ b/src/jailcheck/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/jailcheck
5PROG = jailcheck 6PROG = jailcheck
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8
diff --git a/src/lib/Makefile b/src/lib/Makefile
index a7b093048..9cf8abe36 100644
--- a/src/lib/Makefile
+++ b/src/lib/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/lib
5TARGET = lib 6TARGET = lib
6 7
7include $(ROOT)/src/prog.mk 8include $(ROOT)/src/prog.mk
diff --git a/src/libpostexecseccomp/Makefile b/src/libpostexecseccomp/Makefile
index c5ec14672..c9e25d066 100644
--- a/src/libpostexecseccomp/Makefile
+++ b/src/libpostexecseccomp/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/libpostexecseccomp
5SO = libpostexecseccomp.so 6SO = libpostexecseccomp.so
6TARGET = $(SO) 7TARGET = $(SO)
7 8
diff --git a/src/libtrace/Makefile b/src/libtrace/Makefile
index 8b14a4335..337529361 100644
--- a/src/libtrace/Makefile
+++ b/src/libtrace/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/libtrace
5SO = libtrace.so 6SO = libtrace.so
6TARGET = $(SO) 7TARGET = $(SO)
7 8
diff --git a/src/libtracelog/Makefile b/src/libtracelog/Makefile
index 2b43ce131..3e9d9e3e3 100644
--- a/src/libtracelog/Makefile
+++ b/src/libtracelog/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/libtracelog
5SO = libtracelog.so 6SO = libtracelog.so
6TARGET = $(SO) 7TARGET = $(SO)
7 8
diff --git a/src/profstats/Makefile b/src/profstats/Makefile
index ae88bf2fd..aa947401e 100644
--- a/src/profstats/Makefile
+++ b/src/profstats/Makefile
@@ -2,6 +2,7 @@
2ROOT = ../.. 2ROOT = ../..
3-include $(ROOT)/config.mk 3-include $(ROOT)/config.mk
4 4
5MOD_DIR = src/profstats
5PROG = profstats 6PROG = profstats
6TARGET = $(PROG) 7TARGET = $(PROG)
7 8