develooper Front page | perl.perl5.porters | Postings from April 2001

Re: [ID 20010426.006] Sys::Syslog ignores LOG_AUTH constant

From:
Jarkko Hietaniemi
Date:
April 26, 2001 15:54
Subject:
Re: [ID 20010426.006] Sys::Syslog ignores LOG_AUTH constant
Message ID:
20010426175415.O9141@chaos.wustl.edu
On Thu, Apr 26, 2001 at 05:10:31PM -0500, Chris Bongaarts wrote:
> 
> This is a bug report for perl from cab@tc.umn.edu,
> generated with the help of perlbug 1.28 running under perl v5.6.0.
> 
> 
> -----------------------------------------------------------------
> The Sys::Syslog module bundled with perl does not properly handle
> the LOG_AUTH constant.  constant_LOG_AU() has a comparison that
> tests for greater-than-or-equal instead of strictly greater-than,
> which results in the routine setting errno and exiting
> prematurely; the LOG_AUTH constant code is never reached.  Here
> is a patch that fixes it:
> 
> --- perl-5.6.0/ext/Sys/Syslog/Syslog.xs	Thu Feb 22 20:57:54 2001
> +++ perl-5.6.0a/ext/Sys/Syslog/Syslog.xs	Wed Apr 25 18:39:34 2001
> @@ -106,7 +106,7 @@
>  static double
>  constant_LOG_AU(char *name, int len)
>  {
> -    if (6 + 2 >= len ) {
> +    if (6 + 2 > len ) {
>  	errno = EINVAL;
>  	return 0;
>      }

Thanks!  I applied the patch now to the Perl development branch.
(And I think I see how the bug got in via h2xs...)

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen



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