Dan Hain wrote:
> Casper.Dik at Sun.COM wrote:
>>> The effective uid must be root to run the program.  In addition, if the 
>>> "-f" flag is specified, you really have to be root.
>>>     
>>
>> That is incorrect.  (At least, it is bad for the program to enforce this;
>> it MUST just attempt the system calls and have those fail or verify 
>> privileges but that is a relatively poor choice).
>>   
> All the "-f" protects are the fopen(), fgets(), fclose() for reading the 
> specified file.
>> Which privileges does it need for which functions?
>>   
> 1. geteuid() == 0, open raw socket, then the euid is reset immediately: 
> seteuid( getuid() )

net_icmpaccess or net_rawaccess is what is really needed now.

In fact one could have euid == 0 and not those privileges - which is 
exactly the default case for shared ip stack zones with net_rawaccess.

> 2. Subsequent parsing of the command line then checks getuid() == 0 if 
> the "-f" option is specified.
> 3. getuid()==0 is also checked if:
> interval specified is less than 1 second ("-i" option)
> per host interval is less than 2 seconds ("-p" option)
> timeout interval is less than 5 seconds ("-t" option)
> retry limit is greater than 20 ("-r" option)

All of those are useless and bogus checks.  Particularly those in 3 
since OpenSolaris has a good resource control framework that much better 
controls that kind of thing.


-- 
Darren J Moffat

Reply via email to