]> arthur.barton.de Git - bup.git/commit
metadata: don't modify ACL list when writing
authorJohannes Berg <johannes@sipsolutions.net>
Sat, 30 May 2020 19:41:10 +0000 (21:41 +0200)
committerRob Browning <rlb@defaultvalue.org>
Fri, 19 Jun 2020 22:50:38 +0000 (17:50 -0500)
commitef6a285d75687f5f15144010d414af1d30dc4eb9
tree9c95e3a121d578c91ba13ad98c77b7458a8a19b2
parent887534c033738bd6b19464ca180b049e131d06a5
metadata: don't modify ACL list when writing

ACLs should be stored as a two-entry list on files, and four-entry
list for directories. Unfortunately, when writing, we expand the
two-entry list for files to four, because the metadata format is
always with four entries.

However, on reading, we trim the last two empty entries, so that
we can end up in an inconsistent situation: On a metadata entry
for a file that has been written already, it will still have four
entries, and that won't compare correctly etc.

This isn't an issue today because we only ever do the compare
in restore, where we didn't load from disk but from the meta-
data in the repository, which always starts out four entries.

Still, fix the inconsistency and don't erroneously extend the
list when writing.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/metadata.py