libgocryptfs: preserve folders size

This commit is contained in:
Matéo Duparc 2021-07-10 11:59:49 +02:00
parent 39af24d4e6
commit 47c6caf2d5
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E

View File

@ -172,7 +172,7 @@ func isSymlink(mode uint32) bool { return (mode & syscall.S_IFMT) == syscall.S_I
// Handles regular files & symlinks (and finds out what is what by looking at // Handles regular files & symlinks (and finds out what is what by looking at
// `out.Mode`). // `out.Mode`).
func (volume *Volume) translateSize(dirfd int, cName string, st *syscall.Stat_t) uint64 { func (volume *Volume) translateSize(dirfd int, cName string, st *syscall.Stat_t) uint64 {
var size uint64 size := uint64(st.Size)
if isRegular(st.Mode) { if isRegular(st.Mode) {
size = volume.contentEnc.CipherSizeToPlainSize(uint64(st.Size)) size = volume.contentEnc.CipherSizeToPlainSize(uint64(st.Size))
} else if isSymlink(st.Mode) { } else if isSymlink(st.Mode) {