Revert of: From 636a856232767b1fdf2396e2073ba859924a7d7f Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 8 Jun 2024 11:42:53 +0800 Subject: expand: Check d_type in expmeta before recursing If the directory pointer is not a directory, a symlink or an unknown entity, do not recurse into expmeta. Signed-off-by: Herbert Xu --- src/expand.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/expand.c') diff --git a/src/expand.c b/src/expand.c index 345c498..6912e39 100644 --- a/src/expand.c +++ b/src/expand.c @@ -1722,9 +1722,6 @@ static char *expmeta(char *name, unsigned name_len, size_t expdir_len) if (*dname == '.' && !matchdot) goto check_int; - if (c && dp->d_type != DT_DIR && dp->d_type != DT_LNK && - dp->d_type != DT_UNKNOWN) - goto check_int; len = strlen(dname) + 1; p = dname; if (!FNMATCH_IS_ENABLED) { -- cgit 1.3.1-korg