History log of /freebsd-9.3-release/lib/libc/gen/getcap.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 261813 12-Feb-2014 jilles

MFC r241046: libc: Use O_CLOEXEC for various internal file descriptors.

This fixes a race condition where another thread may fork(), unintentionally
passing the descriptor to the child process.

This commit only adds O_CLOEXEC flags to open() or openat() calls where no
fcntl(fd, F_SETFD, FD_CLOEXEC) follows.


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 199784 25-Nov-2009 wollman

Eliminate more dead stores.

Found by: Clang static analyzer
MFC after: 7 days


# 192129 14-May-2009 delphij

As the comment says, close() frees the variable, record. So we obtain
the length by evaluating the value from the copy, cbuf instead. This
fixes a crash caused by previous commit (use-after-free)

Submitted by: Dimitry Andric <dimitry andric com>
Pointy hat to: delphij


# 190661 02-Apr-2009 delphij

Properly handle malloc() failures.

PR: bin/83338


# 165903 08-Jan-2007 imp

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

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


# 108553 02-Jan-2003 thomas

In cgetmatch(3), return -1 if a NULL or 0-length name parameter is used.
This situation most notably arises in chkprintcap, when a /etc/printcap
entry has an empty rp= attribute. In that case, cgetmatch would enter
an infinite loop if any entry in the file has multiple names.

This causes lpd to hang at boot time on 5.0-DP2 when both conditions
are met (:rp=: and multiple names -- not necessarily on the same entry).

Reviewed by: roberto


# 108312 27-Dec-2002 alfred

Silence casting away constness warnings.

Make cgetmatch's locals const.
Make cdbget take a const string and copy it into a buffer.


# 92941 22-Mar-2002 obrien

Remove multi-line __P() usage.


# 92925 22-Mar-2002 imp

const poison just like NetBSD.


# 90039 31-Jan-2002 obrien

Fix SCM ID's.


# 71579 24-Jan-2001 deischen

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


# 69502 01-Dec-2000 gad

Fix some error-handling logic so that ferror is called before fclose,
instead of immediately after the fclose. The previous logic did work
on freebsd, but is somewhat risky practice (and causes trouble when
porting to other OS's).

PR: bin/22965
Reviewed by: Garrett Wollman


# 60747 21-May-2000 hoek

Fix a memory leak in getent() that occurred when the requested entry
could not be found.

PR: bin/17084


# 56698 27-Jan-2000 jasone

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


# 55837 12-Jan-2000 jasone

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().


# 52856 04-Nov-1999 ache

Add unsigned char cast to isspace arg


# 44921 21-Mar-1999 imp

Don't be so selective about which errors cause us to continue and
which ones cause us to fail. Now all open errors on the databse file
will cause the next file in the list to be tried.

Submitted by: Arne Henrik Juul <arnej@math.ntnu.no>
PR: 4585


# 39327 16-Sep-1998 imp

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...


# 30713 25-Oct-1997 jdp

Change L_SET to SEEK_SET for POSIX compliance.

Submitted by: Dean Gaudet <dgaudet@arctic.org>


# 29574 18-Sep-1997 phk

Many places in the code NULL is used in integer context, where
plain 0 should be used. This happens to work because we #define
NULL to 0, but is stylistically wrong and can cause problems
for people trying to port bits of code to other environments.

PR: 2752
Submitted by: Arne Henrik Juul <arnej@imf.unit.no>


# 11659 22-Oct-1995 phk

Minor cleanup, mostly unused vars and missing #includes.


# 8870 30-May-1995 rgrimes

Remove trailing whitespace.


# 8522 14-May-1995 ache

Parse ^? now, our termcap use it and some termcaps from other
systems use it too


# 1574 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1573,
which included commits to RCS files with non-trunk default branches.


# 1573 27-May-1994 rgrimes

BSD 4.4 Lite Lib Sources