]> arthur.barton.de Git - bup.git/commit
index.py: compute the index metadata offset more carefully.
authorRob Browning <rlb@defaultvalue.org>
Fri, 8 Nov 2013 00:33:43 +0000 (18:33 -0600)
committerRob Browning <rlb@defaultvalue.org>
Fri, 8 Nov 2013 00:40:15 +0000 (18:40 -0600)
commitada06e4653d6c50c6f4fe4def47684fe046c7305
tree254d7b48361d569c0f6cefd494ede8403972c0ad
parent9ad0231fc606f7f30cc037643481311354a103ae
index.py: compute the index metadata offset more carefully.

Previously when reading bupindex.meta (or similar), bup computed the
metadata file offset for it's internal lookup table by just
subtracting the size of a re-encoding of the metadata from file.tell()
after the read.  This works fine until we change the length of the
metadata representation (which we just did); then bup will get the
wrong length from the re-encoded data.

To fix this, do what we should have done originally and capture the
index metadata offset before reading the metadata via tell(), and use
that instead.

Thanks to Mark J Hewitt <mjh@idnet.com> for being the first (known)
victim and for helping track down the solution.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/index.py