Subject: bug#24244: bug: dd deletes file

From: Assaf Gordon <[email-masked]>
Date: Sun, 28 Oct 2018 00:30:59 -0600

retitle 24244 dd: protect against same file in input,output
severity 24244 wishlist
tags 24244 wontfix
close 24244
stop

(triaging old bugs)

On 2016-08-16 10:03 a.m., Pádraig Brady wrote:
> On 16/08/16 16:44, puggy wrote:
>> by mistakes i used the same input and output file.
>> dd said it wrote 0 bytes, but what it actually did
>> is overwrite the file and setting it back to zero.
>> doing so, dd deleted a 4.3G file in a fraction of
>> a blink.
[....]
>> please find some solution for it. if it is
>> intentional, make an option for it. this way
>> you can also shorten the command. otherwise
>> if input and output are the same, warn the user!
> 
> Well dd is a low level tool so we have to be careful
> to not preclude operations which may be valid in some cases.
> For example one might definitely want to read/write the same device.

With no further comments in 2 years, I'm closing this bug.
Discussion can continue by replying to this thread.

-assaf