From 9b3226f42e44beceb381d57dd4ad759ed0472095 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 20 Dec 2018 13:42:07 +0100 Subject: [PATCH] TT#49106 Do not use absolute paths for commands This makes it difficult to interpose local scripts to override local behavior, for testing purposes for example. Warned-by: lintian Change-Id: I5e1feda02a26f482728f5404496c5870ec93d8aa --- debian/ngcp-rtpengine-daemon.init | 2 +- debian/ngcp-rtpengine-daemon.postinst | 4 ++-- debian/ngcp-rtpengine-iptables-setup | 4 ++-- debian/ngcp-rtpengine-kernel-dkms.postinst | 4 ++-- debian/ngcp-rtpengine-kernel-dkms.prerm | 4 ++-- debian/ngcp-rtpengine-recording-daemon.init | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/debian/ngcp-rtpengine-daemon.init b/debian/ngcp-rtpengine-daemon.init index 5e483225a..dad43edd3 100755 --- a/debian/ngcp-rtpengine-daemon.init +++ b/debian/ngcp-rtpengine-daemon.init @@ -136,7 +136,7 @@ fi case "$1" in start) set +e - if [ -x "/usr/sbin/ngcp-check-active" ]; then + if [ -x "$(which ngcp-check-active)" ]; then case "$(ngcp-check-active -v)" in active|transition) log_action_msg "Active node or transition." diff --git a/debian/ngcp-rtpengine-daemon.postinst b/debian/ngcp-rtpengine-daemon.postinst index 60e584dcf..b42e00f5a 100644 --- a/debian/ngcp-rtpengine-daemon.postinst +++ b/debian/ngcp-rtpengine-daemon.postinst @@ -5,8 +5,8 @@ set -e default=/etc/default/ngcp-rtpengine-daemon modname=xt_RTPENGINE -if [ -x /usr/sbin/ngcp-virt-identify ]; then - if /usr/sbin/ngcp-virt-identify --type container; then +if [ -x "$(which ngcp-virt-identify)" ]; then + if ngcp-virt-identify --type container; then VIRT="yes" fi fi diff --git a/debian/ngcp-rtpengine-iptables-setup b/debian/ngcp-rtpengine-iptables-setup index 7764b2c13..252939cb3 100755 --- a/debian/ngcp-rtpengine-iptables-setup +++ b/debian/ngcp-rtpengine-iptables-setup @@ -31,8 +31,8 @@ fi ### -if [ -x /usr/sbin/ngcp-virt-identify ]; then - if /usr/sbin/ngcp-virt-identify --type container; then +if [ -x "$(which ngcp-virt-identify)" ]; then + if ngcp-virt-identify --type container; then VIRT="yes" fi fi diff --git a/debian/ngcp-rtpengine-kernel-dkms.postinst b/debian/ngcp-rtpengine-kernel-dkms.postinst index 3d7694a32..21e008032 100644 --- a/debian/ngcp-rtpengine-kernel-dkms.postinst +++ b/debian/ngcp-rtpengine-kernel-dkms.postinst @@ -9,8 +9,8 @@ version=$(dpkg-query -W -f="\${Version}" "$package" \ |rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n") -if [ -x /usr/sbin/ngcp-virt-identify ]; then - if /usr/sbin/ngcp-virt-identify --type container; then +if [ -x "$(which ngcp-virt-identify)" ]; then + if ngcp-virt-identify --type container; then VIRT="yes" fi fi diff --git a/debian/ngcp-rtpengine-kernel-dkms.prerm b/debian/ngcp-rtpengine-kernel-dkms.prerm index 0cf711ad8..e58a7f13a 100644 --- a/debian/ngcp-rtpengine-kernel-dkms.prerm +++ b/debian/ngcp-rtpengine-kernel-dkms.prerm @@ -8,8 +8,8 @@ name=ngcp-rtpengine version=$(dpkg-query -W -f="\${Version}" "$package" \ |rev|cut -d- -f2-|rev|cut -d':' -f2|tr -d "\n") -if [ -x /usr/sbin/ngcp-virt-identify ]; then - if /usr/sbin/ngcp-virt-identify --type container; then +if [ -x "$(which ngcp-virt-identify)" ]; then + if ngcp-virt-identify --type container; then VIRT="yes" fi fi diff --git a/debian/ngcp-rtpengine-recording-daemon.init b/debian/ngcp-rtpengine-recording-daemon.init index b36e7901e..3bed33f8e 100755 --- a/debian/ngcp-rtpengine-recording-daemon.init +++ b/debian/ngcp-rtpengine-recording-daemon.init @@ -67,7 +67,7 @@ fi case "$1" in start) set +e - if [ -x "/usr/sbin/ngcp-check-active" ]; then + if [ -x "$(which ngcp-check-active)" ]; then case "$(ngcp-check-active -v)" in active|transition) log_action_msg "Active node or transition."