From: srittau Date: Sun, 23 Feb 2003 03:09:22 +0000 (+0000) Subject: * FIX: macusers script can now cope with IP addresses instead of host names. X-Git-Tag: netatalk-1-6-2rc1~9 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4ecdc03d581ea2be9e6787987916553b1b54b20;hp=c4c62b876cc50a9cdf50d58c5c6e45e120de6e7d;p=netatalk.git * FIX: macusers script can now cope with IP addresses instead of host names. --- diff --git a/NEWS b/NEWS index 58ecd725..af0feaa7 100644 --- 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 ================ diff --git a/contrib/macusers/macusers.in b/contrib/macusers/macusers.in index 4796e8cc..0c44430b 100644 --- a/contrib/macusers/macusers.in +++ b/contrib/macusers/macusers.in @@ -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 () { 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}; }