From: Jan Dubois Date: Mon, 2 Jul 2007 14:21:06 +0000 (-0700) Subject: RE: [PATCH] lib/Net/Ping/t/500_ping_icmp.t requires admin X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a60c28c3eb1dec7e7ec009177c3f0b8ecfe7147d;p=p5sagit%2Fp5-mst-13.2.git RE: [PATCH] lib/Net/Ping/t/500_ping_icmp.t requires admin From: "Jan Dubois" Message-ID: <007901c7bcee$e7b5d400$b7217c00$@com> p4raw-id: //depot/perl@31529 --- diff --git a/lib/Net/Ping/t/500_ping_icmp.t b/lib/Net/Ping/t/500_ping_icmp.t index a4612b2..db20ac9 100644 --- a/lib/Net/Ping/t/500_ping_icmp.t +++ b/lib/Net/Ping/t/500_ping_icmp.t @@ -15,8 +15,8 @@ plan tests => 2; # Everything loaded fine ok 1; -if (($> and $^O ne 'VMS' and $^O ne 'cygwin') - or ($^O eq 'MSWin32' +if (($> and $^O ne 'VMS') + or (($^O eq 'MSWin32' or $^O eq 'cygwin') and !IsAdminUser()) or ($^O eq 'VMS' and (`write sys\$output f\$privilege("SYSPRV")` =~ m/FALSE/))) { @@ -29,7 +29,7 @@ if (($> and $^O ne 'VMS' and $^O ne 'cygwin') } sub IsAdminUser { - return unless $^O eq 'MSWin32'; + return unless $^O eq 'MSWin32' or $^O eq "cygwin"; return unless eval { require Win32 }; return unless defined &Win32::IsAdminUser; return Win32::IsAdminUser();