From afb55e196aa8553722f328514a3e0021e87885b7 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 17 Sep 2026 16:36:06 +0200 Subject: [PATCH] Allow skipping setcap, to ease dockerized release tests --- client/Makefile | 12 +++++++----- doc/md/Development/Maintainers.md | 4 ++++ tools/release_tests.sh | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/client/Makefile b/client/Makefile index 9002ea8c9..e2c518f22 100644 --- a/client/Makefile +++ b/client/Makefile @@ -1070,11 +1070,13 @@ endif install: all $(info [@] Installing client to $(DESTDIR)$(PREFIX)...) ifneq (,$(INSTALLBIN)) - $(Q)$(INSTALLSUDO) $(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH) - $(Q)$(INSTALLSUDO) $(CP) $(INSTALLBIN) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH) -ifeq ($(platform),Linux) - $(Q)$(INSTALLSUDO) setcap 'cap_net_raw,cap_net_admin+eip' $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH)$(PATHSEP)$(INSTALLBIN) || echo "[!] setcap failed - BLE connect-by-name (-p ble:) will need sudo; connect-by-MAC is unaffected" -endif + $(Q)$(INSTALLSUDO) $(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH) + $(Q)$(INSTALLSUDO) $(CP) $(INSTALLBIN) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH) + ifeq ($(platform),Linux) + ifneq ($(SKIP_SETCAP), 1) + $(Q)$(INSTALLSUDO) setcap 'cap_net_raw,cap_net_admin+eip' $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLBINRELPATH)$(PATHSEP)$(INSTALLBIN) || echo "[!] setcap failed - BLE connect-by-name (-p ble:) will need sudo; connect-by-MAC is unaffected" + endif + endif endif ifneq (,$(INSTALLSHARE)) $(Q)$(INSTALLSUDO) $(MKDIR) $(DESTDIR)$(PREFIX)$(PATHSEP)$(INSTALLSHARERELPATH) diff --git a/doc/md/Development/Maintainers.md b/doc/md/Development/Maintainers.md index fbd66da2f..87953ebef 100644 --- a/doc/md/Development/Maintainers.md +++ b/doc/md/Development/Maintainers.md @@ -126,3 +126,7 @@ Host binaries are compiled with hardening flags (only with Makefile, not with cm * udev rule on Linux Same logic for `make all`, `make clean`, `make uninstall` and `make check`. + +The client is installed with the additional capabilities required for direct BLE connections. See `client/Makefile` for details. +Depending on your distribution, you may need to ensure that binaries with such capabilities can be run by regular users, else an *operation not permitted* will occur. +If you prefer to not set these capabilities, run `make install SKIP_SETCAP=1`. diff --git a/tools/release_tests.sh b/tools/release_tests.sh index 9dd168cc7..649958a3b 100755 --- a/tools/release_tests.sh +++ b/tools/release_tests.sh @@ -11,7 +11,7 @@ set -x make clean && make -j PLATFORM=PM3GENERIC PLATFORM_EXTRAS= STANDALONE=LF_SAMYRUN && tools/pm3_tests.sh --long || exit 1 make clean && make -j PLATFORM=PM3RDV4 PLATFORM_EXTRAS= STANDALONE=HF_ST25_TEAROFF || exit 1 make clean && make -j PLATFORM=PM3RDV4 PLATFORM_EXTRAS=BTADDON STANDALONE=HF_REBLAY || exit 1 -make -j PLATFORM=PM3RDV4 PLATFORM_EXTRAS=BTADDON STANDALONE=HF_REBLAY && if sudo true; then INSTALLSUDO=sudo make install PLATFORM=PM3RDV4 PLATFORM_EXTRAS=BTADDON STANDALONE=HF_REBLAY && ( cd /tmp; proxmark3 -c 'data load -f lf_EM4x05.pm3;lf search -1'|grep 'Valid FDX-B ID found' ) && INSTALLSUDO=sudo make uninstall || exit 1; fi +make -j PLATFORM=PM3RDV4 PLATFORM_EXTRAS=BTADDON STANDALONE=HF_REBLAY && if sudo true; then INSTALLSUDO=sudo make install SKIP_SETCAP=1 PLATFORM=PM3RDV4 PLATFORM_EXTRAS=BTADDON STANDALONE=HF_REBLAY && ( cd /tmp; proxmark3 -c 'data load -f lf_EM4x05.pm3;lf search -1'|grep 'Valid FDX-B ID found' ) && INSTALLSUDO=sudo make uninstall || exit 1; fi ( cd client; rm -rf build; mkdir build;cd build;cmake .. && make -j PLATFORM=PM3GENERIC PLATFORM_EXTRAS= STANDALONE=LF_SAMYRUN && cp -a ../*scripts ../*libs . && ../../tools/pm3_tests.sh --clientbin $(pwd)/proxmark3 client ) || exit 1 ( cd client; rm -rf build; mkdir build;cd build;cmake .. && make -j PLATFORM=PM3RDV4 PLATFORM_EXTRAS= STANDALONE=HF_ST25_TEAROFF ) || exit 1 ( cd client; rm -rf build; mkdir build;cd build;cmake .. && make -j PLATFORM=PM3RDV4 PLATFORM_EXTRAS=BTADDON STANDALONE=HF_REBLAY ) || exit 1