summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-12-01 21:47:18 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-12-01 21:47:20 +0100
commit7b0bd859249ee2c8af63f159534d2944d969056d (patch)
tree2344c1729a62846a6498ead63e69061d338ec45b
parentbe057fe138aef1f38d615e4751da078aa6ce36ed (diff)
wireless: fix process handling if the pid exe is a symlink
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--scripts/netifd-wireless.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/netifd-wireless.sh b/scripts/netifd-wireless.sh
index 1af4b10..e26cea5 100644
--- a/scripts/netifd-wireless.sh
+++ b/scripts/netifd-wireless.sh
@@ -158,9 +158,13 @@ _wireless_set_data() {
_wireless_add_process() {
_wdev_notify_init $CMD_PROCESS_ADD
+ local exe="$2"
+ [ -L "$exe" ] && exe="$(readlink -f "$exe")"
json_add_int pid "$1"
- json_add_string exe "$2"
+ json_add_string exe "$exe"
[ -n "$3" ] && json_add_boolean required 1
+ exe2="$(readlink -f /proc/$pid/exe)"
+ [ "$exe" = "$exe2" ] && echo "WARNING (wireless_add_process): executable path $exe does not match process $1 path ($exe2)"
_wdev_notify
}