bugzilla-daemon at mindrot.org
2006-Sep-25  01:43 UTC
[Bug 1236] SCP inappropriate truncate error when copying to FIFO file
http://bugzilla.mindrot.org/show_bug.cgi?id=1236
           Summary: SCP inappropriate truncate error when copying to FIFO
                    file
           Product: Portable OpenSSH
           Version: 4.3p2
          Platform: ix86
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: scp
        AssignedTo: bitbucket at mindrot.org
        ReportedBy: wood at xmission.com
This is an obscure error, but one that I have encountered in a real
world application.
When you use scp to copy a file to a remote FIFO file,
the internal function call to ftruncate() has to fail, 
since a FIFO cannot be
truncated to the size of the original file. This results in
a reported error at the command line, even though the data actually
copies as commanded.
Example:
------------------------------------------------------
#scp -B -q afile auser at aserver.com:/tmp/fifofile_input
scp: /tmp/fifofile_input: truncate: Invalid argument
----------------------------------------------
This results in the contents of the file 'afile' being copied
into the remote fifo, but the error is reported and
the exit status is also set to 1.
Suggested fix:
One must add a file status check that the destination file is not
a FIFO file before trying the truncate call (line 994 in unpatched
4.3p2 scp.c).
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
bugzilla-daemon at mindrot.org
2006-Sep-25  01:46 UTC
[Bug 1236] SCP inappropriate truncate error when copying to FIFO file
http://bugzilla.mindrot.org/show_bug.cgi?id=1236 ------- Comment #1 from wood at xmission.com 2006-09-25 11:46 ------- Created an attachment (id=1189) --> (http://bugzilla.mindrot.org/attachment.cgi?id=1189&action=view) Add test for FIFO file in scp.c prior to truncate attempt. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.
Possibly Parallel Threads
- [Bug 1236] SCP inappropriate truncate error when copying to FIFO file
- [Bug 1236] SCP inappropriate truncate error when copying to FIFO file
- 3 Bugs to Report: OpenSSH V1.2pre13
- /bin/tar bug
- [Bug 11521] New: rsync does not use high-resolution timestamps to determine file differences