Don't write protect file if it is same

Add checksum check to config protect files
Add test file

Fixes #214
This commit is contained in:
Ettore Di Giacinto
2021-05-16 11:15:10 +02:00
parent 0de3177ddd
commit beeb0dcaaa
3 changed files with 132 additions and 4 deletions

View File

@@ -90,8 +90,7 @@ func UntarProtect(src, dst string, sameOwner bool, protectedFiles []string, modi
}
if sameOwner {
// PRE: i have root privileged.
// we do have root permissions, so we can extract keeping the same permissions.
replacerArchive := archive.ReplaceFileTarWrapper(in, mods)
opts := &archive.TarOptions{