aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-10-11 18:39:25 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-10-11 18:44:00 +0200
commit5acf5e1f870fb5382556d4b434158f7d497893ca (patch)
tree9200222f648afe4c743c119712e66e38d58e1713 /shell
parent23aba8a9a66637fbc6b1eed2a259cb7ddb1a1595 (diff)
downloadbusybox-w32-5acf5e1f870fb5382556d4b434158f7d497893ca.tar.gz
busybox-w32-5acf5e1f870fb5382556d4b434158f7d497893ca.tar.bz2
busybox-w32-5acf5e1f870fb5382556d4b434158f7d497893ca.zip
shell: fix script's comm field if ENABLE_FEATURE_PREFER_APPLETS=y
function old new delta re_execed_comm - 46 +46 main 72 86 +14 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 60/0) Total: 60 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell')
-rw-r--r--shell/ash_test/ash-comm/comm.right6
-rwxr-xr-xshell/ash_test/ash-comm/comm.tests20
-rw-r--r--shell/hush_test/hush-comm/comm.right6
-rwxr-xr-xshell/hush_test/hush-comm/comm.tests20
4 files changed, 52 insertions, 0 deletions
diff --git a/shell/ash_test/ash-comm/comm.right b/shell/ash_test/ash-comm/comm.right
new file mode 100644
index 000000000..1d836656f
--- /dev/null
+++ b/shell/ash_test/ash-comm/comm.right
@@ -0,0 +1,6 @@
1./SCRIPT.sh:
2 /proc/N/comm: SCRIPT.sh
3exec ./SCRIPT.sh:
4 /proc/N/comm: SCRIPT.sh
5sh ./SCRIPT.sh:
6 /proc/N/comm: ash
diff --git a/shell/ash_test/ash-comm/comm.tests b/shell/ash_test/ash-comm/comm.tests
new file mode 100755
index 000000000..671bfc176
--- /dev/null
+++ b/shell/ash_test/ash-comm/comm.tests
@@ -0,0 +1,20 @@
1{
2echo "#!$THIS_SH"
3echo 'procdir=/proc/$$'
4#echo 'echo " /proc/N/exe: $(basename $(readlink $procdir/exe))"'
5echo 'echo " /proc/N/comm: $(cat $procdir/comm)"'
6} >SCRIPT.sh
7chmod 755 SCRIPT.sh
8
9# comm field was wrong if CONFIG_FEATURE_PREFER_APPLETS=y
10echo './SCRIPT.sh:'
11./SCRIPT.sh
12
13# comm field was wrong if CONFIG_FEATURE_PREFER_APPLETS=y
14echo 'exec ./SCRIPT.sh:'
15(exec ./SCRIPT.sh)
16
17echo 'sh ./SCRIPT.sh:'
18$THIS_SH ./SCRIPT.sh
19
20rm SCRIPT.sh
diff --git a/shell/hush_test/hush-comm/comm.right b/shell/hush_test/hush-comm/comm.right
new file mode 100644
index 000000000..1b62b617e
--- /dev/null
+++ b/shell/hush_test/hush-comm/comm.right
@@ -0,0 +1,6 @@
1./SCRIPT.sh:
2 /proc/N/comm: SCRIPT.sh
3exec ./SCRIPT.sh:
4 /proc/N/comm: SCRIPT.sh
5sh ./SCRIPT.sh:
6 /proc/N/comm: hush
diff --git a/shell/hush_test/hush-comm/comm.tests b/shell/hush_test/hush-comm/comm.tests
new file mode 100755
index 000000000..671bfc176
--- /dev/null
+++ b/shell/hush_test/hush-comm/comm.tests
@@ -0,0 +1,20 @@
1{
2echo "#!$THIS_SH"
3echo 'procdir=/proc/$$'
4#echo 'echo " /proc/N/exe: $(basename $(readlink $procdir/exe))"'
5echo 'echo " /proc/N/comm: $(cat $procdir/comm)"'
6} >SCRIPT.sh
7chmod 755 SCRIPT.sh
8
9# comm field was wrong if CONFIG_FEATURE_PREFER_APPLETS=y
10echo './SCRIPT.sh:'
11./SCRIPT.sh
12
13# comm field was wrong if CONFIG_FEATURE_PREFER_APPLETS=y
14echo 'exec ./SCRIPT.sh:'
15(exec ./SCRIPT.sh)
16
17echo 'sh ./SCRIPT.sh:'
18$THIS_SH ./SCRIPT.sh
19
20rm SCRIPT.sh