321140 |
18-Jul-2017 |
ngie |
MFC r302500,r319339,r319543,r319544,r319551,r321138:
r302500 (by cem):
dd(1): Enable access to SIZE_T_MAX character devices
On machines where SIZE_T_MAX exceeds OFF_MAX (signed 64-bit), permit seeking character devices to negative off_t values. This enables dd(1) to interact with kernel KVA in /dev/kmem on amd64, for example.
r319339 (by asomers):
Fix integer overflow detection in dd
dd(1) tried to detect whether the seek offset would overflow, but it failed to account for the case where the provided argument was negative and the file was a regular file (negative seeks are allowed for character devices). I fixed it, and added a regression test.
CID: 1368659
r319543:
Stylistic tweaks
Move opening braces of functions from the last column to column 0.
MFC with: r319339
r319544:
Mark :seek_overflow as an expected failure
MFC with: r319339 PR: 219757
r319551 (by asomers):
Fix bin/dd/dd2_tests:seek_overflow on UFS and TMPFS
Split the postive and negative parts into separate test cases. The positive test case can only run on ZFS, because only ZFS supports files that large.
PR: 219757
r321138:
Remove unnecessary make logic added in r319339
This makes the change cleaner and easier to backport to ^/stable/10. |
316203 |
30-Mar-2017 |
sevan |
MFC r306715
Add history section for dd(1) First version of UNIX to include dd found using TUHS http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/dd.c
PR: 211777 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104 |
316202 |
30-Mar-2017 |
sevan |
MFC r285645
Mention the dd-like recoverdisk(1) to help folks find this great BSD command. |
316201 |
30-Mar-2017 |
sevan |
MFC r270831
Update the date for last example.
Sponsored by: Netflix |
316200 |
30-Mar-2017 |
sevan |
MFC r270771 Add canonical population of a disk / thumb drive from an image example. |
298258 |
19-Apr-2016 |
thomas |
MFC r295749:
Reorganize the handling all-zeroes terminal block in sparse mode
PR: 189284 (original PR whose fix introduced this bug)
PR: 207092 |
290574 |
09-Nov-2015 |
ngie |
MFC r289487:
Integrate contrib/netbsd-tests/bin/dd into the FreeBSD test suite as bin/dd/tests
Ensure fdescfs is mounted on /dev/fd/ for the length testcase as it's used in validating the characters read from /dev/zero
Sponsored by: EMC / Isilon Storage Division |
266488 |
21-May-2014 |
thomas |
MFC rev. 265593: (dd_out): Fix handling of all-zeroes block at end of input with conv=sparse.
PR: bin/189174 PR: bin/189284 Reviewed by: kib |
264577 |
17-Apr-2014 |
delphij |
MFC r264059+264067:
Implement GNU's extension of 'status' operand. The GNU syntax is borrowed where syntax status=noxfer means no transfer statistics and status=none means no status information at all.
This feature is useful because the statistics information can sometimes be annoying, and redirecting stderr to /dev/null would mean error messages also gets silenced.
Obtained from: OpenBSD |
256281 |
10-Oct-2013 |
gjb |
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation
|
255977 |
01-Oct-2013 |
pluknet |
Sweep man pages replacing ad -> ada.
Approved by: re (blackend) MFC after: 1 week X-MFC note: stable/9 only
|
250469 |
10-May-2013 |
eadler |
Make dd's signal handler async safe.
PR: bin/75258 Submitted by: "Oleg V. Nauman" <oleg@reis.zp.ua> Arrival Date: Sun Dec 19 14:50:21 GMT 2004 Reviewed by: mjg, jhb Reviewed by: jilles (earlier version) MFC after: 1 week
|
249811 |
23-Apr-2013 |
kib |
Literally follow POSIX: If the bs= expr operand is specified and no conversions other than sync, noerror, or notrunc are requested, the data returned from each input block shall be written as a separate output block.
In particular, when both bs=size and conv=sparce were specified, the resulted file was fully filled, instead of sparce.
PR: standards/177742 Submitted by: Matthew Rezny <mrezny@hexaneinc.com> MFC after: 2 weeks
|
249063 |
03-Apr-2013 |
brooks |
IFP4 change 222074.
Introduce an explicit close of the output descriptor so that work done on close is accounted for in the summary output triggered at exit (implicit close()s occur after atexit() hooks).
This is useful because some devices such as cfi(4) may perform signficant work after a close occurs (e.g. erasing and rewriting a block of flash).
|
241777 |
20-Oct-2012 |
ed |
More -Wmissing-variable-declarations fixes.
In addition to adding missing `static' keywords: - bin/dd: Pull in `extern.h' to guarantee consistency with source file. - libexec/rpc.rusersd: Move shared globals into an extern.h. - libexec/talkd: Move `debug' and `hostname' into extern.h. - usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree. - usr.bin/m4: Move `end_result' into extern.h. - usr.sbin/services_mkdb: Move shared globals into an extern.h.
|
239991 |
01-Sep-2012 |
ed |
Rework all non-contributed files that use `struct timezone'.
This structure is not part of POSIX. According to POSIX, gettimeofday() has the following prototype:
int gettimeofday(struct timeval *restrict tp, void *restrict tzp);
Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is not used). Remove dead error handling code. Also use NULL for a nul-pointer instead of integer 0.
While there, change all pieces of code that only use tv_sec to use time(3), as this provides less overhead.
|
187922 |
30-Jan-2009 |
keramida |
Bump .Dd for r187609
|
187609 |
23-Jan-2009 |
keramida |
Add an example of using bs=2048 to duplicate data CD-ROMs.
This should be a bit useful for users who look at the manpage and then try to copy data CD-ROM disks using dd. A lot of us know that bs=2048 is required, but it still manages to cause a bit of grief to those who haven't heard about it.
PR: bin/130857 Submitted by: Tri Brotoharsono < mail at tribrotoharsono.net > MFC after: 3 days
|
160218 |
09-Jul-2006 |
markm |
More inactive maintainers.
|
148490 |
28-Jul-2005 |
keramida |
Spell "protections" correctly.
|
147363 |
14-Jun-2005 |
ru |
Sort sections.
Approved by: re (blanket)
|
144758 |
07-Apr-2005 |
scottl |
Document problems with writing to disks under GEOM.
|
140353 |
16-Jan-2005 |
ru |
Add the new standard EXIT STATUS section where appropriate. Sort standard sections in the (documented) preferred order.
|
139969 |
10-Jan-2005 |
imp |
/*- or .\"- or #- to begin license clauses.
|
139943 |
09-Jan-2005 |
ru |
Scheduled mdoc(7) sweep.
|
133762 |
15-Aug-2004 |
rwatson |
Add a "fillchar" command line argument to dd(1) that permits the user to specify an alternative padding character when using a conversion mode, or when using noerror with sync and an input error occurs. This facilities reading old and error-prone media by allowing the user to more effectively mark error blocks in the output stream.
|
132933 |
31-Jul-2004 |
pjd |
Allow for capital letters as size suffixes.
Inspired by: le Approved by: green (maintainer)
|
129295 |
16-May-2004 |
ru |
Bump document date for the latest functional change. Minor markup tweaks.
|
128048 |
09-Apr-2004 |
njl |
Style fixes and add gen to CLEANFILES.
Submitted by: bde
|
127958 |
06-Apr-2004 |
markm |
Remove clause 3 from the UCB licenses.
OK'ed by: imp, core
|
126749 |
08-Mar-2004 |
ache |
Remove a.out at the end of 'make test'
|
126690 |
06-Mar-2004 |
bde |
Fixed some style bugs (mainly unsorting and tab lossage in previous commit).
|
126687 |
06-Mar-2004 |
ache |
Add a.out to CLEANFILES
|
126685 |
06-Mar-2004 |
ache |
Change locale name from non-existent ASCII to en_US.US-ASCII
|
126667 |
05-Mar-2004 |
phk |
Teach dd(1) about parity bits.
|
126666 |
05-Mar-2004 |
phk |
Add a test-target and reference vectors for the character converions.
|
116282 |
13-Jun-2003 |
markm |
Get this area compiling with the highest WARNS= that it works with. Obsolete WFORMAT= junk also removed where possible.
OK'ed by: obrien Tested on: sparc64, alpha, i386
|
114433 |
01-May-2003 |
obrien |
Quiet warnings about copyright[].
|
112265 |
15-Mar-2003 |
ru |
ssize_t is not required to be the same width as size_t by the specs, so cast to intmax_t where appropriate.
Pointed out by: bde
|
112254 |
15-Mar-2003 |
ru |
Fixed (soon might be fatal) -Wformat warnings.
|
111629 |
27-Feb-2003 |
markm |
WARNS=4 fixes. This would be WARNS=9 if we were -std=99 instead of -ansi, due to 'long long'.
Reviewed by: green (slightly earlier version)
|
109873 |
26-Jan-2003 |
phk |
Don't call DIOCWLABEL on disks, it is not implemented, and calling it like this negated any practical value of the feature.
|
107282 |
26-Nov-2002 |
ru |
mdoc(7) police:
Revert to using the .Tn POSIX and .Tn ANSI instead of \*[Px] and \*[Ai] strings; using these strings is unsafe in troff mode, as they include a change in a font size.
Approved by: re
|
99109 |
30-Jun-2002 |
obrien |
Consistently use __FBSDID
|
98061 |
09-Jun-2002 |
keramida |
Replace <strings.h> with <string.h>. No functions from the former are used in this file, and strlen() needs to be prototyped by the latter, for this to compile without warnings.
Reviewed by: mike
|
97458 |
29-May-2002 |
ru |
mdoc(7) police: replace the XXX with the correct width.
|
96383 |
11-May-2002 |
jedgar |
Add semicolon to empty default case to silence warning.
|
93486 |
31-Mar-2002 |
keramida |
Various mdoc fixes, including a change that corrects spacing as described in PR docs/36461.
PR: docs/36461 Noticed by: Gary W. Swearingen <swear@blarg.net> Submitted by: ru
|
91807 |
07-Mar-2002 |
markm |
1) Rev.1.35 of dd.c has a more serious regression. It backs out rev.1.31, thus breaking systems with unpolluted <sys/stat.h>'s.
2) Back out an initialisation of a variable in BSS.
Reported by: bde (1), many(2)
|
91079 |
22-Feb-2002 |
markm |
Fix warnings inspired by lint, a commercial lint and WARNS=4.
|
90331 |
07-Feb-2002 |
green |
Correct a logic bug that snuck in and broke multiplication of off_ts.
|
90166 |
04-Feb-2002 |
kris |
Lock down with WFORMAT=1 except those directories with unfixed warnings. Tested on i386 and alpha.
|
90108 |
02-Feb-2002 |
imp |
o __P has been reoved o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are.
Approved by: arch@, new style(9)
|
89788 |
25-Jan-2002 |
green |
Commit general cleanups (separate get_num() and get_off_t() functions to debogosify some of the command-line string-number conversions into an unsigned and signed variant.)
|
87323 |
04-Dec-2001 |
obrien |
Default to WARNS=2. Binary builds that cannot handle this must explicitly set WARNS=0.
Reviewed by: mike
|
81687 |
15-Aug-2001 |
ru |
mdoc(7) police: utilize the new .Ex macro.
|
81622 |
14-Aug-2001 |
ru |
mdoc(7) police: s/BSD/.Bx/ where appropriate.
|
78985 |
29-Jun-2001 |
green |
Use __unused for non-used variables.
Submitted by: Mike Barcroft <mike@q9media.com>
|
78755 |
25-Jun-2001 |
dd |
Previous commit broke dd(1)'s I/O summary when it's terminated by a signal. Fix it by adding an explicit call to summary() in terminate() (it was previously called implicitly by exit() because summary() was registered with atexit()). summary() is supposed to be signal-safe-- it handles SIGINFO almost exclusively--so this should be safe.
Submitted by: bde
|
78688 |
24-Jun-2001 |
dd |
Don't call exit(3) from a signal handler.
Obtained from: OpenBSD
|
78469 |
19-Jun-2001 |
des |
Add more headers that are required with -fno-builtin (stdlib and strings)
|
68935 |
20-Nov-2000 |
ru |
mdoc(7) police: use the new features of the Nm macro.
|
67451 |
22-Oct-2000 |
green |
Allow negative seek offsets for files that can be seeked upon. It makes dd(1) a more complete "filter", even if this functionality is limited to seekable streams.
|
66907 |
10-Oct-2000 |
wollman |
Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and thereby <time.h>).
|
63688 |
20-Jul-2000 |
green |
Make the comment regarding ftruncate() correct.
|
62311 |
01-Jul-2000 |
green |
Various cleanups are made to reduce warnings and make code prettier :) Also, check for ftruncate() return value and die on failure, but only try to ftruncate() when the file is a regular file.
|
60859 |
24-May-2000 |
obrien |
Fix ``dd if=/dev/zero of=/dev/daN'' on the Alpha by allowing the label to be overwritten.
Submitted by: green
|
57639 |
01-Mar-2000 |
green |
After Bruce kindly explained the whole groff "sentence" idea to me, I've put the whitespace in the right place.
|
57534 |
27-Feb-2000 |
green |
Fix style bugs I introduced in the last revision.
Brucified by: bde
|
57523 |
26-Feb-2000 |
green |
Add iseek= and oseek= aliases for the preexisting skip= and seek= operands. Can _YOU_ tell skip= and seek= apart with 100% accuracy every time?
This also seems to make us option-for-option compatible with the Solaris dd(1).
Approved by: jkh Suggested by: peter
|
57308 |
18-Feb-2000 |
gsutter |
Reflect that dd accepts octal and hexadecimal numbers (in addition to decimal).
PR: 16750 Submitted by: Giorgos Keramidas <keramida@ceid.upatras.gr>
|
54278 |
08-Dec-1999 |
green |
I've been Brucified! I did evil things with typedefs, but I'll do it the correct (but less aesthetic) way, now. New lesson: correctness and aestheticity may be mutually exclusive at times.
Brucified by: bde
|
54245 |
07-Dec-1999 |
green |
Do proper constification in args.c. This shuts up -Wcast-qual (thanks, bfumerola for that pointer!) in GCC complaining about losing a const.
While I'm here, might as well mark in the Makefile that I'm the ${MAINTAINER}. It seems like that's what everyone's doing these days.
|
51913 |
03-Oct-1999 |
green |
Nuke the FIODTYPE compatibility bits. It's time.
|
51335 |
16-Sep-1999 |
green |
Make count=0 set cpy_cnt to -1, which is slight overloading, but makes what I was trying to do work much better (ie at all. I could have sworn it was working...) Fix a SEEK_SET to be SEEK_CUR, and make Bruce's lseek() test work correctly.
|
51326 |
16-Sep-1999 |
green |
Let count=-something fail, while count=0 may succeed, thus making dd(1) useful as a seeking-tool as well as its many other uses. Previously, dd(1) would succeed with count=0, but wouldn't get to the point that blocks were to be read/written. This is a more useful behavior, and this specific case doesn't seem to be handled by POSIX.
|
51249 |
13-Sep-1999 |
green |
Even more dd(1) cleanups! Thanks to Bruce for staying on my case until we're done (not yet!) :)
|
51212 |
12-Sep-1999 |
green |
ISDISK -> ISSEEK
Allow a device type of D_DISK or D_MEM to be ISSEEK.
|
51208 |
12-Sep-1999 |
green |
Even more cleanups to dd(1). This is probably the culmination of the BDEification process of dd(1). Most of the changes are from BDE's archive. Support for negative offsets is gone again, but the case where you lseek() onto byte -1 of something from a negative offset using seek/skip is fixed; if you end up on -1, you won't get a false positive lseek failure. The biggest changes are to data types (more size_t, for instance) and argument parsing. skip/seek on /dev/{,k}mem now occurs (instead of "read until you reach the offset") due to mem devices now being D_DISK. Some const things are now correctly declared as such, and the "case table" building is better. The only thing that seems to be left to make dd(1) everything TOG wants it to be is l10n.
|
51137 |
11-Sep-1999 |
green |
Make a bit more headway with dd's argument parsing, etc. get_bsz() is renamed get_num() since it's not just about block sizes. skip and seek can be any offset, including negative, now. Some style bogons are fixed.
|
50487 |
28-Aug-1999 |
green |
Relax things a bit. Not having FIODTYPE will be a warning for now.
Pointy hat: green Pointed out by: peter
|
50471 |
27-Aug-1999 |
peter |
$Id$ -> $FreeBSD$
|
50460 |
27-Aug-1999 |
green |
Use FIODTYPE to unbogosify much of the file type checking in dd.
|
48802 |
13-Jul-1999 |
green |
Implement seekability for disk devices (not just regular files). Also, fix pos_out() to do the same checks pos_in() did.
Done for: jdp, luigi, the good of the world
|
48051 |
20-Jun-1999 |
green |
This is the second round of dd(1) changes. Some changes made/reversed by request of Bruce. More changes may follow later. 'g' multiplier has been added (i.e. dd seek=5g if=bigfile.) Some minor corrections were made as well.
Noticed by: bde
|
48026 |
19-Jun-1999 |
green |
Miscellaneous dd(1) changes: mainly fixing variable types (size_t, ssize_t, off_t, int, u_int64_t, etc.). dd(1) should now work properly with REALLY big amounts of data.
|
46684 |
08-May-1999 |
kris |
Various spelling/formatting changes.
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
|
46073 |
25-Apr-1999 |
imp |
First set of fixes to keep egcs happy. These include {} around single statement if blocks[*] when the else could be ambiguous, not defaulting to int type and removal of some unused variables.
[*] This is explicitly allowed by style(9) when the single statement spans more than one line.
Reviewed by: obrien, chuckr
|
41583 |
07-Dec-1998 |
bde |
Fixed printf format errors.
|
41411 |
29-Nov-1998 |
bde |
Describe `bs=n' more precisely. Fixed some English errors.
Obtained from: OpenBSD
|
36007 |
13-May-1998 |
charnier |
Restore Lite-2 sccsid. Restore include of sys/types.h.
|
35773 |
06-May-1998 |
charnier |
Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc.
|
33776 |
24-Feb-1998 |
bde |
Exit with a nonzero status if we get killed by a SIGINT. POSIX.2 specifies exiting with a zero status if the file was copied successfully, and with a nonzero status if an error occurred. We are too sloppy to tell if the file was copied successfully when we get killed by a SIGINT, but it is unlikely to have been. Added a comment about related sloppiness (calling exit() from a signal handler).
|
33234 |
11-Feb-1998 |
asami |
Fix printing for bytes read > 4G.
Reviewed by: bde
|
32325 |
07-Jan-1998 |
joerg |
Oops, back out rev 1.5, it wasn't my intention to also commit the -g. ;)
|
32324 |
07-Jan-1998 |
joerg |
Use the correct value in the call to swab(3) with conv=swab. Previously, dd if=/dev/zero of=/dev=null obs=23520 conv=swab coredumped.
Please somebody review it, i'm not 105 % sure i'm understanding all this mess correctly.
Detected by: Holm Tiffe <holm@geophysik.tu-freiberg.de>
|
31746 |
15-Dec-1997 |
eivind |
It's more portable to use <errno.h> than <sys/errno.h>
Pointed-out-by: bde (a long while ago)
|
31120 |
11-Nov-1997 |
joerg |
Sort "sparse" into alphabetical order, since dd's `conv' options need to be sorted. This temporarily broke the "osync" option.
|
30312 |
11-Oct-1997 |
joerg |
Teach dd(1) about an option to write sparse files. Can be useful for things like diskless clients' swap files etc.
Submitted by: pascal@zuo.dec.com (Pascal Pederiva) (ages ago, with many stylistic changes by me)
|
30246 |
09-Oct-1997 |
eivind |
Add <sys/errno.h>
|
30231 |
08-Oct-1997 |
eivind |
make signal handlers errno safe
Obtained from: OpenBSD (file rev 1.5) Theo de Raadt <deraadt@openbsd.org>
|
30230 |
08-Oct-1997 |
eivind |
Slightly improved fix compared to my insiration
don't munge argv strings -- copy them first. avoids 'w' showing: deraadt p8 zeus.theos.com 8:26AM 3 dd if of bs
Obtained from: OpenBSD (file rev 1.3) by Theo de Raadt <deraadt@openbsd.org>
|
28430 |
19-Aug-1997 |
jlemon |
Pad the input buffer whenever sync is used, not just if the noerror flag is also set. Change osync to not to tack on an empty block if the input buffer is null, or an even multiple of the blocksize. Also change osync to pad the output with nulls/spaces depending whether this is a block-oriented conversion or not (same as sync).
PR: 3818
|
25317 |
30-Apr-1997 |
bde |
Fixed overflow for attempts to seek to offsets > ULONG_MAX. See the OpenBSD version for more complete fixes. E.g., to seek to offsets > INT_MAX using a block size of 1, block numbers need to be off_t's instead of u_long's.
|
25236 |
28-Apr-1997 |
steve |
Change spelling of ECBDIC to EBCDIC. Closes PR #3402
Submitted by: h-nokubi@nmit.mt.nec.co.jp
|
22988 |
22-Feb-1997 |
peter |
Revert $FreeBSD$ to $Id$
|
21673 |
14-Jan-1997 |
jkh |
Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
|
20420 |
14-Dec-1996 |
steve |
-Wall cleaning.
|
19720 |
13-Nov-1996 |
phk |
Bruce says: "You have been programming in the kernel for too long :-)."
and he's right ... I forgot about this floating point stuff you can use in user-land :-)
Increase precision of duration to microseconds. No heuristics to avoid overflow in calculation needed - just depend on DBL_MAX being a bit larger than LONG_MAX.
Use double instead of `struct timeval' in dd.h so that everything doesn't have to include <sys/time.h>.
Fixed style bugs in recent and old FreeBSD changes.
Reviewed by: phk Submitted by: bde
|
19694 |
12-Nov-1996 |
phk |
Increase precision of duration to milliseconds. Some heuristics to avoid overflow in calculation attempted.
|
11747 |
23-Oct-1995 |
ache |
Add setlocale LC_CTYPE
|
5702 |
17-Jan-1995 |
ache |
More koshering [ul]case fix, don't use pre-initialized tables at all, treat 0xFF as valid character.
|
5701 |
17-Jan-1995 |
ache |
Make conv=[lu]case works with localized ctype (8bit)
|
3044 |
24-Sep-1994 |
dg |
Added $Id$
|
2923 |
20-Sep-1994 |
phk |
Applied patch to make -Wall and -Dlint shut up.
Reviewed by: phk Submitted by: Josef Grosch <joeg@gagme.wwa.com>
|
1557 |
26-May-1994 |
rgrimes |
This commit was generated by cvs2svn to compensate for changes in r1556, which included commits to RCS files with non-trunk default branches.
|