summaryrefslogtreecommitdiffstats
path: root/sbin/savecore
AgeCommit message (Collapse)AuthorFilesLines
2019-06-28When system calls indicate an error they return -1, not some arbitraryderaadt1-5/+5
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.
2019-02-05dev_t is signed to permit passing -1 as an invalid condition, but thederaadt1-2/+2
decomposition into major and minor is unsigned, so we should print them with %u instead of %d. ok guenther
2018-12-05Unbreak "savecore -c". Also add missing unveil(2) for the raw device.yasuoka1-15/+24
ok mestre
2018-09-28add missing unveil(2) of an arbitrary kernel (when -N is used), or _PATH_UNIX bymestre1-1/+5
default, with read permissions. report and fix provided by semarie@ OK deraadt@
2018-09-24After opening required descriptors, savecore only plays in one directoryderaadt1-1/+5
so use unveil(2).
2017-01-22tedu@ didn't take the getcode() prototype with the getcode() implementation.krw1-2/+1
Restore gcc's equanimity by tedu@'ing the prototype.
2016-09-04chop out the zread code since we only write filestedu1-214/+2
2016-09-04unifdef SAVECORE now that we're done sharingtedu2-6/+2
2016-09-03proving once again my commit and somebody will test strategy works,tedu3-2/+882
deraadt found that savecore also uses a source file from compress. add (6.0 versions) of the needed files to permit progress elsewhere.
2016-09-01make the version symbol a fixed size (512) to reduce the potential fortedu1-3/+5
bad effects when savecore reads beyond it ok deraadt (and thanks to bluhm for remembering that this happens)
2016-07-04Drop support for the undocumented second argument (same as -N option)guenther1-4/+2
ok deraadt@
2015-10-18after kmem is open and setup, pledge "stdio rpath wpath cpath"deraadt1-1/+6
seems to be working. commiting to get feedback from people who crash.
2015-10-18Collapse some strange programmer style with too much abstraction.deraadt1-47/+31
2015-04-26Fix glitches in previous commit: strip the \n and only complain on failureguenther1-4/+11
ok deraadt@
2015-04-18Convert many atoi() calls to strtonum(), adding range checks and failurederaadt1-6/+15
handling along the way. Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert
2015-03-15tzfile.h is an internal header that should never have been installed.millert1-3/+3
What's worse, the tzfile.h that gets installed is over 20 years old and doesn't match the real tzfile.h in libc/time. This makes the tree safe for /usr/include/tzfile.h removal. The TM_YEAR_BASE define has been moved to time.h temporarily until its usage is replaced by 1900 in the tree. Actual removal of tzfile.h is pending a ports build. Based on a diff from deraadt@
2015-01-16Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt1-7/+9
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)
2013-08-14no longer any need to quote macro lines with >9 args;jmc1-3/+3
From: Jan Stary
2013-06-03dependent clause requires a subject (comment grammar)tedu1-8/+8
2009-10-27rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt1-15/+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
2009-06-20If the user didn't specify a kernel, pass in NULL to kvm_openfiles()millert1-4/+3
so it can try /dev/ksyms. The first call to kvm_openfiles() was already correct.
2009-01-17Use different variables for the dump offset in blocks and the dump offsetmiod1-13/+14
in bytes; this allows us to get rid of many off_t casts, and ensures proper operation on very large swap partitions on 32 bit machines. From Pierre Riteau.
2009-01-02Handle kernel core files larger than 2GB; ok dlg@miod1-7/+8
2008-09-10sync synopsis and usage; documentation tweaks.sobrado1-5/+3
ok jmc@
2008-07-18+.Xr crash 8 ,jmc1-2/+3
from Stephan A. Rickauer
2007-09-14remove some warnings:chl1-4/+2
unused variable `variable' `variable' might be used uninitialized in this function ok gilles@ ray@
2007-09-11use strcspn to properly overwrite '\n' in fgets returned buffergilles1-8/+5
ok pyr@, ray@, millert@, moritz@, chl@
2007-05-31convert to new .Dd format;jmc1-2/+2
2006-06-16Add -DSAVECORE to CFLAGS instead of overriding it.kettenis1-2/+2
ok miod@, deraadt@
2005-06-26There's a dependency on the compress API that changedotto1-1/+2
2005-01-07Use fstatfs(), not statfs() to determine free space so if /var/crashmillert1-3/+5
is a link we follow it. OK deraadt@ jcs@
2004-09-15removed unused; avoid aliasing to libc functionsderaadt1-24/+13
2004-07-02Use "time_second" instead of "time" now that time handling in the kerneltholo1-4/+4
has changed. ok art@ millert@ marc@
2004-01-13Use correct type for magic number.otto1-4/+5
ok marc@ millert@
2003-12-28zap bizarre log() prototype.espie1-3/+2
Doesn't even change the resulting binary (thank Ian Darwin for that idea)
2003-11-15fix savecore on big endian 64 bit arches. OK millert@marc1-3/+3
2003-07-29spacesderaadt1-4/+4
2003-06-10boring cleanupsderaadt1-4/+4
2003-06-03- section reorderjmc1-3/+3
- some mdoc fixes
2003-06-02Remove the advertising clause in the UCB license which Berkeleymillert2-13/+5
rescinded 22 July 1999. Proofed by myself and Theo.
2003-04-08fix null deref in error sysloggingmickey1-3/+3
2003-04-07strlcat, and it counted srclen, not dstlen; ok millertderaadt1-4/+5
2002-07-03ansideraadt1-31/+18
2002-05-22oops, backwards length check; moritz@jodeit.orgderaadt1-3/+3
2002-05-22strcpy, sprintf death; mpech okderaadt1-5/+6
2002-02-16Part 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.millert1-18/+18
2001-11-05kill more registers;mpech1-11/+11
millert@ ok
2001-07-07major -Wall cleanup, almost completederaadt1-12/+12
2001-06-29More libkvm.old relicsmiod2-725/+2
2001-06-20circumvent a 32-bit integer arithmetic overflowniklas1-3/+3