How to reproduce: $ ln -s non-exist tgt $ cp /etc/passwd tgt cp: not writing through dangling symlink `tgt'
As we see, cp know, that if retval EEXIST and target is symlink, special responce given. Now, try to add slash at the end of target: $ cp /etc/passwd tgt/ cp: cannot create regular file `tgt/': Is a directory Novices can not understand this message :) cp should check if (target is symlink and error is EISDIR) and report message like this: cp: Trying to use dangling symlink `tgt' as a directory -- Segmentation fault
