summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/glob.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Make gl_pathc, gl_matchc and gl_offs size_t in glob_t to match POSIX.millert2019-02-041-17/+16
| | | | This requires a libc major version bump. OK deraadt@
* Fix exponential CPU use with repeated '*' operators by changing '*'millert2017-05-081-21/+34
| | | | | handling to be interative instead of recursive. Fix by Yves Orton, ported to OpenBSD glob.c by Ray Lai. OK tb@
* Remove NULL-checks before free() and a few related dead assignments.mmcc2015-12-281-9/+5
| | | | ok and valuable input from millert@
* Use reentrant versions of getpw{nam,uid} and getgr{nam,gid} withinmillert2015-11-241-5/+9
| | | | | | | libc to avoid reusing the static buffers returned by the non-reentrant versions. Since this is inside libc we can use constants for the buffer sizes instead of having to call sysconf(). OK guenther@ deraadt@
* remove null check before free. from Michael McConvilletedu2015-09-141-5/+3
| | | | ok semarie
* in glob() initialize the glob_t before the first failure check.deraadt2015-06-131-4/+4
| | | | | from j@pureftpd.org ok millert stsp
* Include stdint.h, not limits.h to get SIZE_MAX. OK guenther@millert2015-02-051-1/+2
|
* obvious realloc -> reallocarray conversionderaadt2014-10-081-3/+3
|
* Use PATH_MAX, NAME_MAX and LOGIN_NAME_MAX not MAXPATHNAMELEN,millert2013-09-301-15/+14
| | | | MAXNAMLEN or MAXLOGNAME where possible. OK deraadt@
* the glob stat limit is way too low. bump to 2048.tedu2012-01-201-4/+4
| | | | | while here, failed stats should count against the limit too. ok deraadt sthen stsp
* fix GLOB_KEEPSTAT without GLOB_NOSORT; the implicit sort was beingdjm2011-09-221-6/+44
| | | | | applied only to the gl_pathv vector and not the corresponding gl_statv array. reported in OpenSSH bz#1935; feedback and okay matthew@
* In glob(3), limit recursion during matching attempts. Similar to fnmatch fix.stsp2011-09-201-5/+17
| | | | | Also collapse consecutive '*' (from NetBSD). ok miod deraadt
* When the max number of items for a directory has reached GLOB_LIMIT_READDIRpyr2011-05-121-2/+3
| | | | | | | | an error is returned but closedir() is not called. spotted and fix provided by Frank Denis obsd-tech@pureftpd.org ok otto@, millert@
* avoid some integer overflows mostly with GLOB_APPEND and GLOB_DOOFFSdjm2011-01-121-4/+12
| | | | | | and sanity check arguments (these will be unnecessary when we switch struct glob members from being type into to size_t in the future); "looks ok" tedu@ feedback guenther@
* Extend GLOB_LIMIT to cover readdir and stat and bump the malloc limitnicm2010-10-081-27/+63
| | | | | | | | | | | from ARG_MAX to 64K. Fixes glob-using programs (notably ftp) able to be triggered to hit resource limits. Idea from a similar NetBSD change, original problem reported by jasper@. ok millert tedu jasper
* oops, don't free array before freeing members; spotted by dkrause@djm2010-09-261-2/+2
|
* add a GLOB_KEEPSTAT option that retains a copy of the struct statdjm2010-09-241-14/+62
| | | | | | | | | | | information that is looked up while matching glob(3)s Keeping this information around can make a big difference when fetching it is expensive, e.g. in sftp which uses GLOB_ALTDIRFUNC feedback millert@ jmc@ "get it in before the libc crank" deraadt@
* remove unused variablechl2010-05-191-2/+1
| | | | ok nicm@
* Fix glob(3) to correctly return an error when its buffer space isnicm2010-03-231-13/+11
| | | | | | | | | | exhausted and GLOB_BRACE is given. globexp2() was ignoring errors returned from lower levels. While here, change globexp2() to return its return value normally rather putting it in a int pointer then always returning 0. ok otto
* replacing malloc/realloc dance, by only one reallocchl2009-11-211-3/+2
| | | | ok millert@
* Add missing braces. This is why we use braces for indented block thatmillert2009-02-181-2/+3
| | | | are more than a couple of lines...
* POSIX character class support for fnmatch(3) and glob(3). OK deraadt@millert2008-10-011-6/+72
|
* unused arg in internal static APIderaadt2005-11-281-6/+6
|
* zap remaining rcsid.espie2005-08-081-8/+1
| | | | | | Kill old files that are no longer compiled. okay theo
* Kill register and fix some whilespace goofs in a do {} while loop.millert2004-10-071-12/+11
|
* ansify function definitions and zap some `register'jfb2004-05-181-67/+23
| | | | ok millert@
* protosderaadt2003-06-251-3/+3
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* spelling; from Brian Poole <raj@cerias.purdue.edu>todd2002-06-141-2/+2
|
* try to use strlcpy and snprintf more; ok variousderaadt2002-05-241-2/+2
|
* Manual cleanup of remaining userland __P use (excluding packages maintained outside the tree)millert2002-02-171-5/+5
|
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-16/+16
|
* remove extra continue statementsderaadt2001-04-051-11/+17
|
* use a len in g_Ctoc, easier code; freebsdderaadt2001-04-021-21/+18
|
* Fix some glob defects:millert2001-03-281-29/+56
| | | | | | | | o use MAXPATHLEN, not MAXPATHLEN + 1 o when manipulating static buffers, pass functions a pointer to the end of the buffer so we can avoid any overflows Work by Theo and myself.
* must spec +1 in this one case...deraadt2001-03-281-2/+2
|
* avoid g_Ctoc() overflows; art@ okderaadt2001-03-281-14/+26
|
* KNFderaadt2001-03-281-31/+12
|
* set gl_pathv to NULL after we free it; christos@netbsd.orgmillert2001-03-191-2/+5
|
* GLOB_LIMIT changes from christosderaadt2001-03-181-22/+38
|
* realloc repairderaadt1998-08-141-2/+5
|
* Add GLOB_NOESCAPE to turn off backslash escaping and make backslash escapingmillert1998-01-311-5/+5
| | | | the default. For xpg4.2.
* Make glob(3) XPG4.2 compliant. This means changing GLOB_ABEND tomillert1997-09-011-10/+14
| | | | | GLOB_ABORT and defining GLOB_NOMATCH and GLOB_NOSYS (the latter is not used).
* Different fix for buffer overflow. From Keith Bostic <bostic@bostic.com>millert1997-04-121-35/+39
|
* be careful in the non-setuid case too, what the heckderaadt1996-10-271-1/+4
|
* protect $HOME expansion; from das33@cornell.eduderaadt1996-09-111-2/+2
|
* Fix RCS idstholo1996-08-191-7/+1
| | | | Make sure everything uses {SYS,}LIBC_SCCS properly
* initial import of NetBSD treederaadt1995-10-181-0/+852