]> git.apps.os.sepia.ceph.com Git - fscrypt.git/commit
filesystem: preserve metadata file permissions on updates
authorEric Biggers <ebiggers@google.com>
Wed, 23 Feb 2022 20:35:04 +0000 (12:35 -0800)
committerEric Biggers <ebiggers@google.com>
Wed, 23 Feb 2022 20:35:04 +0000 (12:35 -0800)
commit312bc381a3751e397995eeb2e63e66856912fafb
treeb69109b9e4ebdfddd522a5bef714fe6fb1e14fd5
parentd4ce0b892cbe68db9f90f4015342e6a9069b079c
filesystem: preserve metadata file permissions on updates

Since fscrypt replaces metadata files rather than overwrites them (to
get atomicity), their owner will change to root if root makes a change.
That isn't too much of an issue when the files have mode 0644.  However,
it will become a much bigger issue when the files have mode 0600,
especially because existing files with mode 0644 would also get changed
to have mode 0600.

In preparation for this, start preserving the previous owner and mode of
policy and protector files when they are updated.
filesystem/filesystem.go