GithubHelp home page GithubHelp logo

Incorrectly resolves symlinks about dua-cli HOT 7 CLOSED

byron avatar byron commented on July 29, 2024
Incorrectly resolves symlinks

from dua-cli.

Comments (7)

Byron avatar Byron commented on July 29, 2024

Right now there is no special handling of symbolic links, and counting them at all as the files they point to is something I would want to avoid in future. Right now DUA relies on the file metadata provided by the metadata() call of the Rust std, which follows symbolic links.

from dua-cli.

vks avatar vks commented on July 29, 2024

I think this is very dangerous, because recursive deleting may follow the links, possibly deleting the whole home folder.

from dua-cli.

 avatar commented on July 29, 2024

Indeed, traversal follows symlinks. Additionally, symlinks are not currently displayed as such and appear like real files. The latter can certainly be fixed during display, as a first step towards making it more clear what's going on. Not following symlinks at all would require a change in the jwalk create I believe.

However, when deleting files and directories, dua will not follow symbolic links and behave as one would expect. This fix was introduced in v2.1.9.

from dua-cli.

vks avatar vks commented on July 29, 2024

Not following symlinks at all would require a change in the jwalk create I believe.

That is true, but I think it only applies to the non-interactive mode of dua.

However, when deleting files and directories, dua will not follow symbolic links and behave as one would expect. This fix was introduced in v2.1.9.

I think the fix was not correct, see #27.

from dua-cli.

vks avatar vks commented on July 29, 2024

Also see Byron/jwalk#7.

from dua-cli.

vks avatar vks commented on July 29, 2024

This issue should be fixed now for the interactive mode, for the aggregate mode this needs to be fixed in jwalk first.

from dua-cli.

Byron avatar Byron commented on July 29, 2024

As symbolic links are not followed, this issue should.

There is still a special case which is dua or dua *, which is when it ignores top-level symbolic links entirely. That can be confusing, as one would still expect them to show up like any other symbolic link. If this is an issue, a new one could be opened for that alone.

Thank you

from dua-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.