From: Gabriel Krisman Bertazi Date: Sun, 28 Apr 2019 20:45:41 +0000 (-0400) Subject: ext2fs: don't normalize names on -F directories X-Git-Tag: v1.45.1-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8567fdb9367a1d792fc2c0733790f5f763d00f1;p=thirdparty%2Fe2fsprogs.git ext2fs: don't normalize names on -F directories 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 Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/dirhash.c b/lib/ext2fs/dirhash.c index f1e7734d3..b9afb599c 100644 --- a/lib/ext2fs/dirhash.c +++ b/lib/ext2fs/dirhash.c @@ -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;