develooper Front page | perl.perl5.porters | Postings from June 2013

Re: [perl #117265] [PATCH] e213661 no warnings 'safesyscalls', fatalnul checks

Thread Previous | Thread Next
From:
Reini Urban
Date:
June 27, 2013 16:51
Subject:
Re: [perl #117265] [PATCH] e213661 no warnings 'safesyscalls', fatalnul checks
Message ID:
51CC6D9B.6030704@cpanel.net
On 06/27/2013 10:52 AM, Leon Timmermans via RT wrote:
> On Thu, Jun 27, 2013 at 3:41 PM, Reini Urban <reini@cpanel.net> wrote:
> 4>
>>> I've attached a version of the patch updated to work with blead.
>>
>>
>> Great, Thanks for the improvements.
>> I've looked over it, LGTM
>>
>> Can someone please apply it now.
>
> I think having macros called CHECK_<whatever> that return from the
> function is unnecessarily obfuscating the code.

Have you got a better idea?

   if (CHECK_SAFESYSCALL(pv)) return NULL;
   if (CHECK_SAFEPATHNAME(pv)) return undef;

were the alternatives.

> I also think we shouldn't turn this warning on by default without some
> discussion about that.

We return with undef from syscalling functions with a wrong name,
set $^E to ENOENT

I think turning on this warning by default makes sense:

It only warns on wrong user data, not on code errors.
It's surprising, I want to see that attack on the console and especially 
in log files, but have no strong opinion on it.

With require I die immediately.

~ grep DEFAULT_ON regen/warnings.pl

	'inplace'	=> [ 5.008, DEFAULT_ON],
         'debugging'	=> [ 5.008, DEFAULT_ON],
         'malloc'	=> [ 5.008, DEFAULT_ON],
	'syscalls'      => [ 5.017, DEFAULT_ON],
         'deprecated'	=> [ 5.008, DEFAULT_ON],
        	'glob'		=> [ 5.008, DEFAULT_ON],
         'experimental::lexical_subs' => [ 5.017, DEFAULT_ON ],
         'experimental::regex_sets' => [ 5.017, DEFAULT_ON ],
         'experimental::lexical_topic' => [ 5.017, DEFAULT_ON ],
         'experimental::smartmatch' => [ 5.017, DEFAULT_ON ],

-- 
Reini

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About