bugSystem V style init programs - Bugs: bug #36252, Pidof: killall5.c have problem...

 
 

bug #36252: Pidof: killall5.c have problem with processes with \n in their name

Submitted by:  Lukáš Nykrýn <lnykryn>
Submitted on:  Thu 19 Apr 2012 01:33:43 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Dr. Werner Fink <wfink>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 11 Oct 2012 11:58:08 AM UTC, comment #1:

Using now a fread(3) to be able to handle such strange file names

Dr. Werner Fink <wfink>
Project AdministratorIn charge of this item.
Thu 19 Apr 2012 01:33:43 PM UTC, original submission:

Pidof uses fgets to read /proc/***/stat file so if the name of process contains \n, only part of the file is read.

simple reproducer:

#!/bin/bash
NAME='./sle
ep'
cp /bin/sleep "$NAME"
"$NAME" 10m&
./pidof "$NAME"

Please see attached patch

Lukáš Nykrýn <lnykryn>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #25683:  killall5.c.patch added by lnykryn (947B - text/x-patch - Patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by lnykryn (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 11 Oct 2012 11:58:08 AM UTCwfinkStatusNone=>Fixed
      Assigned toNone=>wfink
      Open/ClosedOpen=>Closed
      SummaryPidof: killall5.c have problem with processes with \\n in their name=>Pidof: killall5.c have problem with processes with \n in their name
    Thu 19 Apr 2012 01:33:43 PM UTClnykrynAttached File-=>Added killall5.c.patch, #25683

    Back to the top


    Powered by Savane 3.1-cleanup1