Problem with /proc/self/comm

Lukasz Serafin Lukasz.Serafin at axis.com
Fri Apr 24 15:18:46 UTC 2020


Hello,


In commit 147d2ce3dd98945a328ab9390dc562923b17c2f3, "exe" in comm fields was changed to the applet name (if standalone shell or prefer_applets is enabled). However, consider the following shell script:

#!/bin/sh
read foo < /proc/self/comm
echo $foo

Before the commit, the output of this script (when executed as ./script_name) was the name of the script, but now it is applet_name. I think that the previous behavior was correct. Only if we have "exe" in the comm field, we should change to applet_name.

I will send a patch for this (just a suggestion, maybe there are better ways to fix this problem).

BR
Lukasz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20200424/f9e7d67f/attachment.html>


More information about the busybox mailing list