Use absolute path in shell script 62/255062/1
authorArtur Świgoń <a.swigon@samsung.com>
Thu, 11 Mar 2021 14:12:17 +0000 (15:12 +0100)
committerArtur Świgoń <a.swigon@samsung.com>
Thu, 11 Mar 2021 14:22:50 +0000 (15:22 +0100)
This change prevents running another (possibly malicious) command with
the same name by modifying the PATH.

Change-Id: I002a0260e2c385dd9da533a7587bf9056fcab549

tests/VConf_init.sh
utils/setVconfKeys.sh

index 05173de6e0e3c41681198f59c31b5baf0513658c..1e6631dca0f4852f208700a9b4b36d0a78a69ec4 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-VCONFTOOL="vconftool set -f -t"
+VCONFTOOL="/bin/vconftool set -f -t"
 
 $VCONFTOOL int    VconfImplTest/int/20      20
 $VCONFTOOL string VconfImplTest/string/foo  "foo"
index 9165917141cd6303e9d2b8ba6d32364fbf5f586a..4e337eb8185d477f58eed4e20ecae96b9283f256 100755 (executable)
@@ -3,10 +3,10 @@
 VCONF_KEY_PREFIX=$1
 
 if [ -f /etc/tizen-release ]; then
-    VCONFTOOL="vconftool set -f -t"
+    VCONFTOOL="/bin/vconftool set -f -t"
 else
     sdb root on
-    VCONFTOOL="sdb shell vconftool set -f -t"
+    VCONFTOOL="sdb shell /bin/vconftool set -f -t"
     sdb -d shell mount -o remount,rw /
 fi