havardgulldahl / jottalib

A library to access files stored at jottacloud.com.
GNU General Public License v3.0
83 stars 19 forks source link

Range end index larger than file size #43

Closed jkaberg closed 9 years ago

jkaberg commented 9 years ago

ref https://github.com/havardgulldahl/jottalib/commit/6cae757bd9ceefa347919f495a1426220dc19f45

joel@dunder:/media/jotta/.../x# cat .encfs6.xml
<?xml version="1.0" encoding="UTF-8"?>

<error>
  <code>416</code>
  <message>no.jotta.backup.errors.RequestedRangeNotSatisfiedException: Range end index larger than file size; rangeEndIndex=4095, filesize=1082</message>
  <reason>Requested Range Not Satisfiable</reason>
  <hostname>dn-097.site-000.jotta.no</hostname>
</error>

This is simple to reproduce, just do (after mounting jottafuse.py)

cat file-with-contents

havardgulldahl commented 9 years ago

I can confirm the bug.

Based on preliminary testing, it seems like a linux bug, where the gnu utils will happily ask for data larger than the file size, whereas the osx/bsd utils only request up until file size.

Sorry about this, I didn't run the fusetest.sh script on my linux machine, so I didn't catch this.

I'll find a way to fix this. Thanks for your report.

havardgulldahl commented 9 years ago

Also, there is a second bug here. cat shouldn't return the error message silently. cat should fail here.

jkaberg commented 9 years ago

@havardgulldahl just wanted to point out - this worked fine with ver 0.2.10