Description of problem: pidof failed to get the pid with full path. This could be a same problem in bug#567295. Version-Release number of selected component (if applicable): SysVinit-2.86-14 How reproducible: Not easy. Steps to Reproduce: 1.write a small program use readlink(path,pathname,maxbuf) and print out pathname for all processes. See killall5.c readproc() method for example. 2.If lucky enough, one could see some junk character after the pathname print out. Example /path1/path2/path3/program@@@. 3.With the pathname from step 2, run pidof with it. Example /sbin/pidof /path1/path2/path3/program. One shouldn't see any PID return. Actual results: can not find the PID Expected results: should find the PID Additional info: readlink doesn't seems to add end of string to pathname. The problem is in killall5.c function readproc(), if (readlink(path, p->pathname, PATH_MAX) == -1) { if(pathnameLength==-1){ p->pathname = NULL; } else { p->pathname[PATH_MAX-1] = '\0'; } believe it should change to int pathnameLength=readlink(path, p->pathname, PATH_MAX); if(pathnameLength==-1){ p->pathname = NULL; } else { p->pathname[pathnameLength] = '\0'; }
Are you using MLS policy?
(In reply to comment #1) > Are you using MLS policy? New guy here. What's MLS policy?
If you need to ask, you aren't. :)
(In reply to comment #3) > If you need to ask, you aren't. :) It has been working very well with the change. See Additional info. Let me know if I could provide more help.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-1040.html