diff options
author | Roy Marples <uberlord@gentoo.org> | 2007-08-02 08:56:08 +0000 |
---|---|---|
committer | Roy Marples <uberlord@gentoo.org> | 2007-08-02 08:56:08 +0000 |
commit | 88566ef3ee77b15662557c40bc5ca44f8e3fce58 (patch) | |
tree | 17692d2a02fc32b0bcb14f7c6b554fbfc4b06bab /sys-process | |
parent | Remove old version. (diff) | |
download | gentoo-2-88566ef3ee77b15662557c40bc5ca44f8e3fce58.tar.gz gentoo-2-88566ef3ee77b15662557c40bc5ca44f8e3fce58.tar.bz2 gentoo-2-88566ef3ee77b15662557c40bc5ca44f8e3fce58.zip |
Add a patch from marienz to improve the finding of sockets
(Portage version: 2.1.3_rc9)
Diffstat (limited to 'sys-process')
-rw-r--r-- | sys-process/psmisc/ChangeLog | 8 | ||||
-rw-r--r-- | sys-process/psmisc/files/digest-psmisc-22.5-r2 | 3 | ||||
-rw-r--r-- | sys-process/psmisc/files/psmisc-22.5-sockets.patch | 87 | ||||
-rw-r--r-- | sys-process/psmisc/psmisc-22.5-r2.ebuild | 48 |
4 files changed, 145 insertions, 1 deletions
diff --git a/sys-process/psmisc/ChangeLog b/sys-process/psmisc/ChangeLog index 65cd2d29cce0..e667142fdc2d 100644 --- a/sys-process/psmisc/ChangeLog +++ b/sys-process/psmisc/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-process/psmisc # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-process/psmisc/ChangeLog,v 1.61 2007/07/11 21:49:26 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-process/psmisc/ChangeLog,v 1.62 2007/08/02 08:56:08 uberlord Exp $ + +*psmisc-22.5-r2 (02 Aug 2007) + + 02 Aug 2007; Roy Marples <uberlord@gentoo.org> + +files/psmisc-22.5-sockets.patch, +psmisc-22.5-r2.ebuild: + Add a patch from marienz to improve the finding of sockets *psmisc-22.5-r1 (11 Jul 2007) diff --git a/sys-process/psmisc/files/digest-psmisc-22.5-r2 b/sys-process/psmisc/files/digest-psmisc-22.5-r2 new file mode 100644 index 000000000000..43c6bd8484d3 --- /dev/null +++ b/sys-process/psmisc/files/digest-psmisc-22.5-r2 @@ -0,0 +1,3 @@ +MD5 09c20fd899c2c1bd2dce02a510f99fab psmisc-22.5.tar.gz 277404 +RMD160 315e02a601b8729696244379038885365978ebbe psmisc-22.5.tar.gz 277404 +SHA256 f1cfe0b3b85cf06ef67d4648b59b896abce1a3f2a810d694567aff7e33273c02 psmisc-22.5.tar.gz 277404 diff --git a/sys-process/psmisc/files/psmisc-22.5-sockets.patch b/sys-process/psmisc/files/psmisc-22.5-sockets.patch new file mode 100644 index 000000000000..99ea96828aa2 --- /dev/null +++ b/sys-process/psmisc/files/psmisc-22.5-sockets.patch @@ -0,0 +1,87 @@ +=== modified file 'src/fuser.c' +--- src/fuser.c 2007-05-30 13:45:07 +0000 ++++ src/fuser.c 2007-05-30 13:48:30 +0000 +@@ -60,7 +60,8 @@ + #define NAME_FIELD 20 /* space reserved for file name */ + /* Function defines */ + static void add_matched_proc(struct names *name_list, const pid_t pid, const uid_t uid, const char access); +-static void check_dir(const pid_t pid, const char *dirname, struct device_list *dev_head, struct inode_list *ino_head, const uid_t uid, const char access); ++static void check_dir(const pid_t pid, const char *dirname, struct device_list *dev_head, struct inode_list *ino_head, const uid_t uid, const char access, ++ struct unixsocket_list *sockets, dev_t netdev); + static void check_map(const pid_t pid, const char *filename, struct device_list *dev_head, struct inode_list *ino_head, const uid_t uid, const char access); + static struct stat *get_pidstat(const pid_t pid, const char *filename); + static uid_t getpiduid(const pid_t pid); +@@ -72,7 +73,7 @@ + void scan_mount_devices(const opt_type opts, struct mountdev_list **mount_devices); + void fill_unix_cache(struct unixsocket_list **unixsocket_head); + static dev_t find_net_dev(void); +-static void scan_procs(struct names *names_head, struct inode_list *ino_head, struct device_list *dev_head); ++static void scan_procs(struct names *names_head, struct inode_list *ino_head, struct device_list *dev_head, struct unixsocket_list *sockets, dev_t netdev); + #ifdef NFS_CHECKS + static void scan_knfsd(struct names *names_head, struct device_list *dev_head); + #endif /* NFS_CHECKS */ +@@ -125,7 +126,7 @@ + "For more information about these matters, see the files named COPYING.\n")); + } + +-static void scan_procs(struct names *names_head, struct inode_list *ino_head, struct device_list *dev_head) ++static void scan_procs(struct names *names_head, struct inode_list *ino_head, struct device_list *dev_head, struct unixsocket_list *sockets, dev_t netdev) + { + DIR *topproc_dir; + struct dirent *topproc_dent; +@@ -185,9 +186,9 @@ + } + } + } +- check_dir(pid, "lib", dev_head, ino_head, uid, ACCESS_MMAP); +- check_dir(pid, "mmap", dev_head, ino_head, uid, ACCESS_MMAP); +- check_dir(pid, "fd", dev_head, ino_head, uid, ACCESS_FILE); ++ check_dir(pid, "lib", dev_head, ino_head, uid, ACCESS_MMAP, sockets, netdev); ++ check_dir(pid, "mmap", dev_head, ino_head, uid, ACCESS_MMAP, sockets, netdev); ++ check_dir(pid, "fd", dev_head, ino_head, uid, ACCESS_FILE, sockets, netdev); + check_map(pid, "maps", dev_head, ino_head, uid, ACCESS_MMAP); + + } /* while topproc_dent */ +@@ -863,7 +864,7 @@ + #ifdef DEBUG + debug_match_lists(names_head, match_inodes, match_devices); + #endif +- scan_procs(names_head, match_inodes, match_devices); ++ scan_procs(names_head, match_inodes, match_devices, unixsockets, netdev); + #ifdef NFS_CHECKS + scan_knfsd(names_head, match_devices); + #endif /* NFS_CHECKS */ +@@ -983,13 +984,15 @@ + return st; + } + +-static void check_dir(const pid_t pid, const char *dirname, struct device_list *dev_head, struct inode_list *ino_head, const uid_t uid, const char access) ++static void check_dir(const pid_t pid, const char *dirname, struct device_list *dev_head, struct inode_list *ino_head, const uid_t uid, const char access, ++ struct unixsocket_list *sockets, dev_t netdev) + { + char *dirpath, *filepath; + DIR *dirp; + struct dirent *direntry; + struct inode_list *ino_tmp; + struct device_list *dev_tmp; ++ struct unixsocket_list *sock_tmp; + struct stat st, lst; + + if ( (dirpath = malloc(MAX_PATHNAME)) == NULL) +@@ -1009,6 +1012,15 @@ + if (stat(filepath, &st) != 0) { + fprintf(stderr, _("Cannot stat file %s: %s\n"),filepath, strerror(errno)); + } else { ++ if (st.st_dev == netdev) { ++ for (sock_tmp = sockets; sock_tmp != NULL; sock_tmp = sock_tmp->next) { ++ if (sock_tmp->net_inode == st.st_ino) { ++ st.st_ino = sock_tmp->inode; ++ st.st_dev = sock_tmp->dev; ++ break; ++ } ++ } ++ } + for (dev_tmp = dev_head ; dev_tmp != NULL ; dev_tmp = dev_tmp->next) { + if (st.st_dev == dev_tmp->device) { + if (access == ACCESS_FILE && (lstat(filepath, &lst)==0) && (lst.st_mode & S_IWUSR)) { + diff --git a/sys-process/psmisc/psmisc-22.5-r2.ebuild b/sys-process/psmisc/psmisc-22.5-r2.ebuild new file mode 100644 index 000000000000..44235c3bb319 --- /dev/null +++ b/sys-process/psmisc/psmisc-22.5-r2.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/psmisc/psmisc-22.5-r2.ebuild,v 1.1 2007/08/02 08:56:08 uberlord Exp $ + +inherit eutils + +DESCRIPTION="A set of tools that use the proc filesystem" +HOMEPAGE="http://psmisc.sourceforge.net/" +SRC_URI="mirror://sourceforge/psmisc/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="ipv6 nls selinux X" + +RDEPEND=">=sys-libs/ncurses-5.2-r2 + selinux? ( sys-libs/libselinux )" +DEPEND="${RDEPEND} + sys-devel/libtool + nls? ( sys-devel/gettext )" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${PN}-22.2-gcc2.patch + epatch "${FILESDIR}"/${P}-user-header.patch + epatch "${FILESDIR}"/${P}-sockets.patch +} + +src_compile() { + econf \ + $(use_enable selinux) \ + $(use_enable nls) \ + $(use_enable ipv6) \ + || die + emake || die +} + +src_install() { + emake install DESTDIR="${D}" || die + dodoc AUTHORS ChangeLog NEWS README + use X || rm "${D}"/usr/bin/pstree.x11 + # fuser is needed by init.d scripts + dodir /bin + mv "${D}"/usr/bin/fuser "${D}"/bin/ || die + # easier to do this than forcing regen of autotools + [[ -e ${D}/usr/bin/peekfd ]] || rm -f "${D}"/usr/share/man/man1/peekfd.1 +} |