Mailing List Archive

[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@mindrot.org
ReportedBy: wood@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@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.
_______________________________________________
openssh-bugs mailing list
openssh-bugs@mindrot.org
http://lists.mindrot.org/mailman/listinfo/openssh-bugs
[Bug 1236] SCP inappropriate truncate error when copying to FIFO file [ In reply to ]
http://bugzilla.mindrot.org/show_bug.cgi?id=1236





------- Comment #1 from wood@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.
_______________________________________________
openssh-bugs mailing list
openssh-bugs@mindrot.org
http://lists.mindrot.org/mailman/listinfo/openssh-bugs