Package: perl
Version: 5.10.0-10
Severity: normal

Hi there,

Quoted from perlvar:
"Changes to $) require a check to $! to detect any possible errors after
an attempted change."

Code:
========================================================================
#!/usr/bin/perl

use POSIX;

$! = ENOSPC;
$) = "0 0";

if ($!) {
  print "setegid failed: $!\n";
}
========================================================================

[EMAIL PROTECTED]:~$ sudo perl t.pl
setegid failed: No space left on device
[EMAIL PROTECTED]:~$

perl should clear errno before going into a function where the API
depends on checking it afterwards.  Yes, I am aware there are other ways
to determine that the setegid call failed.  The problem is that the
documentation tells me that the correct way to evaluate failure is to
check errno after calls, and the call fails to initialize errno
correctly.  Either the docs or the function are wrong.

Thanks,

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash

Versions of packages perl depends on:
ii  libc6                         2.7-11     GNU C Library: Shared libraries
ii  libdb4.6                      4.6.21-8   Berkeley v4.6 Database Libraries [
ii  libgdbm3                      1.8.3-3    GNU dbm database routines (runtime
ii  perl-base                     5.10.0-10  The Pathologically Eclectic Rubbis
ii  perl-modules                  5.10.0-10  Core Perl modules

Versions of packages perl recommends:
ii  netbase                       4.32       Basic TCP/IP networking system
ii  perl-doc                      5.10.0-10  Perl documentation

-- no debconf information

-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        [EMAIL PROTECTED] |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to