www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/07/25/10:30:37

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <002f01c233e7$ac5f3da0$0100a8c0@wdg.uk.ibm.com>
From: "Max Bowsher" <maxb AT ukf DOT net>
To: "Norbert Pfeiffer" <norbert AT itbw DOT de>
Cc: <cygwin AT cygwin DOT com>
References: <006101c2336f$6a69cbe0$1f00a8c0 AT npf><007101c233c9$9ef90c40$0100a8c0 AT wdg DOT uk DOT ibm DOT com> <010f01c233d8$9d55e5c0$1f00a8c0 AT npf> <1027601080 DOT 14041 DOT 2 DOT camel AT lifelesswks>
Subject: Re: as one gets roots - rights ...
Date: Thu, 25 Jul 2002 15:29:23 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

Robert Collins wrote:
> On Thu, 2002-07-25 at 22:41, Norbert Pfeiffer wrote:
>> Hi Max,
>>
>> thanks, goes naturally also.
>> This is IMHO a very quick and dirty hack,
>> because it is valid only for this problem.
>
> Actually, most unix based code that blindly requires root rights to
> perform operations is broken. Such code won't run correctly in an
> environment with capabilities, or granular permissions, or other
> similar behaviour.
>
> Adding cygwin specific tests is one approach, but still flawed. IMO
> the correct approach is to test to see whether the action can be
> completed, and if it can not be, croak at that point, rather than
> assuming some arbitrary external condition ust be true before trying.
>
> Anyway, just my 43c :}.
>
> Rob

Thanks Rob - that would be the tidiest solution, as it doesn't require knowledge
of exactly which Windows OSes do what. From a quick look at the code, it seems
that all that is required is improved handling of the return code from
socket() - rather than a plain croak("icmp socket error: $!"), put in special
handing to produce a more detailed advisory message in the case of 'Access
Denied'.

Unfortunately, since I have never used the Net::Ping module, nor do I expect to
in the forseeable future, its not something I'm going to go and fix, but for any
interested parties, it should be trivial.

Max.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019