BUG: scp -r follows symlinks

Bob Proulx bob at proulx.com
Wed Jan 7 04:08:03 EST 2004


Christian Vogel wrote:
> Also not touching ssh, and also just as an example, my favourite misfeature
> using cp:
> 
> 	mkdir a
> 	touch a/b
> 	cp -r a c  (first time)
> 	cp -r a c  (again)
> 		-> creates dir c/c, file c/c/b

Try that example again using 'ln -s' and you will see the same issue
all over again.  (BSD has the ln -n option to work around this.  But it
is not portable.  Argh.)

  mkdir a
  touch a/b
  ln -sf a c  (first time)
  ln -sf a c  (again)
		-> creates c/a symlink to a

Let's face it, the addition of symlinks to UNIX threw a wrench into
the works of which we are still seeing the effects.  But symlinks are
too useful to do without now.

Bob




More information about the openssh-unix-dev mailing list