Skip Menu |

This queue is for tickets about the libnet CPAN distribution.

Report information
The Basics
Id: 623
Status: resolved
Priority: 0/
Queue: libnet

People
Owner: Nobody in particular
Requestors: bennet [...] mc.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Net::FTP rmdir may return failure when it succeeds.
Unless I'm missing something, this is a one-line fix. I noted that rmdir in Net::FTP can return a failure indication even though the command succeeds. I noted the following code at the start of the function: sub rmdir { @_ == 2 || @_ == 3 or croak('usage: $ftp->rmdir( DIR [, RECURSE ] )'); # Pick off the args my ($ftp, $dir, $recurse) = @_ ; my $ok; return $ok if $ftp->_RMD( $dir ) || !$recurse; .... I changed the declaration of $ok to intialize to 1:
Subject: Net::FTP rmdir may return failure when it succeeds.
Unless I'm missing something, this is a one-line fix. I noted that rmdir in Net::FTP can return a failure indication even though the command succeeds. I noted the following code at the start of the function: sub rmdir { @_ == 2 || @_ == 3 or croak('usage: $ftp->rmdir( DIR [, RECURSE ] )'); # Pick off the args my ($ftp, $dir, $recurse) = @_ ; my $ok; return $ok if $ftp->_RMD( $dir ) || !$recurse; .... I changed the declaration of $ok to intialize to 1:
Subject: Net::FTP rmdir may return failure when it succeeds. (cont)
From: bennet [...] mc.edu
[guest - Sat May 18 15:08:48 2002] Hmm. Hit something and sent it before I was done typing. This one is more complete. Unless I'm missing something, this is a one-line fix. I noted that rmdir in Net::FTP can return a failure indication even though the command succeeds. I noted the following code at the start of the function: sub rmdir { @_ == 2 || @_ == 3 or croak('usage: $ftp->rmdir( DIR [, RECURSE ] )'); # Pick off the args my ($ftp, $dir, $recurse) = @_ ; my $ok; return $ok if $ftp->_RMD( $dir ) || !$recurse; .... I changed the declaration of $ok to intialize to 1: my $ok = 1; which seems to fix it. I'm running Net::FTP version 2.56, but I note that v. 2.64 has the same code at the top of rmdir. Perl v. 5.005_03 TB
Actually the fix should be return $ok if $ok = $ftp->_RMD( $dir ) or !$recurse; And this fix is in libnet-1.11 which is on CPAN