[Bug 1236] SCP inappropriate truncate error when copying to FIFO file

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Mon Sep 25 11:43:52 EST 2006


           Summary: SCP inappropriate truncate error when copying to FIFO
           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.

#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.

More information about the openssh-bugs mailing list