diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-01-29 08:08:03 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-01-29 08:08:03 +0000 |
commit | e968ebb4ae28abc4f01f8cb848c32e7cbf4561fd (patch) | |
tree | 6f9470b7476a358e20f9ec0b6fa1aef09e2bf15a /sys-process/psmisc/files | |
parent | Fix this category's dependencies to work with modular X. (diff) | |
download | gentoo-2-e968ebb4ae28abc4f01f8cb848c32e7cbf4561fd.tar.gz gentoo-2-e968ebb4ae28abc4f01f8cb848c32e7cbf4561fd.tar.bz2 gentoo-2-e968ebb4ae28abc4f01f8cb848c32e7cbf4561fd.zip |
old
(Portage version: 2.1_pre3-r1)
Diffstat (limited to 'sys-process/psmisc/files')
-rw-r--r-- | sys-process/psmisc/files/digest-psmisc-21.6 | 1 | ||||
-rw-r--r-- | sys-process/psmisc/files/digest-psmisc-21.8 | 1 | ||||
-rw-r--r-- | sys-process/psmisc/files/psmisc-21.6-nonls.patch | 14 | ||||
-rw-r--r-- | sys-process/psmisc/files/psmisc-21.6-scanf.patch | 50 | ||||
-rw-r--r-- | sys-process/psmisc/files/psmisc-21.6-selinux.diff.bz2 | bin | 7709 -> 0 bytes | |||
-rw-r--r-- | sys-process/psmisc/files/psmisc-21.8-ipv6.patch | 418 |
6 files changed, 0 insertions, 484 deletions
diff --git a/sys-process/psmisc/files/digest-psmisc-21.6 b/sys-process/psmisc/files/digest-psmisc-21.6 deleted file mode 100644 index 903beece2258..000000000000 --- a/sys-process/psmisc/files/digest-psmisc-21.6 +++ /dev/null @@ -1 +0,0 @@ -MD5 6994f227b38b09cb3f3bdd3bc5fc65fe psmisc-21.6.tar.gz 222454 diff --git a/sys-process/psmisc/files/digest-psmisc-21.8 b/sys-process/psmisc/files/digest-psmisc-21.8 deleted file mode 100644 index 909a905ebb32..000000000000 --- a/sys-process/psmisc/files/digest-psmisc-21.8 +++ /dev/null @@ -1 +0,0 @@ -MD5 d6276e071c10ddf4b0d98856e5573e1a psmisc-21.8.tar.gz 227997 diff --git a/sys-process/psmisc/files/psmisc-21.6-nonls.patch b/sys-process/psmisc/files/psmisc-21.6-nonls.patch deleted file mode 100644 index 753bae56a7e7..000000000000 --- a/sys-process/psmisc/files/psmisc-21.6-nonls.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- psmisc-21.6/src/i18n.h 2004-11-09 06:25:15.000000000 -0500 -+++ psmisc-21.6.nonls/src/i18n.h 2005-03-14 00:21:53.000000000 -0500 -@@ -13,6 +13,11 @@ - #define _(String) gettext (String) - #else - #define _(String) (String) -+#define rpmatch(line) \ -+ ( (line == NULL) ? -1 : \ -+ (*line == 'y' || *line == 'Y') ? 1 : \ -+ (*line == 'n' || *line == 'N') ? 0 : \ -+ -1 ) - #endif - - #endif diff --git a/sys-process/psmisc/files/psmisc-21.6-scanf.patch b/sys-process/psmisc/files/psmisc-21.6-scanf.patch deleted file mode 100644 index 7bc566625107..000000000000 --- a/sys-process/psmisc/files/psmisc-21.6-scanf.patch +++ /dev/null @@ -1,50 +0,0 @@ -Fix sscanf() invocation to be C98/C99 compliant. Most people don't -notice because glibc isn't C98/C99 compliant in this respect, but -some of us use libc's which are :). - -to be more specific, mjn3 of uClibc writes: -Both C99 and C89 state that the %c conversion for scanf reads the -exact number of bytes specified by the optional field width (or 1 -if not specified). There is an argument that perhaps the specified -width should be treated as an upper bound, based on some historical -use. Glibc does not obey this specification nor mention it in any -compliance documentation. - -Also, the first hunk is to fix segfaults that may arise from -running pstree with an user argument but find_proc(1) is NULL. -This normally doesn't occur, but it is possible: -vapier@uclibc-nemo 0 src $ pstree vapier -Segmentation fault - -Mike Frysinger <vapier@gentoo.org> - -Index: src/pstree.c -=================================================================== -RCS file: /cvsroot/psmisc/psmisc/src/pstree.c,v -retrieving revision 1.23 -diff -u -r1.23 pstree.c ---- src/pstree.c 22 Mar 2005 00:57:20 -0000 1.23 -+++ src/pstree.c 29 Apr 2005 23:01:41 -0000 -@@ -531,6 +531,9 @@ - { - const CHILD *walk; - -+ if (!current) -+ return; -+ - if (current->uid == uid) - { - if (dumped) -@@ -608,11 +611,10 @@ - { - memset(comm, '\0', COMM_LEN+1); - tmpptr = strrchr(readbuf, ')'); /* find last ) */ -- *tmpptr = '\0'; - /* We now have readbuf with pid and cmd, and tmpptr+2 - * with the rest */ - /*printf("readbuf: %s\n", readbuf);*/ -- if (sscanf(readbuf, "%*d (%15c", comm) == 1) -+ if (sscanf(readbuf, "%*d (%15[^)]", comm) == 1) - { - /*printf("tmpptr: %s\n", tmpptr+2);*/ - if (sscanf(tmpptr+2, "%*c %d", &ppid) == 1) diff --git a/sys-process/psmisc/files/psmisc-21.6-selinux.diff.bz2 b/sys-process/psmisc/files/psmisc-21.6-selinux.diff.bz2 Binary files differdeleted file mode 100644 index 1e6f9de0466c..000000000000 --- a/sys-process/psmisc/files/psmisc-21.6-selinux.diff.bz2 +++ /dev/null diff --git a/sys-process/psmisc/files/psmisc-21.8-ipv6.patch b/sys-process/psmisc/files/psmisc-21.8-ipv6.patch deleted file mode 100644 index 074f684ee434..000000000000 --- a/sys-process/psmisc/files/psmisc-21.8-ipv6.patch +++ /dev/null @@ -1,418 +0,0 @@ -http://bugs.gentoo.org/113212 - ---- src/fuser.c -+++ src/fuser.c -@@ -66,6 +66,7 @@ static dev_t get_netdev(void); - int parse_mount(struct names *this_name, struct device_list **dev_list); - static void add_device(struct device_list **dev_list, struct names *this_name, dev_t device); - void scan_mount_devices(const opt_type opts, struct mountdev_list **mount_devices); -+void scan_unixsockets(struct unixsocket_list **unixsocket_head); - #ifdef DEBUG - static void debug_match_lists(struct names *names_head, struct inode_list *ino_head, struct device_list *dev_head); - #endif -@@ -94,8 +95,10 @@ static void usage (const char *errormsg) - " -u display user IDs\n" - " -v verbose output\n" - " -V display version information\n" -+#ifdef WITH_IPV6 - " -4 search IPv4 sockets only\n" - " -6 search IPv6 sockets only\n" -+#endif - " - reset options\n\n" - " udp/tcp names: [local_port][,[rmt_host][,[rmt_port]]]\n\n")); - exit (1); -@@ -228,6 +231,7 @@ static void add_ip_conn(struct ip_connec - *ip_list = ip_tmp; - } - -+#ifdef WITH_IPV6 - static void add_ip6_conn(struct ip6_connections **ip_list, const char *protocol, struct names *this_name, const int lcl_port, const int rmt_port, struct in6_addr rmt_address) - { - struct ip6_connections *ip_tmp, *ip_head; -@@ -244,6 +248,7 @@ static void add_ip6_conn(struct ip6_conn - - *ip_list = ip_tmp; - } -+#endif - - static void add_matched_proc(struct names *name_list, const pid_t pid, const uid_t uid, const char access) - { -@@ -322,6 +329,19 @@ int parse_file(struct names *this_name, - return 0; - } - -+int parse_unixsockets(struct names *this_name, struct inode_list **ino_list, struct unixsocket_list *sun_head) -+{ -+ struct unixsocket_list *sun_tmp; -+ -+ for (sun_tmp = sun_head; sun_tmp != NULL ; sun_tmp = sun_tmp->next) -+ { -+ if (strcmp(this_name->filename, sun_tmp->sun_name) == 0) { -+ add_inode(ino_list, this_name, sun_tmp->dev, sun_tmp->inode); -+ } -+ } -+ return 0; -+} -+ - int parse_mounts(struct names *this_name, struct mountdev_list *mounts, struct device_list **dev_list, const char opts) - { - struct stat st; -@@ -347,7 +369,11 @@ int parse_mounts(struct names *this_name - return 0; - } - -+#ifdef WITH_IPV6 - int parse_inet(struct names *this_name, const int ipv6_only, const int ipv4_only, struct ip_connections **ip_list, struct ip6_connections **ip6_list) -+#else -+int parse_inet(struct names *this_name, struct ip_connections **ip_list) -+#endif - { - struct addrinfo *res, *resptr; - struct addrinfo hints; -@@ -355,7 +381,9 @@ int parse_inet(struct names *this_name, - char *lcl_port_str, *rmt_addr_str, *rmt_port_str, *tmpstr, *tmpstr2; - in_port_t lcl_port; - struct sockaddr_in *sin; -+#ifdef WITH_IPV6 - struct sockaddr_in6 *sin6; -+#endif - char hostspec[100]; - char *protocol; - int i; -@@ -402,12 +430,16 @@ int parse_inet(struct names *this_name, - /*printf("parsed to lp %s rh %s rp %s\n", lcl_port_str, rmt_addr_str, rmt_port_str);*/ - - memset(&hints, 0, sizeof(hints)); -+#ifdef WITH_IPV6 - if (ipv6_only) { - hints.ai_family = PF_INET6; - } else if (ipv4_only) { - hints.ai_family = PF_INET; - } else - hints.ai_family = PF_UNSPEC; -+#else -+ hints.ai_family = PF_INET; -+#endif - if (strcmp(protocol, "tcp") == 0) - hints.ai_socktype = SOCK_STREAM; - else -@@ -428,9 +460,11 @@ int parse_inet(struct names *this_name, - case AF_INET: - lcl_port = ((struct sockaddr_in*)(res->ai_addr))->sin_port; - break; -+#ifdef WITH_IPV6 - case AF_INET6: - lcl_port = ((struct sockaddr_in6*)(res->ai_addr))->sin6_port; - break; -+#endif - default: - fprintf(stderr, _("Unknown local port AF %d\n"), res->ai_family); - freeaddrinfo(res); -@@ -442,7 +476,9 @@ int parse_inet(struct names *this_name, - res = NULL; - if (rmt_addr_str == NULL && rmt_port_str == NULL) { - add_ip_conn(ip_list, protocol, this_name, ntohs(lcl_port), 0, INADDR_ANY); -+#ifdef WITH_IPV6 - add_ip6_conn(ip6_list, protocol,this_name, ntohs(lcl_port), 0, in6addr_any); -+#endif - return 0; - } else { - /* Resolve remote address and port */ -@@ -453,10 +489,12 @@ int parse_inet(struct names *this_name, - sin = (struct sockaddr_in*)resptr->ai_addr; - add_ip_conn(ip_list, protocol, this_name, ntohs(lcl_port), ntohs(sin->sin_port), sin->sin_addr.s_addr); - break; -+#ifdef WITH_IPV6 - case AF_INET6: - sin6 = (struct sockaddr_in6*)resptr->ai_addr; - add_ip6_conn(ip6_list, protocol, this_name, ntohs(lcl_port), ntohs(sin6->sin6_port), sin6->sin6_addr); - break; -+#endif - } - } /*while */ - return 0; -@@ -481,7 +519,7 @@ void find_net_sockets(struct inode_list - return ; - - if ( (fp = fopen(pathname, "r")) == NULL) { -- fprintf(stderr, _("Cannot open protocol file: %s"), strerror(errno)); -+ fprintf(stderr, _("Cannot open protocol file \"%s\": %s"), pathname,strerror(errno)); - return; - } - while (fgets(line, BUFSIZ, fp) != NULL) { -@@ -512,6 +550,7 @@ void find_net_sockets(struct inode_list - return ; - } - -+#ifdef WITH_IPV6 - void find_net6_sockets(struct inode_list **ino_list, struct ip6_connections *conn_list, const char *protocol, const dev_t netdev) - { - FILE *fp; -@@ -565,38 +606,48 @@ void find_net6_sockets(struct inode_list - } - } - } -+#endif - - int main(int argc, char *argv[]) - { - opt_type opts; - int sig_number; -+#ifdef WITH_IPV6 - int ipv4_only, ipv6_only; -+#endif - unsigned char default_namespace = NAMESPACE_FILE; - struct mountdev_list *mount_devices = NULL; - struct device_list *match_devices = NULL; -+ struct unixsocket_list *unixsockets = NULL; - - dev_t netdev; - struct ip_connections *tcp_connection_list = NULL; - struct ip_connections *udp_connection_list = NULL; -+#ifdef WITH_IPV6 - struct ip6_connections *tcp6_connection_list = NULL; - struct ip6_connections *udp6_connection_list = NULL; -+#endif - struct inode_list *match_inodes = NULL; - struct names *names_head, *this_name, *names_tail; -- int optc, option; -+ int optc; -+ char *option; - char *nsptr; - -+#ifdef WITH_IPV6 - ipv4_only = ipv6_only = 0; -+#endif - names_head = this_name = names_tail = NULL; - opts = 0; - sig_number = SIGKILL; - - netdev = get_netdev(); - scan_mount_devices(opts, &mount_devices); -+ scan_unixsockets(&unixsockets); - - /* getopt doesnt like things like -SIGBLAH */ - for(optc = 1; optc < argc; optc++) { - if (argv[optc][0] == '-') { /* its an option */ -- option=argv[optc][1]; -+ option=argv[optc] + 1; - if (argv[optc][1] == '-') { /* its a long option */ - if (argv[optc][2] == '\0') { - continue; -@@ -604,13 +655,15 @@ int main(int argc, char *argv[]) - /* FIXME longopts */ - continue; - } -- switch(argv[optc][1]) { -+ while (*option) switch(*option++) { -+#ifdef WITH_IPV6 - case '4': - ipv4_only = 1; - break; - case '6': - ipv6_only = 1; - break; -+#endif - case 'a': - opts |= OPT_ALLFILES; - break; -@@ -662,8 +715,8 @@ int main(int argc, char *argv[]) - print_version(); - return 0; - default: -- if ( isupper(argv[optc][1]) || isdigit(argv[optc][1])) { -- sig_number = get_signal(argv[optc]+1,"fuser"); -+ if ( isupper(*option) || isdigit(*option) ) { -+ sig_number = get_signal(option,"fuser"); - break; - } - fprintf(stderr,"%s: Invalid option %c\n",argv[0] , argv[optc][1]); -@@ -703,15 +756,24 @@ int main(int argc, char *argv[]) - switch(this_name->name_space) { - case NAMESPACE_TCP: - asprintf(&(this_name->filename), "%s/tcp", argv[optc]); -+#ifdef WITH_IPV6 - parse_inet(this_name, ipv4_only, ipv6_only, &tcp_connection_list, &tcp6_connection_list); -+#else -+ parse_inet(this_name, &tcp_connection_list); -+#endif - break; - case NAMESPACE_UDP: - asprintf(&(this_name->filename), "%s/udp", argv[optc]); -+#ifdef WITH_IPV6 - parse_inet(this_name, ipv4_only, ipv6_only, &tcp_connection_list, &tcp6_connection_list); -+#else -+ parse_inet(this_name, &tcp_connection_list); -+#endif - break; - default: /* FILE */ - this_name->filename = strdup(argv[optc]); - parse_file(this_name, &match_inodes); -+ parse_unixsockets(this_name, &match_inodes, unixsockets); - if (opts & OPT_MOUNTPOINT || opts & OPT_MOUNTS) - parse_mounts(this_name, mount_devices, &match_devices, opts); - break; -@@ -733,13 +795,16 @@ int main(int argc, char *argv[]) - if (opts & OPT_ALLFILES) - usage(_("all option cannot be used with silent option.")); - } -+#ifdef WITH_IPV6 - if (ipv4_only && ipv6_only) - usage(_("You cannot search for only IPv4 and only IPv6 sockets at the same time")); - if (!ipv4_only) { -+#endif - if (tcp_connection_list != NULL) - find_net_sockets(&match_inodes, tcp_connection_list, "tcp",netdev); - if (udp_connection_list != NULL) - find_net_sockets(&match_inodes, udp_connection_list, "udp",netdev); -+#ifdef WITH_IPV6 - } - if (!ipv6_only) { - if (tcp6_connection_list != NULL) -@@ -747,6 +812,7 @@ int main(int argc, char *argv[]) - if (udp6_connection_list != NULL) - find_net6_sockets(&match_inodes, udp6_connection_list, "udp",netdev); - } -+#endif - #ifdef DEBUG - debug_match_lists(names_head, match_inodes, match_devices); - #endif -@@ -761,25 +827,27 @@ static int print_matches(struct names *n - { - struct names *nptr; - struct procs *pptr; -- char first; -- int len; -+ char head = 0; -+ char first = 1; -+ int len = 0; - struct passwd *pwent = NULL; -- int have_match = 1; -- -+ int have_match = 0; - -- if (opts & OPT_VERBOSE) -- fprintf(stderr, _("\n%*s USER PID ACCESS COMMAND\n"), -- NAME_FIELD, ""); - for (nptr = names_head; nptr != NULL ; nptr = nptr->next) { -- fprintf(stderr, "%s", nptr->filename); -- first = 1; -- len = strlen(nptr->filename); -- if (!(opts & OPT_VERBOSE)) { -- putc(':', stderr); -- len++; -+ if (nptr->matched_procs != NULL || opts & OPT_ALLFILES) { -+ if (head == 0 && opts & OPT_VERBOSE) { -+ fprintf(stderr, _("\n%*s USER PID ACCESS COMMAND\n"), -+ NAME_FIELD, ""); -+ head = 1; -+ } -+ -+ fprintf(stderr, "%s:", nptr->filename); -+ len = strlen(nptr->filename) + 1; - } -+ -+ first = 1; - for (pptr = nptr->matched_procs; pptr != NULL ; pptr = pptr->next) { -- have_match = 0; -+ have_match = 1; - if (opts & (OPT_VERBOSE|OPT_USER)) { - if (pwent == NULL || pwent->pw_uid != pptr->uid) - pwent = getpwuid(pptr->uid); -@@ -831,13 +899,13 @@ static int print_matches(struct names *n - len = 0; - first = 0; - } -- if (nptr->matched_procs == NULL || !(opts & OPT_VERBOSE)) -+ if (nptr->matched_procs != NULL || opts & OPT_ALLFILES) - putc('\n', stderr); - if (opts & OPT_KILL) - kill_matched_proc(nptr->matched_procs, opts, sig_number); - - } /* next name */ -- return have_match; -+ return !have_match; - - } - -@@ -960,6 +1028,44 @@ void add_mount_device(struct mountdev_li - } - - /* -+ * scan_unixsockets : Create a list of Unix sockets -+ * This list is used later for matching purposes -+ */ -+void scan_unixsockets(struct unixsocket_list **unixsocket_head) -+{ -+ FILE *fp; -+ char line[BUFSIZ]; -+ char *scanned_path; -+ int scanned_inode; -+ struct stat st; -+ struct unixsocket_list *newsocket; -+ -+ if ( (fp = fopen("/proc/net/unix","r")) == NULL) { -+ fprintf(stderr, _("Cannot open /proc/net/unix: %s\n"), -+ strerror(errno)); -+ return; -+ } -+ while (fgets(line, BUFSIZ, fp) != NULL) { -+ if (sscanf(line, "%*x: %*x %*x %*x %*x %*d %d %as", -+ &scanned_inode, -+ &scanned_path) != 2) -+ continue; -+ if (stat(scanned_path, &st) < 0) { -+ free(scanned_path); -+ continue; -+ } -+ if ( (newsocket = malloc(sizeof(struct unixsocket_list))) == NULL) -+ continue; -+ newsocket->sun_name = strdup(scanned_path); -+ newsocket->inode = scanned_inode; /* st.st_ino;*/ -+ newsocket->dev = 0; /* st.st_dev;*/ -+ newsocket->next = *unixsocket_head; -+ *unixsocket_head = newsocket; -+ } /* while */ -+ -+} -+ -+/* - * scan_mount_devices : Create a list of mount points and devices - * This list is used later for matching purposes - */ -@@ -1001,7 +1107,7 @@ static void debug_match_lists(struct nam - struct inode_list *iptr; - struct device_list *dptr; - -- fprintf(stderr,"Names:\n"); -+ fprintf(stderr,"Specified Names:\n"); - for (nptr=names_head; nptr!= NULL; nptr=nptr->next) - { - fprintf(stderr, "\t%s %c\n", nptr->filename, nptr->name_space); -@@ -1009,8 +1115,8 @@ static void debug_match_lists(struct nam - fprintf(stderr,"\nInodes:\n"); - for (iptr=ino_head; iptr!=NULL; iptr=iptr->next) - { -- fprintf(stderr, "\tDev:%0lx Inode:%0lx\n", -- (unsigned long)iptr->device, (unsigned long)iptr->inode); -+ fprintf(stderr, " Dev:%0lx Inode:(%0ld) 0x%0lx => %s\n", -+ (unsigned long)iptr->device, (unsigned long)iptr->inode, (unsigned long)iptr->inode, iptr->name->filename); - } - fprintf(stderr,"\nDevices:\n"); - for (dptr=dev_head; dptr!=NULL; dptr=dptr->next) ---- src/fuser.h -+++ src/fuser.h -@@ -72,6 +72,13 @@ struct device_list { - struct device_list *next; - }; - -+struct unixsocket_list { -+ char *sun_name; -+ ino_t inode; -+ dev_t dev; -+ struct unixsocket_list *next; -+}; -+ - #define NAMESPACE_FILE 0 - #define NAMESPACE_TCP 1 - #define NAMESPACE_UDP 2 |