scp: Problem when source and destination are identical

Markus Friedl Markus.Friedl at informatik.uni-erlangen.de
Fri May 25 19:39:21 EST 2001


On Thu, May 24, 2001 at 10:25:23PM +0200, Gert Doering wrote:
> On Thu, May 24, 2001 at 01:08:30PM +0200, Markus Friedl wrote:
> > > > What i would much rather see is for the destination scp to write the
> > > > incoming file to a temporary file in the same directory, and then
> > > > rename() it to the destination file on a successful copy.
> > > 
> > > Strongly seconded.  But Markus doesn't seem to like it, for no other
> > > reason than "you can use tar/mv/rsync to do this".
> > 
> > no, the reason is: scp == rcp
> 
> Just because rcp has been implemented as "very unflexible" in the past
> (I'd go so far and call it "broken"), does this mean we have to break 
> scp as well?

scp is not 'broken'.  your suggested change will break both scp and rcp.

this patch may fix this special use. however, it will break scp/rcp
into a directory when you can only write this particular file and
not the directory.  moreover, it will change the scp/rcp behaviour
if the partition is almost full. and so on.



More information about the openssh-unix-dev mailing list