You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say we have a regular file regularfile, and two symlinks to it, symlink and hop. Then we have an additional symlink indirect_symlink which points to hop. For most intents and purposes, indirect_symlink points to regularfile, but technically it doesn't, and this difference is visible in ls and would also change completely if hop ever points somewhere else or becomes a (different) regular file.
Now cpshould replace indirect_symlink by a hardlink-copy of symlink, but our current implementation says "Eh, everything is fine!" and does nothing, which is just wrong. The -v in the example below is just for illustration.
$ ln -s README.md symlink
$ ln -s README.md hop
$ rm -f indirect_symlink && ln -s hop indirect_symlink && ls -1i README.md symlink hop indirect_symlink && cp -vlP symlink indirect_symlink && ls -1i README.md symlink hop indirect_symlink20092600 README.md20074249 hop20074347 indirect_symlink20074037 symlinkremoved 'indirect_symlink''symlink' -> 'indirect_symlink'20092600 README.md20074249 hop20074037 indirect_symlink20074037 symlink
$ readlink indirect_symlink # Points directly to README.mdREADME.md
$ rm -f indirect_symlink && ln -s hop indirect_symlink && ls -1i README.md symlink hop indirect_symlink && cargo run -q cp -vlP symlink indirect_symlink && ls -1i README.md symlink hop indirect_symlink20092600 README.md20074249 hop20074347 indirect_symlink20074037 symlink20092600 README.md20074249 hop20074347 indirect_symlink20074037 symlink
$ readlink indirect_symlink # It didn't even get rewritten!hop
Found while reading #6496, but only remotely related.
The text was updated successfully, but these errors were encountered:
Let's say we have a regular file
regularfile
, and two symlinks to it,symlink
andhop
. Then we have an additional symlinkindirect_symlink
which points tohop
. For most intents and purposes,indirect_symlink
points toregularfile
, but technically it doesn't, and this difference is visible inls
and would also change completely ifhop
ever points somewhere else or becomes a (different) regular file.Now
cp
should replaceindirect_symlink
by a hardlink-copy ofsymlink
, but our current implementation says "Eh, everything is fine!" and does nothing, which is just wrong. The-v
in the example below is just for illustration.Found while reading #6496, but only remotely related.
The text was updated successfully, but these errors were encountered: