Home | History | Annotate | Download | only in gen
History log of /src/lib/libc/gen/getcap.c
RevisionDateAuthorComments
 1.58  21-Sep-2023  shm Fix memory leak in getent()

Memory was not freed if record was not found
 1.57  18-Jun-2017  manu branches: 1.57.8; 1.57.16;
Make shared -DSMALL libc buildable without breaking libhack

We used -DSMALL to exclude code from libc in order to build
libhack. Introduce -DLIBHACK to do this without so that
-DSMALL does not remove code necessary for building a shared libc
 1.56  24-Sep-2014  christos branches: 1.56.8;
undo, the right place for this is compat_defs.h
 1.55  24-Sep-2014  he Provide a backward-compatible conditional define of O_CLOEXEC
for those systems which lack it, since these files are used in
tools builds.
 1.54  18-Sep-2014  christos make more descriptors that we open as close-on-exec
 1.53  26-Jun-2014  christos branches: 1.53.2;
don't depend on expandtc to open the database or not.
 1.52  04-Jun-2012  joerg branches: 1.52.2; 1.52.8;
ANSIfy
 1.51  13-Mar-2012  christos PR/45989: Martin Husemann: lint invocation does include -w only on i386

- turn lint -w for all the platforms after fixing the lint warnings.
- add _DIAGASSERTS() for casts that would assign values to types that
would not fit.
- change types, add casts
- change into ansii prototypes
- turn on _DIAGNOSTIC for libc (during current, to be eliminated for release
builds)

approved by core@
 1.50  15-Oct-2011  christos branches: 1.50.2;
close on exec fixes:
- open + fcntl -> open O_CLOEXEC
- configuration database file descriptors that can stay open are now opened
fopen(db, "re")
 1.49  07-Feb-2011  joerg Don't define weak aliases in the SMALL case. They conflict with the real
function name since SMALL doesn't use the normal rename logic.
 1.48  02-Feb-2008  christos branches: 1.48.24;
Add csetexpandtc()
 1.47  04-Jul-2006  jnemeth branches: 1.47.10;
KNF
 1.46  29-May-2006  jnemeth missed check for malloc() returning NULL
 1.45  02-Apr-2006  christos Add coverity annotations.
 1.44  19-Mar-2006  christos Coveriry CID 509: Avoid NULL pointer deref.
 1.43  19-Mar-2006  christos Coverity CID 510: Avoid uninitialized variable.
 1.42  29-Nov-2005  christos WARNS=4
 1.41  25-Apr-2004  christos Add -DSMALL so that this can be used in libhack.
 1.40  23-Apr-2004  christos Ansify and add change db_name vector from char ** to const char * const *
 1.39  27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.38  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.37  31-Jan-2003  uwe Avoid cgetcap &co prototypes conflicting with those provided by the host.
With this change we can cross-compile on FreeBSD 4.x.
 1.36  04-Aug-2002  tron Include "sys/param.h" and use "MATHPATHLEN" instead of "_POSIX_PATH_MAX"
to fix build problem.
 1.35  16-Apr-2002  groo branches: 1.35.2;
Detect if line length exceeds buffer capacities.
from xs@kittenz.org
 1.34  25-Jun-2001  mrg avoid an underrun in "buf". noted by dean@huxley.org in PR#13292
 1.33  02-Jun-2000  itojun branches: 1.33.2; 1.33.4;
correct memory leak due to t_getstr() and realloc(). the commit will
prevent "top -s 0" from chewing up memory.

TODO: realloc() audit, revisit recent termcap/curses changes
 1.32  22-Jan-2000  mycroft branches: 1.32.2;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.31  20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.30  16-Sep-1999  lukem * 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
 1.29  29-Mar-1999  abs Cast argument to isspace to (unsigned char) to pass zoularis.
 1.28  23-Mar-1999  abs Fix 'suggest parentheses' warning noted by Erik E. Fair <fair@clock.org>
 1.27  22-Mar-1999  abs If we push a cap entry (usually from the environment), strip : deliminated
entries that only contain whitespace, in a similar fashion to reading from
a file.
 1.26  16-Mar-1999  christos Fix gcc-2.8.1 warnings.
 1.25  13-Nov-1998  christos avoid assignment of a read only location that lint does not pick, but gcc does.
 1.24  12-Nov-1998  christos delint
 1.23  26-Aug-1998  perry fix bcopy->memcpy with memcpy->memmove -- not strictly needed, but...
 1.22  10-Aug-1998  perry bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.21  27-Jul-1998  mycroft const poisoning.
 1.20  21-Jul-1998  mycroft Suppress blank fields due to continuation lines.
 1.19  18-Mar-1998  tv PR 5170: don't fclose twice, or call ferror after fclose.
