projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c08b0eb
)
storage.py: assert that immutable share size will fit in the 4-byte v1 container...
author
Brian Warner
<warner@lothar.com>
Mon, 20 Oct 2008 17:22:08 +0000
(10:22 -0700)
committer
Brian Warner
<warner@lothar.com>
Mon, 20 Oct 2008 17:22:08 +0000
(10:22 -0700)
src/allmydata/storage.py
patch
|
blob
|
history
diff --git
a/src/allmydata/storage.py
b/src/allmydata/storage.py
index 59d671da45c92d6c8c84c0fc48077b628685199d..8098edbc0be1227f03733716d16b63b92ff27612 100644
(file)
--- a/
src/allmydata/storage.py
+++ b/
src/allmydata/storage.py
@@
-236,6
+236,7
@@
class BucketWriter(Referenceable):
fileutil.make_dirs(os.path.dirname(incominghome))
# Also construct the metadata.
f = open(incominghome, 'wb')
+ precondition(size < 2**32) # v1 container format: 4-byte size field
f.write(struct.pack(">LLL", 1, size, 0))
f.close()
self._sharefile = ShareFile(incominghome)