Change in osmo-ttcn3-hacks[master]: ttcn3-dumpcap-start.sh: Accept running as root or setuid dumpcap

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Fri Dec 11 16:22:52 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21678 )

Change subject: ttcn3-dumpcap-start.sh: Accept running as root or setuid dumpcap
......................................................................

ttcn3-dumpcap-start.sh: Accept running as root or setuid dumpcap

Change-Id: Id97fb22e0018739a07e46ecaf26463248554f276
---
M ttcn3-dumpcap-start.sh
1 file changed, 8 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved; Verified



diff --git a/ttcn3-dumpcap-start.sh b/ttcn3-dumpcap-start.sh
index aa3814a..4832b6d 100755
--- a/ttcn3-dumpcap-start.sh
+++ b/ttcn3-dumpcap-start.sh
@@ -30,7 +30,14 @@
 kill_rm_pidfile $PIDFILE_NETCAT
 kill_rm_pidfile $PIDFILE_PCAP
 
-if [ -x $DUMPCAP ]; then
+if [ ! -x $DUMPCAP ]; then
+	echo "Missing required dumpcap binary at ${DUMPCAP}"
+	exit 31
+fi
+
+if [ "$(id -u)" = "0" ]; then
+	CMD="$DUMPCAP -q"
+else
     CAP_ERR="1"
     if [ -x /sbin/setcap ]; then
 	# N. B: this check requires libcap2-bin package

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21678
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id97fb22e0018739a07e46ecaf26463248554f276
Gerrit-Change-Number: 21678
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201211/f587f034/attachment.htm>


More information about the gerrit-log mailing list