[BusyBox] Bug in find_pid_by_name

Joe.C joe at numa.com.tw
Wed Jul 16 03:03:56 UTC 2003


Hi,

    I've reported this bug in April and it still
exists in 1.00-pre1. So I made patches for both
0.60.x and 1.00-pre1. The patch is very simple,
just use strncmp instead of strcmp. The executable
size is unchanged. Please apply if it is OK.

    Here's the procedure to test this problem:
     Create a executable with very long name, say
'test_1234567890123456' and execute it. Try using
'killall' or 'pidof' to find/kill this program.
Without this patch, you can't find the program.

Joe.C

Joe.C wrote:
 >    This happen in both stable & development branch.
 >    If the program name to find is longer than 16 characters,
 > this function will failed. It won't return any pids.
 >    After checking source codes, I found the program name
 > in /proc/<pid>/stat only contain 16 characters. 'killall'
 > in linux distribution will only match first 16 characters.
 >    We should change busybox to do the same. I can build
 > a patch to fix this bug if it will help.
 >
 > Joe.C
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: stable.patch
Url: http://lists.busybox.net/pipermail/busybox/attachments/20030716/30e23fb3/attachment.diff 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 1.00-pre1.patch
Url: http://lists.busybox.net/pipermail/busybox/attachments/20030716/30e23fb3/attachment-0001.diff 


More information about the busybox mailing list