-Changes in 20.3
+Changes in 21
==============
- signames.h is cleaned
- More translatable strings
+ - Added Portuguese Language (thanks to Edesio Costa e Silva)
Changes in 20.2 (18-OCT-2001)
- Better selection of process name (thanks to David desJardins)
Changes from version 18 to 19 (25-OCT-1999)
-=============================
+===========================================
- pstree: "static int" was only "static" (fix by Jeremy Buhler)
- now uses cc -E instead of /lib/cpp (suggested by Kristofer Karas)
Changes from version 17 to 18 (1-NOV-1998)
-=============================
+==========================================
- fuser: usage summary listed -s (silent) as -q
- fuser: fuser x/y yielded confusing error message if x/y doesn't exist
Changes from version 16 to 17 (17-FEB-1998)
-=============================
+===========================================
- fuser: now also handles /proc of recent 2.1 kernels (fix by Andreas Schwab;
other fixed also proposed by Chris Wedgwood and Luca Berra)
Changes from version 15 to 16 (28-JUL-1997)
-=============================
+===========================================
- killall: now gets the list of all PIDs before killing processes, thereby
avoiding race between readdir and /proc (found by Boris Zentner)
Changes from version 14 to 15 (16-JUN-1997)
-=============================
+===========================================
- killall: killall -v didn't print the command name (fixed by Marty Leisner)
- fuser: fuser -a <unix_domain_socket> could crash (reported by Helmut Geyer)
Changes from version 13 to 14 (19-APR-1997)
-=============================
+===========================================
- killall: command-line parser didn't accept -signal (fixed by Chris Wedgwood)
- pidof: minor man page correction
Changes from version 12 to 13 (16-APR-1997)
-=============================
+===========================================
- fuser: didn't check for out of memory condition after malloc (oops !)
- fuser: INET domain sockets can now be specified as
Changes from version 11 to 12 (7-APR-1996)
-=============================
+==========================================
- fuser is now able to look up INET and UNIX domain sockets
- pstree: new option -n to sort its output by PID
Changes from version 10 to 11 (20-SEP-1995)
-=============================
+===========================================
- added VERSION file
- size of command name is now defined in comm.h - the old approach of
Changes from version 9 to 10 (28-MAR-1995)
-============================
+==========================================
- fuser: now prints header before first path (used to be on same line)
- fuser: fixed line wrapping for long paths (used to wrap too early)
- updated e-mail address in README
Changes from version 8 to 9 (22-JAN-1995)
-===========================
+=========================================
- fuser: now works with Plan 9 semantics (i.e. what recent kernels use;
reported by Harald Koenig, Nick Simicich, and others)
- updated e-mail address
Changes from version 7 to 8 (11-OCT-1994)
-===========================
+=========================================
- pstree: added -a to display command line arguments
- pstree, fuser and killall: display an error message if /proc has
PACKAGE=psmisc
-VERSION=20.3
+VERSION=21
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
{ echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
fi
-ALL_LINGUAS="en"
+ALL_LINGUAS="en pt"
# Make sure we can run config.sub.
if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/comm.h)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(psmisc,20.3)
+AM_INIT_AUTOMAKE(psmisc,21)
dnl Checks for programs.
AC_TYPE_UID_T
dnl Check for language stuff
-ALL_LINGUAS="en"
+ALL_LINGUAS="en pt"
AM_GNU_GETTEXT
dnl Checks for library functions.
FILE *file;
NET_CACHE *new, *last;
char line[MAX_LINE + 1];
+ char rmt_addr[128];
+ char addr6[128];
+ struct in6_addr in6;
+
if (!(file = fopen (filename, "r")))
{
perror (filename);
perror ("malloc");
exit (1);
}
- if (sscanf (line, "%*d: %*x:%x %lx:%x %*x %*x:%*x %*x:%*x %*x %*d %*d "
- "%ld", &new->lcl_port, &new->rmt_addr, &new->rmt_port,
+ if (sscanf (line, "%*d: %*x:%x %64[0-9A-Fa-f]:%x %*x %*x:%*x %*x:%*x %*x %*d %*d "
+ "%ld", &new->lcl_port, rmt_addr, &new->rmt_port,
&new->ino) != 4)
{
free (new);
continue;
}
+ if (strlen(rmt_addr) > 8) {
+ sscanf(rmt_addr, "%08X%08X%08X%08X",
+ &((struct sockaddr_in6 *)&new->rmt_addr)->sin6_addr.s6_addr32[0],
+ &((struct sockaddr_in6 *)&new->rmt_addr)->sin6_addr.s6_addr32[1],
+ &((struct sockaddr_in6 *)&new->rmt_addr)->sin6_addr.s6_addr32[2],
+ &((struct sockaddr_in6 *)&new->rmt_addr)->sin6_addr.s6_addr32[3]);
+ inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&new->rmt_addr)->sin6_addr, addr6, sizeof(addr6));
+ printf("address %s\n", addr6);
+ } else {
+ sscanf(rmt_addr, "%X",
+ &((struct sockaddr_in *) &new->rmt_addr)->sin_addr.s_addr);
+ ((struct sockaddr *) &new->rmt_addr)->sa_family = AF_INET;
+ }
if (!new->ino)
{
free (new);
static int
parse_inet (const char *spec, const char *name_space, int *lcl_port,
- unsigned long *rmt_addr, int *rmt_port)
+ struct sockaddr_storage *rmt_addr, int *rmt_port)
{
char *s, *here, *next, *end;
- int port, field;
+ int port, field, address_match;
if (!(s = strdup (spec)))
{
exit (1);
}
*lcl_port = *rmt_port = -1;
- *rmt_addr = 0;
+ memset(rmt_addr, 0, sizeof(struct sockaddr_storage));
field = 0;
+ address_match = 0;
for (here = s; here; here = next ? next + 1 : NULL)
{
next = strchr (here, ',');
case 1:
if (!*here)
break;
- if ((long) (*rmt_addr = inet_addr (here)) == -1)
- {
- struct hostent *hostent;
-
- if (!(hostent = gethostbyname (here)))
- return 0;
- if (hostent->h_addrtype != AF_INET)
- return 0;
- memcpy (rmt_addr, hostent->h_addr, hostent->h_length);
- }
+ if (!ipv4only) {
+
+ if (inet_pton(AF_INET6, here, &((struct sockaddr_in6*)rmt_addr)->sin6_addr) > 0) {
+ address_match = 1;
+ rmt_addr->ss_family = AF_INET6;
+ }
+ }
+ if (!ipv6only && !address_match) {
+ if (inet_pton(AF_INET, here, &((struct sockaddr_in*)rmt_addr)->sin_addr) > 0) {
+ address_match = 1;
+ rmt_addr->ss_family = AF_INET6;
+ }
+ }
+
break;
default:
return 0;
else
{
NET_CACHE *walk;
- unsigned long rmt_addr;
+ struct sockaddr_storage rmt_addr;
int lcl_port, rmt_port;
if (flags & FLAG_DEV)
this_name_space->name);
continue;
}
- /* XXX fixme
for (walk = this_name_space->cache; walk; walk = walk->next)
if ((lcl_port == -1 || walk->lcl_port == lcl_port) &&
- (!rmt_addr || walk->rmt_addr == rmt_addr) &&
+ (rmt_addr.ss_family = 0|| ( memcmp(
+ &((struct sockaddr_in6*)&walk->rmt_addr)->sin6_addr,
+ &((struct sockaddr_in6*)&rmt_addr)->sin6_addr,
+ sizeof(struct in6_addr)) == 0) ) &&
(rmt_port == -1 || walk->rmt_port == rmt_port))
enter_item (*argv, flags, sig_number, net_dev, walk->ino,
this_name_space);
- */
}
}
}