From 21bee694acd508f87e97b2c89df13fb9eff6d3cb Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 25 Jun 2015 16:10:35 +0200 Subject: [PATCH] Increase limitation number of files which can be listed using glob in sftp --- openssh-5.8p1-glob.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openssh-5.8p1-glob.patch b/openssh-5.8p1-glob.patch index cb45cd1..fe8a3d4 100644 --- a/openssh-5.8p1-glob.patch +++ b/openssh-5.8p1-glob.patch @@ -8,3 +8,17 @@ diff -up openssh-5.8p1/sftp-glob.c.glob openssh-5.8p1/sftp-glob.c - return(glob(pattern, flags | GLOB_ALTDIRFUNC, errfunc, pglob)); + return(glob(pattern, flags | GLOB_LIMIT | GLOB_ALTDIRFUNC, errfunc, pglob)); } +diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c +index 742b4b9..acae399 100644 +--- a/openbsd-compat/glob.c ++++ b/openbsd-compat/glob.c +@@ -130,7 +130,7 @@ typedef char Char; + #define ismeta(c) (((c)&M_QUOTE) != 0) + + #define GLOB_LIMIT_MALLOC 65536 +-#define GLOB_LIMIT_STAT 128 ++#define GLOB_LIMIT_STAT 1024 + #define GLOB_LIMIT_READDIR 16384 + + /* Limit of recursion during matching attempts. */ +