From 3e3e7af1a49273a5e49d50565b3b079a2ab19142 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 7 May 2020 23:42:12 +1000 Subject: shell: Always use explicit large file API There are some remaining stat/readdir calls in dash that may lead to spurious EOVERFLOW errors on 32-bit platforms. This patch changes them (as well as open(2)) to use the explicit large file API. Reported-by: Tatsuki Sugiura Signed-off-by: Herbert Xu --- src/expand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/expand.c') diff --git a/src/expand.c b/src/expand.c index 985cd70..1730670 100644 --- a/src/expand.c +++ b/src/expand.c @@ -1284,7 +1284,7 @@ expmeta(char *name, unsigned name_len, unsigned expdir_len) int metaflag; struct stat64 statb; DIR *dirp; - struct dirent *dp; + struct dirent64 *dp; int atend; int matchdot; int esc; @@ -1361,7 +1361,7 @@ expmeta(char *name, unsigned name_len, unsigned expdir_len) p++; if (*p == '.') matchdot++; - while (! int_pending() && (dp = readdir(dirp)) != NULL) { + while (! int_pending() && (dp = readdir64(dirp)) != NULL) { if (dp->d_name[0] == '.' && ! matchdot) continue; if (pmatch(start, dp->d_name)) { -- cgit 1.4.1