diff options
author | Jakob Unterwurzacher | 2021-06-02 14:21:30 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2021-06-02 14:29:48 +0200 |
commit | 04858ddd222bbf7156f33f99cfb293a9b1e15ec8 (patch) | |
tree | 732cbf83c9d842a911d515abbad7c153c4159354 /internal/fusefrontend_reverse/root_node.go | |
parent | 242cdf966f262b2e20785eb0ff49ac55a8bd4636 (diff) |
nametransform: check name validity on encryption
xfstests generic/523 discovered that we allowed to set
xattrs with "/" in the name, but did not allow to read
them later.
With this change we do not allow to set them in the first
place.
Diffstat (limited to 'internal/fusefrontend_reverse/root_node.go')
-rw-r--r-- | internal/fusefrontend_reverse/root_node.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/fusefrontend_reverse/root_node.go b/internal/fusefrontend_reverse/root_node.go index b7a259a..10b0d69 100644 --- a/internal/fusefrontend_reverse/root_node.go +++ b/internal/fusefrontend_reverse/root_node.go @@ -71,9 +71,12 @@ func (rn *RootNode) findLongnameParent(fd int, diriv []byte, longname string) (p if len(entry.Name) <= shortNameMax { continue } - cFullName = rn.nameTransform.EncryptName(entry.Name, diriv) + cFullName, err = rn.nameTransform.EncryptName(entry.Name, diriv) + if err != nil { + continue + } if len(cFullName) <= unix.NAME_MAX { - // Entry should have been skipped by the "continue" above + // Entry should have been skipped by the shortNameMax check above log.Panic("logic error or wrong shortNameMax constant?") } hName := rn.nameTransform.HashLongName(cFullName) |