You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you do? (required. The issue will be closed when not provided.)
In Redhat, there is a function to link the process obtained by needs-restarting to an installed package.
However, the current implementation does not allow accurate linking to the package.
For example, assume the following needs-restarting output:
Each line is split by :, and the left side is treated as PID and the right side is treated as Path.
Then, for Path, if it does not start with "/", it will look for the path to the binary being executed.
If you want to get the exact path of the binary that is being executed, you should look at the value of /proc/<PID>/exe.
However, since /proc/<PID>/exe points to the actual executable path, it may be different from /proc/<PID>/cmdline.
So in the example below, /proc/<PID>/cmdline points to /usr/sbin/VBoxService, but /proc/786/exe points to /opt/VBoxGuestAdditions-6.1.28/sbin/VBoxService.
However, the specifications of /proc/<PID>/exe mentioned above do not match rpm -qf in some cases.
If it is /usr/sbin/arptables, you can get the package with rpm -qf, but if it is the actual path /etc/alternatives/arptables, you cannot get the package with rpm -qf.
[root@localhost sbin]# ls -l /usr/sbin/arptableslrwxrwxrwx. 1 root root 27 May 31 2022 /usr/sbin/arptables -> /etc/alternatives/arptables[root@localhost sbin]# rpm -qf /usr/sbin/arptablesiptables-nft-1.8.10-11.el9_5.x86_64[root@localhost sbin]# rpm -qf /etc/alternatives/arptablesfile /etc/alternatives/arptables is not owned by any package
The text was updated successfully, but these errors were encountered:
What did you do? (required. The issue will be closed when not provided.)
In Redhat, there is a function to link the process obtained by needs-restarting to an installed package.
However, the current implementation does not allow accurate linking to the package.
For example, assume the following needs-restarting output:
Each line is split by
:
, and the left side is treated as PID and the right side is treated as Path.Then, for Path, if it does not start with "/", it will look for the path to the binary being executed.
vuls/scanner/redhatbase.go
Lines 936 to 950 in 8cf43b8
This implementation might work well for a line like this:
But it won't work for a line like this:
If you want to get the exact path of the binary that is being executed, you should look at the value of
/proc/<PID>/exe
.However, since
/proc/<PID>/exe
points to the actual executable path, it may be different from/proc/<PID>/cmdline
.So in the example below,
/proc/<PID>/cmdline
points to/usr/sbin/VBoxService
, but/proc/786/exe
points to/opt/VBoxGuestAdditions-6.1.28/sbin/VBoxService
.Now, the obtained path is input into the rpm -qf command in the following part.
vuls/scanner/redhatbase.go
Lines 965 to 966 in 8cf43b8
However, the specifications of
/proc/<PID>/exe
mentioned above do not match rpm -qf in some cases.If it is
/usr/sbin/arptables
, you can get the package with rpm -qf, but if it is the actual path/etc/alternatives/arptables
, you cannot get the package with rpm -qf.The text was updated successfully, but these errors were encountered: