summaryrefslogtreecommitdiffstats
path: root/usr.sbin/kvm_mkdb/nlist.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-2/+2
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* Use <fcntl.h> instead of <sys/file.h> for open() and friends.guenther2018-04-261-8/+4
| | | | | | | Delete a bunch of unnecessary #includes and sort to match style(9) while doing the above cleanup. ok deraadt@ krw@
* Use <elf.h> instead of <elf_abi.h>mpi2017-10-271-2/+2
| | | | ok jasper@, jca@, deraadt@
* missing fclose() in an error pathjsg2016-09-101-2/+4
|
* Remove NULL-checks before free(). ok tb@mmcc2015-12-101-3/+2
|
* stdlib.h is in scope; do not cast malloc/calloc/realloc*deraadt2015-08-201-2/+2
| | | | ok millert krw
* do not require <a.out.h>deraadt2015-01-181-2/+1
|
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-2/+2
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* Use errc/warnc to simplify code.guenther2014-05-201-2/+2
| | | | | | Also, in 'ftp', always put the error message last, after the hostname/ipaddr. ok jsing@ krw@ millert@
* remove the code that iterates over binary types, since everything is nowderaadt2013-11-121-21/+9
| | | | ELF.
* tedu a.out supportderaadt2013-10-151-375/+1
|
* Correct format string mismatches turned up by -Wformat=2guenther2013-08-221-2/+2
| | | | suggestions and ok millert@
* Allow for a kernel linked at address zero; ok guenther@ millert@miod2013-01-291-3/+4
|
* iterate over e_shnum using Elf32_Word instead of intderaadt2012-04-061-2/+3
|
* patch a whole bunch of memory leaks, parfait only spotted one of themderaadt2009-11-111-22/+41
| | | | ok miod jsg
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-9/+1
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgderaadt2007-09-021-3/+3
|
* do not use section names for locating a string tab; miod@ okmickey2007-03-181-29/+18
|
* realloc fixes; markus okderaadt2003-09-251-6/+26
|
* ansi and protosderaadt2003-06-261-21/+7
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-7/+3
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* use snamesize and realloc properly. ok tdeval@tedu2003-04-061-9/+13
|
* strlcpy; tedu okderaadt2003-04-041-5/+6
|
* be better about the STT_NOTYPE symbols, not all become N_UNDEF this way; pefo@ okmickey2002-11-301-3/+19
|
* prepend the underscore always for elf, this makes kvm_bsd.db work on elf platforms; drahn@ millert@ okmickey2002-10-251-11/+6
|
* fopen() does not return < 0deraadt2002-09-061-3/+3
|
* minor KNFderaadt2002-05-301-5/+4
|
* bring in prototypesderaadt2002-03-251-3/+3
|
* kill more registers.mpech2002-03-141-8/+8
| | | | millert@ ok
* Fix ELF so it works with /dev/ksyms. Also make 'detection' of ksymspefo2002-02-201-34/+66
| | | | a little more robust by looking at the actual namelist filename.
* Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.millert2002-02-161-4/+4
|
* MAP_COPY -> MAP_SHARED (it's ok in this case (/dev/ksyms))art2001-05-111-3/+3
|
* ELF: fallback to malloc when mmap fails. for /dev/ksyms.art2001-02-031-7/+27
|
* Make nlist elf-size independent.art2001-01-251-11/+11
|
* warnx?/errx? paranoia (use "%s" not a bare string unless it is amillert2000-06-301-3/+3
| | | | | | | | | constant). These are not security holes but it is worth fixing them anyway both for robustness and so folks looking for examples in the tree are not misled into doing something potentially dangerous. Furthermore, it is a bad idea to assume that pathnames will not include '%' in them and that error routines don't return strings with '%' in them (especially in light of the possibility of locales).
* Only exit in nlist.c due to a memory error, otherwise just return. A return value of 1 indicates an incorrect executable type, a return value of -1 indicates some other problem. This gives us better fallback from /dev/ksyms to /bsd.millert1999-03-241-61/+91
|
* back out recently added sanity check for data and bss as ksyms has neithermillert1998-12-191-6/+2
|
* Blow up a little more verbosely if something's feeding us garbage.downsj1998-11-291-5/+10
|
* uninitialized variable; hgweigand@wiesbaden.netsurf.demillert1998-10-281-3/+3
|
* if malloc fails, say how much we tried to allocmillert1998-09-261-5/+6
|
* o If the user doesn't specify a file, use /dev/ksyms in preference tomillert1998-08-231-34/+23
| | | | | | /bsd if it exists and we can open it. o Fix a bug where kvm_mkdb would leave a temp file in /var/db if the file argument didn't exit.
* oops, remove debugging infomillert1998-08-211-3/+2
|
* Changes to work with /dev/ksyms:millert1998-08-211-33/+75
| | | | | | | o If we are have no data segment and text seg is __LDPGSZ, we must be /dev/ksyms or an equivalent so use sysctl to get version string. o fix an int vs. long issue and prepend '_' to symbols that lack one (alpha for instance).
* ecoff support, based on libc/gen/nlist.cmillert1998-08-201-4/+132
|
* clean up our temp files on failuremillert1998-08-191-5/+5
|
* Make kvm_mkdb work againmillert1998-08-191-26/+38
| | | | | | | | | | | o testdb() needs to take as an arg the name of the kernel so it can do the version test correctly. o add undocumented verbose flag to tell when we are rebuilding the .db file o DO_* -> _NLIST_DO_*, this prevented kvm_mkdb from doing anything at all. o preserve a few error messages so you get error output when none of the exec types match the target. o check malloc return values o get_kerntext should not subtract the sizeof(struct exec) from kernel_text
* use MAP_PRIVATE|MAP_FILE; mrgderaadt1997-12-151-3/+4
|
* From NetBSD: make testdb() fail if database version string has length zero.millert1997-01-151-2/+7
| | | | | Also, KNF, b* -> mem*, getopt tests against -1, not EOF, and index -> strchr. Added OpenBSD tags.
* comment an #endifderaadt1996-07-311-2/+2
|
* zmagic/qmagic has kernel offset problem; netbsd pr#2665, leo@marco.de.deraadt1996-07-311-43/+55
| | | | | also rely on machine/exec.h DO_{AOUT,ELF,...} symbols, and declare a stub ecoff handler for niklas to finish writing (stealable from libc)