cmd: add helpers for mounting / unmounting #2827

Merged
merged 9 commits into from Mar 1, 2017

cmd: add snap-confine-debug

This patch adds a second build of snap-confine that comes with
additional debugging output that is disabled at compile time in the
regular version. The setuid-root version cannot have this additional
(runtime-enabled) output as it might be used as an attack vector.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
  • Loading branch information...
commit 6573f698a22db592006cf6af7d5284cf66a891e4 @zyga zyga committed Feb 23, 2017
View
@@ -230,6 +230,21 @@ snap_confine_snap_confine_CFLAGS += $(APPARMOR_CFLAGS)
snap_confine_snap_confine_LDADD += $(APPARMOR_LIBS)
endif
+# an extra build that has additional debugging enabled at compile time
+
+noinst_PROGRAMS += snap-confine/snap-confine-debug
+snap_confine_snap_confine_debug_SOURCES = $(snap_confine_snap_confine_SOURCES)
+snap_confine_snap_confine_debug_CFLAGS = $(snap_confine_snap_confine_CFLAGS)
+snap_confine_snap_confine_debug_LDFLAGS = $(snap_confine_snap_confine_LDFLAGS)
+snap_confine_snap_confine_debug_LDADD = $(snap_confine_snap_confine_LDADD)
+snap_confine_snap_confine_debug_CFLAGS += -DSNAP_CONFINE_DEBUG_BUILD=1
+
+snap-confine/snap-confine-debug$(EXEEXT): $(snap_confine_snap_confine_debug_OBJECTS) $(snap_confine_snap_confine_debug_DEPENDENCIES) $(EXTRA_snap_confine_snap_confine_debug_DEPENDENCIES) libsnap-confine-private/$(am__dirstamp)
+ @rm -f snap-confine/snap-confine-debug$(EXEEXT)
+ $(AM_V_CCLD)$(snap_confine_snap_confine_debug_LINK) $(snap_confine_snap_confine_debug_OBJECTS) $(snap_confine_snap_confine_debug_LDADD) $(LIBS)
+
+snap-confine/snap-confine-debug$(EXEEXT): LIBS += -Wl,-Bstatic -lcap -Wl,-Bdynamic
+
if WITH_UNIT_TESTS
noinst_PROGRAMS += snap-confine/snap-confine-unit-tests
snap_confine_snap_confine_unit_tests_SOURCES = \