]> arthur.barton.de Git - bup.git/blobdiff - lib/bup/cmd/midx.py
atomically_replaced_file: respect umask/sgid/etc. via tmpdir
[bup.git] / lib / bup / cmd / midx.py
index 81ffae71f5a2dd845d159139032f24c42455c599..1ff77f2a0f357674f50f73f2687e1929c3290608 100644 (file)
@@ -125,7 +125,7 @@ def _do_midx(outdir, outfilename, infilenames, prefixstr,
         debug1('midx: table size: %d (%d bits)\n' % (entries*4, bits))
 
         unlink(outfilename)
-        with atomically_replaced_file(outfilename, 'wb') as f:
+        with atomically_replaced_file(outfilename, 'w+b') as f:
             f.write(b'MIDX')
             f.write(struct.pack('!II', midx.MIDX_VERSION, bits))
             assert(f.tell() == 12)