History log of /freebsd/lib/libc/gen/fts.c (Results 76 – 100 of 142)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/6.3.0_cvs, release/6.3.0, release/6.2.0_cvs, release/6.2.0
# c879ae35 09-Jan-2007 Warner Losh <imp@FreeBSD.org>

Per Regents of the University of Calfornia letter, remove advertising
clause.

# If I've done so improperly on a file, please let me know.


Revision tags: release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0, release/6.0.0_cvs, release/6.0.0, release/5.4.0_cvs, release/5.4.0, release/4.11.0_cvs, release/4.11.0, release/5.3.0_cvs, release/5.3.0
# 1e03bff7 08-Jun-2004 David Schultz <das@FreeBSD.org>

In fts_build(), if we try to chdir and fail (e.g. due to lack of search
permission), try to continue in FTS_DONTCHDIR mode. Of course this
won't work for long paths, but we can't descend more than o

In fts_build(), if we try to chdir and fail (e.g. due to lack of search
permission), try to continue in FTS_DONTCHDIR mode. Of course this
won't work for long paths, but we can't descend more than one pathname
component beyond the directory anyway if we lack search permission.

Here is a transcript demonstrating the change, where oldls is ls(1)
linked with the old fts(3):

das@VARK:~> mkdir t && touch t/{a,b,c} && chmod u-x t
das@VARK:~> oldls t
a b c
das@VARK:~> oldls -l t
das@VARK:~> \ls t
a b c
das@VARK:~> \ls -l t
ls: a: Permission denied
ls: b: Permission denied
ls: c: Permission denied

I had forgotten about this patch until bde reminded me. He reports
using it without problems for over a year.

PR: 45723

show more ...


Revision tags: release/4.10.0_cvs, release/4.10.0
# a1acdbf0 13-May-2004 Bruce Evans <bde@FreeBSD.org>

Fixed some minor style bugs.


# 07dee1a7 12-May-2004 Peter Edwards <peadar@FreeBSD.org>

Fix some^Wseveral style bugs from last commit.

Remove "sys/types.h" as "sys/param.h" is already included

Use cast rather than back-pointer to convert from public to private
version of FTS data, and

Fix some^Wseveral style bugs from last commit.

Remove "sys/types.h" as "sys/param.h" is already included

Use cast rather than back-pointer to convert from public to private
version of FTS data, and so avoid littering fts.h with any of the
details.

Pointed out By: bde, kientzle

show more ...


# 99ca5b88 08-May-2004 Peter Edwards <peadar@FreeBSD.org>

The FTS_NOSTAT option is an optimisation that reduces the number
of stat(2) calls by keeping an eye of the number of links a directory
has. It assumes that each subdirectory will have a hard link to

The FTS_NOSTAT option is an optimisation that reduces the number
of stat(2) calls by keeping an eye of the number of links a directory
has. It assumes that each subdirectory will have a hard link to its
parent, to represent the ".." node, and stops calling stat(2) when
all links are accounted for in a given directory.

This assumption is really only valid for UNIX-like filesystems: A
concrete example is NTFS. The NTFS "i-node" does contain a link
count, but most/all directories have a link count between 0 and 2
inclusive. The end result is that find on an NTFS volume won't
actually traverse the entire hierarchy of the directories passed
to it. (Those with a link count of two are not traversed at all)

The fix checks the "UFSness" of the filesystem before enabling the
optimisation.

Reviewed By: Tim Kientzle (kientzle@)

show more ...


# 542fc104 05-May-2004 Tim Kientzle <kientzle@FreeBSD.org>

A minor refactoring to simplify portability: assign the filename
length to a separate variable so that it will be easier to adapt to
systems that don't have d_namlen in struct dirent.


Revision tags: release/5.2.1_cvs, release/5.2.1, release/5.2.0_cvs, release/5.2.0, release/4.9.0_cvs, release/4.9.0, release/5.1.0_cvs, release/5.1.0, release/4.8.0_cvs, release/4.8.0, release/5.0.0_cvs, release/5.0.0
# 02ba3221 04-Jan-2003 Tim J. Robbins <tjr@FreeBSD.org>

