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

ipld/unixfs: Dagreader ignores internal data node when links are present #390

Open
ellttBen opened this issue May 27, 2020 · 1 comment
Open
Labels
kind/bug A bug in existing code (including security flaws) need/analysis Needs further analysis before proceeding P1 High: Likely tackled by core team if no one steps up

Comments

@ellttBen
Copy link

Hello!

I'm currently studying a use case for go-ipfs in which a file node contains links to other versions of itself.
This all works well until the root file becomes small enough to fit inside the root's data node. Then, accessing the file through ipfs cat or the gateway skips the data node and goes on to read from the child nodes.
After investigating the bug, I found that it originated from go-unixfs, and especially the dagreader.
More precisely, https://github.com/ipfs/go-unixfs/blob/68c015a6f317ed5e21a4870f7c423a4b38b90a96/io/dagreader.go#L175-L179

I already have a fix for this if there is any interest, although it relies on the empirical assumption that we should stop descending through the DAG when we read a node that has named links (len(node.Links()[0].Name) != 0).

This would also close ipfs/kubo#7190 , which I opened a month ago.

@ellttBen ellttBen added the need/triage Needs initial labeling and prioritization label May 27, 2020
@aschmahmann aschmahmann added kind/bug A bug in existing code (including security flaws) need/analysis Needs further analysis before proceeding P2 Medium: Good to have, but can wait until someone steps up P1 High: Likely tackled by core team if no one steps up and removed need/triage Needs initial labeling and prioritization P2 Medium: Good to have, but can wait until someone steps up labels Apr 5, 2021
@aschmahmann
Copy link
Contributor

aschmahmann commented Apr 5, 2021

This may be solved with the migration to a newer unixfs parser like https://github.com/ipfs/go-unixfsnode

@ipfs ipfs deleted a comment from welcome bot Jun 26, 2023
@Jorropo Jorropo changed the title Dagreader ignores internal data node when links are present ipld/unixfs: Dagreader ignores internal data node when links are present Jun 26, 2023
@Jorropo Jorropo transferred this issue from ipfs/go-unixfs Jun 26, 2023
@ipfs ipfs deleted a comment from welcome bot Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/analysis Needs further analysis before proceeding P1 High: Likely tackled by core team if no one steps up
Projects
No open projects
Archived in project
Development

No branches or pull requests

2 participants