Commit Graph

23 Commits

Author SHA1 Message Date
christos
eb7e2c7da8 From Brian Ginsbach: Fix overflow detection, and only abort on long paths
when GLOB_ERR is set.
2001-09-18 16:37:26 +00:00
christos
20abba463b Selected fixes from Brian Ginsbach <ginsbach@cray.com>, modified by me.
- handle globbing of patterns that contain unmatched braces. Globbing
  a pattern "foo{" in a directory that contains "foo{" now works.
- check for MAXPATHLEN overflows during filename generation (security problem).
- Posix/XOpen fixes to always return GLOB_ABORTED when a directory open fails
  or when a file access fails.
- pathc was not initialized to 0 in one case.
Also
- rename err to error, so that it does not conflict with the libc function.
2001-09-08 22:39:21 +00:00
christos
4331e2615e Fix sentinel for the buffer in globtilde. It was off by x 2. Noted by Theo. 2001-04-03 14:50:37 +00:00
christos
c5da7a4cfa try to make this compile on 1.4.x 2001-03-28 22:53:40 +00:00
christos
5bc6f3f69d deal with buffer overflows for fixed length buffers. 2001-03-28 22:13:06 +00:00
christos
6f6e7c44eb KNF. no functional differences. 2001-03-28 21:16:48 +00:00
christos
317bb0ea2f set gl_pathv to NULL after we free it. 2001-03-18 22:40:20 +00:00
christos
93b3db97f3 limit the amount of memory used, not the number of arguments used. 2001-03-16 21:09:05 +00:00
christos
f913546a2e Implement GLOB_LIMIT that limits number of matches to ARG_MAX. 2001-03-16 20:34:08 +00:00
erh
2686020623 Squash lint errors by using size_t instead of u_int to avoid differing sizes of data. 2000-10-16 04:12:55 +00:00
mycroft
605490369c Delint.
Remove trailing ; from uses of __weak_alias().  The macro inserts this if
needed.
2000-01-22 22:19:07 +00:00
lukem
d896261208 back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
1999-09-20 04:38:56 +00:00
lukem
b48252f365 * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
  and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

		_DIAGASSERT(path != NULL)
	#ifdef _DIAGNOSTIC
		if (path == NULL) {
			errno = EFAULT;
			return (-1);
		}
	#endif
1999-09-16 11:44:54 +00:00
lukem
f177c46ba0 fix bug introduced in rev 1.8 during delint(1)ing which broke globbing ~/
(hi christos! ;)
1999-02-07 12:19:37 +00:00
thorpej
67388db284 Warn about references to the old glob functions, and direct the user to
include <glob.h> to generate the correct references.

Suggestion from Christoph Badura.
1998-12-01 20:14:04 +00:00
christos
f1e43a8104 delint! -- actually fix a bug lint found, globtilde could never have worked... 1998-11-13 10:25:42 +00:00
mycroft
e5d9823796 const poisoning. 1998-07-26 19:05:06 +00:00
kleink
cb63b5cd8c * Remove GLOB_QUOTE, add GLOB_NOESCAPE. Per POSIX, backslash quoting of
special characters is the default behaviour, which may be disabled by
  setting GLOB_NOESCAPE.
* If no matching pathnames have been found and GLOB_NOCHECK was not set
  (or special csh(1)-specific treatment of magic characters was requested),
  return GLOB_NOMATCH instead of 0; the latter would indicate a successful
  operation.
* Use strcoll() instead of strcmp() to sort globbed pathnames.
1998-06-19 22:53:57 +00:00
kleink
d555fccde7 Replace the old GLOB_ABEND constant with (the standardized) GLOB_ABORTED. 1998-03-31 20:32:48 +00:00
perry
4146d58604 remove obsolete register declarations 1998-02-03 18:23:37 +00:00
thorpej
38ba03f125 Allow the old-name functions to be compiled from the same source file as
the renamed functions, and add some #error directives to force the
issue with weak symbols for renamed functions when we support weak
symbols in the C library.
1997-10-22 06:37:42 +00:00
fvdl
21e1e24df3 New hacks to make libc work painlessly without bumping the major number:
use type func(arg1s) asm("emitted_name") gcc mechanism.
Suggested by Bill Sommerfeld.
1997-10-22 00:51:45 +00:00
fvdl
d6b51107ce Hacks to enable libc to work without bumping the major. 1997-10-21 00:55:10 +00:00