Skip Menu |

This queue is for tickets about the Net-SFTP-Foreign CPAN distribution.

Report information
The Basics
Id: 100669
Status: resolved
Priority: 0/
Queue: Net-SFTP-Foreign

People
Owner: Nobody in particular
Requestors: Karsten.Bang [...] ist.com
Cc:
AdminCc:

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



Subject: Possible setstat bug when using rput
Date: Tue, 2 Dec 2014 17:20:06 +0000
To: "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org>
From: Karsten Wagner Bang <Karsten.Bang [...] ist.com>
## System information ## uname -a Linux udv-karsten 3.2.0-70-generic #105-Ubuntu SMP Wed Sep 24 19:49:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux perl -v This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi (with 57 registered patches, see perl -V for more detail) ## Problem ## I get the following error when I try to use $sftp->rput: "Could not upload files: Couldn't setstat remote file: This server does not support operations to modify file attributes" and all files have size 0 on the server.my %rputoptions = ( my %rputoptions = ( copy_time => 0, copy_perm => 0 ); $sftp->rput( $localfolder, $sftpfolder, %rputoptions) if ( $sftp->error ) { die "Could not establish the SFTP connection: ".$sftp->error; } But looping through the files myself and uploading them with $sftp->put does not return any error, and all files have the correct size: my %rputoptions = ( copy_time => 0, copy_perm => 0 ); for my $file ( @files ) { next if ($file =~ m/^\./); $sftp->put( "$localfolder/$file", "$sftpfolder/$file", %rputoptions); if ( $sftp->error ) { die "Could not upload file: ".$sftp->error; } } The files are regular files, no folders or hidden files. I think it might have something to do with the following code in /Net/SFTP/Foreign.pm line 2866 The option copy_perm is missing in the call to sftp->put. if ($sftp->put($fn, $rpath, perm => ($copy_perm ? $e->{a}->perm : 0777) & $mask, copy_time => $copy_time, %put_opts)) {
Subject: Re: [rt.cpan.org #100669] Possible setstat bug when using rput
Date: Tue, 2 Dec 2014 19:14:31 +0000 (UTC)
To: "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org>
From: Salvador Fandino <sfandino [...] yahoo.com>
Show quoted text
----- Original Message -----
> From: Karsten Wagner Bang via RT <bug-Net-SFTP-Foreign@rt.cpan.org> > To: > Cc: > Sent: Tuesday, December 2, 2014 6:20 PM > Subject: [rt.cpan.org #100669] Possible setstat bug when using rput > >T ue Dec 02 12:20:22 2014: Request 100669 was acted upon. > Transaction: Ticket created by Karsten.Bang@ist.com > Queue: Net-SFTP-Foreign > Subject: Possible setstat bug when using rput > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: Karsten.Bang@ist.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=100669 > > > > ## System information ## > > uname -a > Linux udv-karsten 3.2.0-70-generic #105-Ubuntu SMP Wed Sep 24 19:49:16 UTC 2014 > x86_64 x86_64 x86_64 GNU/Linux > > perl -v > This is perl 5, version 14, subversion 2 (v5.14.2) built for > x86_64-linux-gnu-thread-multi > (with 57 registered patches, see perl -V for more detail) > > ## Problem ## > > I get the following error when I try to use $sftp->rput: > "Could not upload files: Couldn't setstat remote file: This server does > not support operations to modify file attributes" and all files have size 0 > on the server.my %rputoptions = ( > my %rputoptions = ( > copy_time => 0, > copy_perm => 0 > ); > $sftp->rput( $localfolder, $sftpfolder, %rputoptions) > if ( $sftp->error ) { > die "Could not establish the SFTP connection: ".$sftp->error; > }
I have just uploaded version 1.58_03 to CPAN, it should fix your issue. Could you try it? https://metacpan.org/release/SALVA/Net-SFTP-Foreign-1.78_03
Subject: [rt.cpan.org #100669] Possible setstat bug when using rput
Date: Wed, 3 Dec 2014 10:05:30 +0000
To: "bug-Net-SFTP-Foreign [...] rt.cpan.org" <bug-Net-SFTP-Foreign [...] rt.cpan.org>
From: Karsten Wagner Bang <Karsten.Bang [...] ist.com>
Show quoted text
> I have just uploaded version 1.58_03 to CPAN, it should fix your issue. > Could you try it? > https://metacpan.org/release/SALVA/Net-SFTP-Foreign-1.78_03
It works perfectly. Thank you =)
Ok, I would re-release it as a stable release in a couple of weeks if no new bugs arise. Rhank you for reporting the bug and for the feedback!