Skip to content

Add basic UnixFS sanity check to 'ipfs files cp' #10331

@lidel

Description

@lidel

#7999, #8144, #7172 still hunts us ipfs/ipfs-webui#2205.

I think we should make ipfs files cp /ipfs/cid /mfs-destination at least check the root cid, and error if it is not a valid UnixFS node or has codec other than raw or dag-pb.

This way it is less likely people import non-UnixFS to MFS (majority of time, it will be root cid at fault). This would fix both CLI and ipfs-webui.

ps. while we are at this, we should also add --force mentioned in #2074 (we already have it for rm, but not cp)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps uphelp wantedSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)topic/MFSTopic MFS

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions