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

ipfs add doesnt handle broken symlinks #979

Closed
whyrusleeping opened this issue Mar 29, 2015 · 6 comments
Closed

ipfs add doesnt handle broken symlinks #979

whyrusleeping opened this issue Mar 29, 2015 · 6 comments
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) topic/commands Topic commands

Comments

@whyrusleeping
Copy link
Member

running ipfs add on a directory containing broken symlinks will cause unexpected behaviour. Depending on a few different factors, this may cause a hang or just an early exit and leave the operation unfinished.

@whyrusleeping whyrusleeping added kind/bug A bug in existing code (including security flaws) topic/commands Topic commands difficulty: easy labels Mar 29, 2015
@jbenet jbenet mentioned this issue Mar 31, 2015
52 tasks
@jbenet
Copy link
Member

jbenet commented Apr 1, 2015

We should start with a test case


Sent from Mailbox

On Sun, Mar 29, 2015 at 12:10 PM, Jeromy Johnson notifications@github.com
wrote:

running ipfs add on a directory containing broken symlinks will cause unexpected behaviour. Depending on a few different factors, this may cause a hang or just an early exit and leave the operation unfinished.

Reply to this email directly or view it on GitHub:
#979

@cryptix
Copy link
Contributor

cryptix commented Apr 6, 2015

@whyrusleeping can you share some reproduction insight on this one? I tried the following but it works as expected (for me at least).

[cryptix@higgs /tmp/ipfsSymlink] ls
[cryptix@higgs /tmp/ipfsSymlink] dd if=/dev/urandom of=test bs=1k count=100
100+0 records in
100+0 records out
102400 bytes (102 kB) copied, 0.00661302 s, 15.5 MB/s
[cryptix@higgs /tmp/ipfsSymlink] ln -s test simpleLink
[cryptix@higgs /tmp/ipfsSymlink] ipfs add *
added QmZePokqaRebXVmcWiSJyZfiqFqUSoHggWErbE9Q2H1Vex simpleLink
added QmZePokqaRebXVmcWiSJyZfiqFqUSoHggWErbE9Q2H1Vex test
[cryptix@higgs /tmp/ipfsSymlink] ln -s please/please/dont/exist broken_link && ipfs add broken_link
Error: open broken_link: no such file or directory

Use 'ipfs add --help' for information about this command
[cryptix@higgs /tmp/ipfsSymlink] cd ..
[cryptix@higgs /tmp] ipfs add -r ipfsSymlink
Error: Post http://127.0.0.1:5001/api/v0/add\?encoding\=json\&progress\=true\&r\=true\&stream-channels\=true: open ipfsSymlink/broken_link: no such file or directory

@whyrusleeping
Copy link
Member Author

repro steps:

$ mkdir a
$ echo "some real content" > a/b
$ ln -s /does/not/exist a/badlink
$ ipfs add -r a

This example should fail with an error, but given a larger directory (an entire docker filesystem, with a bad link somewhere) generally causes it to hang

@jbenet jbenet mentioned this issue Apr 6, 2015
42 tasks
@wking
Copy link
Contributor

wking commented Jun 24, 2015

On Sun, Mar 29, 2015 at 12:10:55PM -0700, Jeromy Johnson wrote:

running ipfs add on a directory containing broken symlinks will
cause unexpected behaviour.

With #1413 I'm closing in on adding symlinks to IPFS as symlinks
(instead of dereferencing them). I think that means we can close this
issue in favor of #616.

@jbenet
Copy link
Member

jbenet commented Jun 25, 2015

@wking people often search with open:issues in the filters, or subscribe. no harm in waiting to close till it's merged

@whyrusleeping
Copy link
Member Author

closed by #1627

@RichardLitt RichardLitt added the exp/novice Someone with a little familiarity can pick up label Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) topic/commands Topic commands
Projects
None yet
Development

No branches or pull requests

5 participants