on recent Windows.
cygwin on XP can create an icmp socket as a normal user but can't do
anything with it. On Vista or Win7 the process must be running as
an admin to create the socket.
If someone sees value in running the test on cygwin on XP, they can
provide a patch.
SKIP: {
skip "icmp ping requires root privileges.", 1
if ($> and $^O ne 'VMS' and $^O ne 'cygwin')
- or ($^O eq 'MSWin32'
+ or (($^O eq 'MSWin32' or $^O eq 'cygwin')
and !IsAdminUser())
or ($^O eq 'VMS'
and (`write sys\$output f\$privilege("SYSPRV")` =~ m/FALSE/));
}
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();