From 889000a0661b5e9fd40887e6d0060bf157cc1308 Mon Sep 17 00:00:00 2001 From: Jan Pavlinec <jan.pavlinec@nic.cz> Date: Thu, 7 Mar 2019 16:55:16 +0100 Subject: [PATCH] base-files: don't source script in hotplug-call if is executable Note: This should also fix the situation when hotplug-call tries to source nonshell scripts and don't break case when shell hotplug script is installed without executable permission Signed-off-by: Jan Pavlinec <jan.pavlinec@nic.cz> --- package/base-files/files/sbin/hotplug-call | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/sbin/hotplug-call b/package/base-files/files/sbin/hotplug-call index 28e957c3982..dcbd39cb3b0 100755 --- a/package/base-files/files/sbin/hotplug-call +++ b/package/base-files/files/sbin/hotplug-call @@ -13,6 +13,8 @@ export DEVICENAME="${DEVPATH##*/}" [ \! -z "$1" -a -d /etc/hotplug.d/$1 ] && { for script in $(ls /etc/hotplug.d/$1/* 2>&-); do ( - [ -f $script ] && . $script + if [ -f "$script" ]; then + [ -x $script ] && $script || . $script + fi ); done }