Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

another recursive copy #57

Open
enthor opened this issue Apr 15, 2021 · 6 comments
Open

another recursive copy #57

enthor opened this issue Apr 15, 2021 · 6 comments

Comments

@enthor
Copy link

enthor commented Apr 15, 2021

Copy("test/data.copy", "test/data.copy/alltestdata")

Note: when I found the alltestdata and deleted it, MacOS refused to empty the trash
because "pathname too long". I tried sudo rm etc but "invalid operation". So the
solution if cannot empty trash: drag items out of trash to, say, Downloads and
then just "rm" them.

@otiai10
Copy link
Owner

otiai10 commented Apr 16, 2021

that's circular reference

@enthor
Copy link
Author

enthor commented Apr 16, 2021 via email

@otiai10
Copy link
Owner

otiai10 commented Apr 16, 2021

Let me clarify your point.
Do you mean we, the package, should detect circular reference on behalf of package users?

@enthor
Copy link
Author

enthor commented Apr 16, 2021 via email

@enthor
Copy link
Author

enthor commented Apr 21, 2021 via email

@enthor
Copy link
Author

enthor commented Apr 22, 2021

ok, i defeated malicious symlinks - as far as I know.

see github.com/enthor/kmdrv0/kopy#testSkipBrokenSymlinks()

and test/data/broken/README.txt

The only "broken" symlinks which may safely be skipped are of the variety:

errors.Is(err, os.ErrNotExist)

Other os.Stat() errors -- when treating the Symlink as just a file -- cannot
be skipped safely because they may be of the variety "too many symlinks".
The process must be halted at that point, but at least the program errors out
and not the OS or a golang function, so the code would appear to be safe
from a hacker installing a malicious symlink.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants