On 12/09/2011 10:11 PM, Bob Proulx wrote:
> Pádraig Brady wrote:
>> Eric Blake wrote:
>>> Amr Ali wrote:
>>>> I'm not sure if this was discussed before, but I've got tired
>>>> from having to work around the lack of native recursion within
>>>> `shred`. So, attached is a patch to add recursion, including
>>>> documentation.
>>>
>>> Thanks for taking the effort to write a patch, but we probably won't
>>> accept this upstream.
>>
>> I agree.
>> Also not that shred is of limited use with files,
>> given that the info is probably spread elsewhere on
>> the disk from moving files around, and temp files,
>> and slop at the end of blocks, ...
> 
> I think perhaps that stronger warnings should be added to the
> documentation that shred isn't appropriate for files on modern
> journaling filesystems.  The very presence of shred leads people to
> believe that it performs strong magic that it can't actually do.  Some
> so much that they will submit patches (highly commendable btw, if
> misguided in this particular case) to make it operate even more on
> files.  We should be discouraging the use of shred on files rather
> than encouraging it.
> 
>   http://stackoverflow.com/questions/913282/shred-doesnt-work-on-journaled-fs

The man page is quite explicit with the warning.
One could make it obvious I suppose with something like:

static bool warn_files;
if (S_ISREG(..) && !warn_files) {
  fprintf (stderr, "Shredding files within a file system is usually not 
secure.\n"
                   "See the documentation for more info.\n");
  warn_files = true;
}

cheers,
Pádraig.

Reply via email to