required removing fcloses and/or moving them, nulling the pointers
like they should have been, and adding a terminating null byte and break
in one case (perhaps we never ran into those problems before).
cgetclose() already does a fclose and null of the pointer, so don't
duplicate it when we don't need to.
 1.18  02-Mar-1998  thorpej Fix type size lossage on the Alpha.
 1.17  26-Feb-1998  perry trivial changes to reduce lint complaints
 1.16  03-Feb-1998  perry remove obsolete register declarations
 1.15  25-Aug-1997  kleink Lseek(2) usage cleanup: the use of L_SET/L_INCR/L_XTND is deprecated,
use SEEK_SET/SEEK_CUR/SEEK_END instead.
 1.14  21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.13  13-Jul-1997  christos Fix RCSID's
Fix gcc warnings.
 1.12  17-May-1997  pk NULL => 0 (Arne Juul; PR#3629)
 1.11  23-Jan-1997  mrg - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
 1.10  24-Aug-1995  mycroft branches: 1.10.4;
Do not terminate the search on errors other than ENOENT.
 1.9  25-Feb-1995  cgd update to 4.4-Lite where appropriate, clean up Id format, etc.
 1.8  26-Mar-1994  cgd slight mod
 1.7  06-Mar-1994  cgd fix for lib/156: cgetent does access free'd memory,
from Thomas Eberhardt
 1.6  04-Jan-1994  cgd rename fgetline()
 1.5  22-Dec-1993  cgd don't squish newline at end of fgetline()... from bostic
 1.4  26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.3  30-Jul-1993  mycroft Add even more RCS frobs.
 1.2  08-Jun-1993  mycroft fgetline() does not return the newline.
 1.1  18-May-1993  cgd branches: 1.1.1;
bring in getcap routines, supplied by CSRG, from 4.4...
 1.1.1.1  25-Feb-1995  cgd from lite, with minor name rearrangement to fit.
 1.10.4.2  19-Sep-1996  jtc snapshot namespace cleanup: gen
 1.10.4.1  16-Sep-1996  jtc snapshot namespace cleanup
 1.32.2.1  23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.33.4.3  13-Aug-2002  nathanw Catch up to -current.
 1.33.4.2  25-Apr-2002  nathanw Catch up to -current.
 1.33.4.1  08-Oct-2001  nathanw Catch up to -current.
 1.33.2.2  17-Apr-2002  he Pull up revision 1.35 (requested by groo):
Detect if line length exceeds buffer size.
 1.33.2.1  26-Oct-2001  jhawk Pull up revision 1.34 (requested by mrg):
Avoid an underrun in "buf". Fixes PR#13292.
 1.35.2.1  18-Jun-2004  jmc forgot one fix for PR#24481
 1.47.10.1  23-Mar-2008  matt sync with HEAD
 1.48.24.1  08-Feb-2011  bouyer Sync with HEAD
 1.50.2.2  30-Oct-2012  yamt sync with head
 1.50.2.1  17-Apr-2012  yamt sync with head
 1.52.8.1  10-Aug-2014  tls Rebase.
 1.52.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.53.2.1  23-Jul-2017  snj Pull up following revision(s) (requested by manu in ticket #1440):
distrib/utils/libhack/Makefile: revision 1.25
distrib/utils/libhack/Makefile.inc: revision 1.27
lib/libc/gen/getcap.c: revision 1.57
Make shared -DSMALL libc buildable without breaking libhack
We used -DSMALL to exclude code from libc in order to build
libhack. Introduce -DLIBHACK to do this without so that
-DSMALL does not remove code necessary for building a shared libc
 1.56.8.2  11-Mar-2024  martin Pull up following revision(s) (requested by ozaki-r in ticket #1947):

lib/libc/gen/getcap.c: revision 1.58

Fix memory leak in getent()

Memory was not freed if record was not found
 1.56.8.1  04-Jul-2017  martin Pull up following revision(s) (requested by manu in ticket #79):
distrib/utils/libhack/Makefile.inc: revision 1.27
lib/libc/gen/getcap.c: revision 1.57
distrib/utils/libhack/Makefile: revision 1.25
Make shared -DSMALL libc buildable without breaking libhack
We used -DSMALL to exclude code from libc in order to build
libhack. Introduce -DLIBHACK to do this without so that
-DSMALL does not remove code necessary for building a shared libc
 1.57.16.1  11-Mar-2024  martin Pull up following revision(s) (requested by ozaki-r in ticket #630):

lib/libc/gen/getcap.c: revision 1.58

Fix memory leak in getent()

Memory was not freed if record was not found
 1.57.8.1  11-Mar-2024  martin Pull up following revision(s) (requested by ozaki-r in ticket #1816):

lib/libc/gen/getcap.c: revision 1.58

Fix memory leak in getent()

Memory was not freed if record was not found

RSS XML Feed