]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
ext2fs: don't normalize names on -F directories
authorGabriel Krisman Bertazi <krisman@collabora.com>
Sun, 28 Apr 2019 20:45:41 +0000 (16:45 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 28 Apr 2019 20:45:41 +0000 (16:45 -0400)
As agreed on the new design, even if fname_encoding is enabled,
directories entries who aren't owned by a +F directory will not be
normalized.

Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/dirhash.c

index f1e7734d38656d2391726323ae5e41b8551e858c..b9afb599c0fabbeff41675718511a9b435357f24 100644 (file)
@@ -281,15 +281,11 @@ errcode_t ext2fs_dirhash2(int version, const char *name, int len,
        int dlen;
        unsigned char *buff;
 
-       if (len && charset) {
+       if (len && charset && (hash_flags & EXT4_CASEFOLD_FL)) {
                char buff[PATH_MAX];
 
-               if (hash_flags & EXT4_CASEFOLD_FL)
-                       dlen = charset->ops->casefold(charset, name, len, buff,
+               dlen = charset->ops->casefold(charset, name, len, buff,
                                                      sizeof(buff));
-               else
-                       dlen = charset->ops->normalize(charset, name, len, buff,
-                                                      sizeof(buff));
                if (dlen < 0) {
                        if (dlen == -EINVAL)
                                goto opaque_seq;