summaryrefslogtreecommitdiff
path: root/lib/libc/gen/fts.c
AgeCommit message (Collapse)Author
2003-06-11ansification; checked by pvalTheo de Raadt
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2002-07-12Add a missing check for fts_alloc() returning NULL; Chad LoderTodd C. Miller
2002-06-27%uTheo de Raadt
2002-02-16Part one of userland __P removal. Done with a simple regexp with some minor ↵Todd C. Miller
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2001-08-27Zero out entire FTS after allocating it instead of just zeroing outTodd C. Miller
a few fields by hand; Closes PR 2033
2001-08-03Update sp->fts_cur in fts_read() before returning NULL. ThisTodd C. Miller
prevents a duplicate free() in fts_close(). From karls@inet.no with some other, similar cases added.
2001-05-31Fix another case of CHDIR("..") pointed out by Bruce EvansTodd C. Miller
<bde@zeta.org.au>. Instead of fixing these inline I've modified my fts_safe_changedir() function so it can be used in this case too. Thanks also to Kris Kennaway <kris@obsecurity.org>.
2001-05-30When changing directory to '..', verify that we really are whereTodd C. Miller
we should be. This is similar to the old fts bug but happens when popping out of directories, as opposed to descending into them. Patch based on one by Kris Kennaway <kris@obsecurity.org>. Issue reported by Nick Cleaton <nick@cleaton.net>
2001-05-15Make path length variables size_t. This fixes the problem whereTodd C. Miller
things like rm can't remove files with ridiculously long path names that were created by some script kiddie trying in vain to exploit something. Previously, the length was effectively constrained to USHRT_MAX due to one of the internal structs. Also, nuke FTS_CHDIRROOT since it never worked correctly and hasn't been documented for a long time.
2000-08-24KNFTheo de Raadt
1999-10-03put back FTS_CHDIRROOT until next library major number crankTodd C. Miller
1999-10-03kill FTS_CHDIRROOT flag, it is broken beyond repair and no longer usedTodd C. Miller
1999-10-03Fix multiple problems in the FTS_NOCHDIR case (mycroft@netbsd.org):Todd C. Miller
* There was an off-by-one error that caused the addition of a NUL or slash in fts_build() to overwrite other memory. * After fts_palloc(), we need to reset `cp' so that it points to the new path name buffer; otherwise the addition of the file name before calling fts_stat() could lose. Also, fix stupidity in the fts_palloc() interface. We don't want N bytes more than the current buffer size; we want N bytes more than the current length. Just pass in the new size, since we can't figure it out easily here. fts_padjust() was doing more work than it needed to. Based on changes from mycroft@netbsd.org. Check for fts_pathlen oflow in two places. Done before I saw the NetBSD change (and last I checked they only did one of the checks). In the case of wrap, return ENAMETOOLONG.
1999-08-16If the FTS_NOCHDIR flag is set and the final directory is empty,Todd C. Miller
the trailing '/' would not be chopped; pho@freebsd.org
1999-05-171) Only do pointer adjusting if realloc() changed our pointerTodd C. Miller
2) Only adjust pointers based on ftp_path, not fts_name. 3) Adjust the entries in the file list, as well as the trees, if needed. Loosely based on a patch from Stas Kisel <stas@SONET.CRIMEA.UA>
1998-08-15fix realloc patchTheo de Raadt
1998-08-14realloc repairTheo de Raadt
1998-07-03do not free() before last ref; kmayer@freegate.comTheo de Raadt
1998-03-19some -WallTodd C. Miller
1997-10-11Replace my trailing slash removal with the one from FreeBSD.Todd C. Miller
1997-10-06Fix bug caused by trailing '/' stripping. Didn't always guarantee NULLTodd C. Miller
termination. Now we do.
1997-09-20Strip trailing '/' from paths. Noted by hermit@cs.tu-berlin.de inTodd C. Miller
the form of an ls(1) bug and dm@reeducation-labor.lcs.mit.edu in the form of a cp(1) bug.
1997-09-01Fix problem with ``find -execdir'' not having the correct initial cwd.Todd C. Miller
Adds a new flag to fts(3).
1997-08-29Minor KNF changes to fts_safe_chdir and recent NetBSD code integrationimp
as pointed out by Bruce Evans.
1997-08-02From NetBSD (phil):Todd C. Miller
- Add args for compar() function decl. - Fix it so fts_* never adds a / to a path name when there is already a trailing /. Fixes NetBSD PR 1495.
1997-07-23trailing blankskstailey
1997-03-24Make sure head, tail, and nitems get zero'd even if weTodd C. Miller
can't cd to the target dir. Fixes rogue pointer problem introduced with safe chdir changes.
1997-01-17Final fix to make fts(3) spoof-proof.Todd C. Miller
1997-01-14Be extra careful when chdir'ing to subdirs.Todd C. Miller
1996-12-23Back out last change, it is not sufficient.Todd C. Miller
1996-12-23Avoid spoofing when cd'ing to subdirs. First cut.Todd C. Miller
1996-08-19Fix RCS idsThorsten Lockert
Make sure everything uses {SYS,}LIBC_SCCS properly
1995-10-18initial import of NetBSD treeTheo de Raadt