Package: ruby-sigar Version: 0.7.2-1 Severity: important Tags: upstream patch
Dear Maintainer, There is a problem with sigar_proc_port_get function. While looking for the process that owns a socket, it assumes that the UID of the process is the same as the UID of the port, which is not always true. I use Chef to configure some servers, Chef calls Ohai, which uses the function to generate the port-process map. When a process was started as root, opened a socket and then dropped priviliges, the function returns 0, which causes some problems with Ohai and Chef. I tried deleting the lines related to skipping processes with different UID - after installing the rebuilt package everything is working fine. I attach the patch. Best regards, Piotr Panczyk -- System Information: Debian Release: 7.8 APT prefers oldstable-updates APT policy: (500, 'oldstable-updates'), (500, 'oldstable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32.bsd54h0 (SMP w/24 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages ruby-sigar depends on: ii libc6 2.13-38+deb7u8 ii libruby1.9.1 1.9.3.194-8.1+deb7u5 ii ruby 1:1.9.3 ii ruby1.9.1 [ruby-interpreter] 1.9.3.194-8.1+deb7u5 ruby-sigar recommends no packages. ruby-sigar suggests no packages. -- no debconf information
--- ruby-sigar-0.7.2.orig/src/os/linux/linux_sigar.c +++ ruby-sigar-0.7.2/src/os/linux/linux_sigar.c @@ -2502,9 +2502,6 @@ int sigar_proc_port_get(sigar_t *sigar, if (stat(pid_name, &sb) < 0) { continue; } - if (sb.st_uid != netconn.uid) { - continue; - } /* sprintf(fd_name, "%s/fd", pid_name) */ memcpy(&fd_name[0], pid_name, len);