Remove an unused variable: `sb' in fts_read().


Revision tags: release/4.7.0_cvs
# 0d3bcc2e 21-Sep-2002 Garrett Wollman <wollman@FreeBSD.org>

Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI. FTS

Make the threatened fts(3) ABI fix. FTSENT now avoids the use of the struct
hack, thereby allowing future extensions to the structure (e.g., for extended
attributes) without rebreaking the ABI. FTSENT now contains a pointer to the
parent stream, which fts_compar() can then take advantage of, avoiding the
undefined behavior previously warned about. As a consequence of this change,
the prototype of the comparison function passed to fts_open() has changed
to reflect the required amount of constness for its use. All callers in the
tree are updated to use the correct prototype.

Comparison functions can now make use of the new parent pointer to access
the new stream-specific private data pointer, which is intended to assist
creation of reentrant library routines which use fts(3) internally.

Not objected to in spirit by: -arch

show more ...


Revision tags: release/4.6.2_cvs, release/4.6.2, release/4.6.1, release/4.6.0_cvs, release/4.5.0_cvs, release/4.4.0_cvs
# b231cb39 01-Feb-2002 David E. O'Brien <obrien@FreeBSD.org>

* Remove __P and convert to ANSI prototypes.
* Remove 'register'. (some functions had 7+ register functions...)
* Fix SCM ID's.


# 8af1452c 13-Aug-2001 Ruslan Ermilov <ru@FreeBSD.org>

Removed duplicate VCS ID tags, as per style(9).


# 93a85518 01-Jun-2001 Kris Kennaway <kris@FreeBSD.org>

Fix another unprotected instance of chdir() by extending the
fts_safe_changedir() function and using that instead for both of the
chdir()s.

Partially submitted by: Todd Miller <millert@OpenBSD.org>,

Fix another unprotected instance of chdir() by extending the
fts_safe_changedir() function and using that instead for both of the
chdir()s.

Partially submitted by: Todd Miller <millert@OpenBSD.org>, bde

show more ...


# fdeb0156 30-May-2001 Kris Kennaway <kris@FreeBSD.org>

When doing the chdir("..") in the !FTS_NOCHDIR case, stat() after we get
there and compare the inode and device numbers to the values we remember,
to guard against the directory having been moved aro

When doing the chdir("..") in the !FTS_NOCHDIR case, stat() after we get
there and compare the inode and device numbers to the values we remember,
to guard against the directory having been moved around in the meantime.

Reported by: Nick Cleaton <nick@cleaton.net>

show more ...


Revision tags: release/4.3.0_cvs, release/4.3.0
# d201fe46 24-Jan-2001 Daniel Eischen <deischen@FreeBSD.org>

Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions. If the threads library is linked in, the real
pthread functions will

Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions. If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
__sys_foo - actual system call
_foo - weak definition to __sys_foo
foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo. In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde). All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes. <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE. We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by: -arch

show more ...


Revision tags: release/4.2.0, release/4.1.1_cvs
# 8ca72379 17-Aug-2000 Brian Feldman <green@FreeBSD.org>

Fix style bugs (including ones introduced from OpenBSD).


Revision tags: release/4.1.0, release/3.5.0_cvs, release/4.0.0_cvs
# 9233c4d9 28-Jan-2000 Jason Evans <jasone@FreeBSD.org>

Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo(). In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcomin

Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),
just use _foo() <-- foo(). In the case of a libpthread that doesn't do
call conversion (such as linuxthreads and our upcoming libpthread), this
is adequate. In the case of libc_r, we still need three names, which are
now _thread_sys_foo() <-- _foo() <-- foo().

Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(),
nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo().

Remove all internal libc usage of: creat(), pause(), sleep(), system(),
tcdrain(), wait(), and waitpid().

Make thread cancellation fully POSIX-compliant.

Suggested by: deischen

show more ...


# 92927338 12-Jan-2000 Jason Evans <jasone@FreeBSD.org>

Add three-tier symbol naming in support of POSIX thread cancellation
points. For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep(). The arrows represent weak aliases. For
s

Add three-tier symbol naming in support of POSIX thread cancellation
points. For library functions, the pattern is __sleep() <--
_libc_sleep() <-- sleep(). The arrows represent weak aliases. For
system calls, the pattern is _read() <-- _libc_read() <-- read().

show more ...


Revision tags: release/3.4.0_cvs
# 1a9b5f47 18-Dec-1999 Brian Feldman <green@FreeBSD.org>

Switch over to the OpenBSD fts.c, fixing lots of things.

Obtained from: OpenBSD


# 1c8517da 18-Dec-1999 Brian Feldman <green@FreeBSD.org>

Import OpenBSD's fts.c, rev.1.22. Revision 1.23 is the reinsertion of
a feature we don't use, and is meant to be removed from OpenBSD on the
next library version bump, so this is the second-to-lates

Import OpenBSD's fts.c, rev.1.22. Revision 1.23 is the reinsertion of
a feature we don't use, and is meant to be removed from OpenBSD on the
next library version bump, so this is the second-to-latest version.

This fixes the buffer overflows, bugs, and whatnot that have plagued us
in fts.c for a long time. Eventually, fts(3) may become something other
than pure evil.

Obtained from: OpenBSD

show more ...


Revision tags: release/3.3.0_cvs
# f183d53e 02-Sep-1999 Warner Losh <imp@FreeBSD.org>

Fix the root cause of the fts buffer overflow. This is a temporary
patch to stop the core dumps while others come up with a better
reviewed patch which may also fix other problems. We do illegal
po

Fix the root cause of the fts buffer overflow. This is a temporary
patch to stop the core dumps while others come up with a better
reviewed patch which may also fix other problems. We do illegal
pointer arithmetic, but it should be OK since FreeBSD only supports
machines with flat address spaces.

Submitted by: bde

show more ...


# 91289ebc 15-Aug-1999 Peter Holm <pho@FreeBSD.org>

Reverted to revision 1.8 as previous fix causes fts_open with with a
path name argument with a trailing '/' to fail.

Reviewed by: phk


# 82f712df 14-Aug-1999 Peter Holm <pho@FreeBSD.org>

Reviewed by: phk
When fts_open is used with option FTS_NOCHDIR the full
path entry of type FTS_DP is returned with a trailing
'/' if the final directory is empty.
This fix coresponds to netbsd's __ft

Reviewed by: phk
When fts_open is used with option FTS_NOCHDIR the full
path entry of type FTS_DP is returned with a trailing
'/' if the final directory is empty.
This fix coresponds to netbsd's __fts13.c v. 1.16

show more ...


Revision tags: release/3.2.0, release/3.1.0, release/3.0.0, release/2.2.8
# e8420087 16-Sep-1998 Warner Losh <imp@FreeBSD.org>

Replace memory leaking instances of realloc with non-leaking reallocf.
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is
gua

Replace memory leaking instances of realloc with non-leaking reallocf.
In some cases replace if (a == null) a = malloc(x); else a =
realloc(a, x); with simple reallocf(a, x). Per ANSI-C, this is
guaranteed to be the same thing.

I've been running these on my system here w/o ill effects for some
time. However, the CTM-express is at part 6 of 34 for the CAM
changes, so I've not been able to do a build world with the CAM in the
tree with these changes. Shouldn't impact anything, but...

show more ...


Revision tags: release/2.2.7
# 8a507b98 03-Jul-1998 Poul-Henning Kamp <phk@FreeBSD.org>

fts_close calls free(sp), the ISSET(FTS_NOCHDIR) which is a macro that
references sp. The free needs to follow ISSET

PR: 7148
Reviewed by: phk
Submitted by: Ken Mayer <kmayer@freegate.com>


Revision tags: release/2.2.6, release/2.2.5_cvs
# 42396e05 22-Sep-1997 Peter Wemm <peter@FreeBSD.org>

Apply fts() fix from PR#4593

Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>


# 9a91f1cc 30-Aug-1997 Warner Losh <imp@FreeBSD.org>

Merge in the safe chdir changes from Todd Miller's mods to the OpenBSD
tree. Also merge in fix to NetBSD PR #1495. These represent 1.3-1.9 in
the OpenBSD tree. Make minor KNF changes to new code (

Merge in the safe chdir changes from Todd Miller's mods to the OpenBSD
tree. Also merge in fix to NetBSD PR #1495. These represent 1.3-1.9 in
the OpenBSD tree. Make minor KNF changes to new code (which is in the
OpenBSD as 1.10). This avoids the symlink race problems.

These patches should go into 2.2.5 before the ship if they don't
break anything in -current.
Reviewed by: Bruce Evans
Obtained from: OpenBSD

show more ...


123456