in reply to RE: Re: setuid scripts
in thread setuid scripts, how?

Windows (not even WindowsNT) doesn't have Set-UID. The closest thing is probably LogonUser() followed by CreateProcessAsUser(). Though, this requires that you stash an unencrypted password somewhere and already have some special privileges, which makes it both less useful and a worse security risk than SUID (which is already a big security risk).

But that doesn't matter because WindowsNT doesn't require you to have privileges in order to send ICMP packets. You just have to know how to use the advanced socket interfaces. Net::Ping just incorrectly assumes that only VMS is this way. Just comment out the line:

croak("icmp ping requires root privilege") if ($> and $^O ne 'VMS');
and Net::Ping can do ICMP pings under WindowsNT just fine!

Gee, I wish I'd know the fix was that easy a long time ago!.

Replies are listed 'Best First'.
RE: Win32 Net::Ping("icmp")
by Anonymous Monk on Jul 27, 2000 at 17:42 UTC
    Thanks. I removed that line but it didn't seem to help. Anything else that might cause the problem? My code is basically:

    my $p = Net::Ping->new();
    foreach my $host (@host_array) {
    print "$host is ";
    print "NOT " unless $p->ping($host, 2);
    print "reachable.\n";
    }
    $p->close();

    and if fails on the print "NOT " line. Is there some way to have Ping.pm report where it is dying?