develooper Front page | perl.perl5.porters | Postings from January 2003

bleadperl: PerlIOStdio_invalidate_fileno breaks fclose semantics

Thread Next
From:
Michael Schroeder
Date:
January 29, 2003 04:34
Subject:
bleadperl: PerlIOStdio_invalidate_fileno breaks fclose semantics
Message ID:
20030129123414.GA14625@immd4.informatik.uni-erlangen.de

Hi porters,

the fix of the socket memory hole doesn't take into account that
fclose() flushes the stdio stream. This flushing doesn't work anymore
if fileno gets invalidated. As a result most web services will cease
to work.

Test program:

open(T, ">/tmp/test") || die;
open(D, ">&=".fileno(T)) || die;
print D 'ok';
close D || die;
close T || die;
open(T, "</tmp/test") || die;
my $r = <T>;
close T;
$r ||= 'fail';
print "$r\n";

Cheers,
  Michael.

-- 
Michael Schroeder           mlschroe@informatik.uni-erlangen.de
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}

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