]> arthur.barton.de Git - netatalk.git/commitdiff
* FIX: macusers script can now cope with IP addresses instead of host names.
authorsrittau <srittau>
Sun, 23 Feb 2003 03:09:22 +0000 (03:09 +0000)
committersrittau <srittau>
Sun, 23 Feb 2003 03:09:22 +0000 (03:09 +0000)
NEWS
contrib/macusers/macusers.in

diff --git a/NEWS b/NEWS
index 58ecd72598959ce4ec27dccc461a40edaf5a01a8..af0feaa719ed5278595d0fcdb2c783deccdcacd5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+Changes in 1.6.2
+================
+
+* FIX: macusers script can now cope with IP addresses instead of host names.
+
 Changes in 1.6.1
 ================
 
index 4796e8cc4d0da8a64d59dbc6ddfff0630e5d2c75..0c44430b788fd450d74d31809ff666858ec7b0e5 100644 (file)
@@ -42,7 +42,7 @@ if ($^O eq "freebsd") {
                 $pid  = $1;
                 $addr = $2;
                 $host = gethostbyaddr(pack('C4', split (/\./, $addr)), AF_INET);
-                ($host) = ($host =~ /(^[\w\d\-]+)/);
+                ($host) = ( $host =~ /(^(\d+\.){3}\d+|[\w\d\-]+)/ );
                 $mac{$pid} = $host;
         }
         print
@@ -57,7 +57,7 @@ if ($^O eq "freebsd") {
                 my ($pid, $host);
                 $pid  = $1;
                 $host = $2;
-                ($host) = ($host =~ /(^[\w\d\-]+)/);
+                ($host) = ( $host =~ /(^(\d+\.){3}\d+|[\w\d\-]+)/ );
                 $mac{$pid} = $host;
         }
         print
@@ -81,6 +81,7 @@ while (<PS>) {
 
         if ($ppid != 1) {
                 ($t, $t, $uid, $t, $t, $t, $name, $t, $t) = getpwnam($user);
+                ($name) = ( $name =~ /(^[^,]+)/ );
                 printf "%-8d %-8d %-16s %-20s %-9s %s\n", $pid, $uid, $user,
                     $name, $time, $mac{$pid};
         }