Open znewsham opened 9 months ago
Confirmed bug; but we need something more complicated than your proposed fix. We can't simply ignore these checks when we're not dereferencing; just one example case: https://github.com/jprichardson/node-fs-extra/blob/a277cbbdf630424482b1e7418749ccaac0db98fe/lib/copy/__tests__/copy-prevent-copying-into-itself.test.js#L351
There is a bug when copying a directory containing a symlink onto itself (e.g., if you were making an rsync type utility):
If
options.dereference
is not set, thenresolvedSrc
andresolvedDest
will always be equal - since they are the value of the symlink.this code needs to be changed to
Probably a similar change is required here: