Don't overwrite multi-linked files: always in code, -P in documentation...
srm is a command-line program to delete files securely.
Brought to you by:
doj
Attempting to secure delete a file with multiple hard links results in a warning from srm stating that the current access path has been unlinked, but the data itself was not overwritten or truncated.
This is erroneously documented in 1.2.11 as a behaviour activated by the OpenBSD rm-compatible option -P. See the srm man page.
However, in the srm implementation, the behaviour of unlinking but not overwriting multi-linked files is always active. See the first few sections of the sunlink function in sunlink.c.
I would expect the code and man page to be consistent.
you are correct. I think however that with multiple hard links srm should only remove the current link and not overwrite. So the solution here is to change the srm man page.
Ah, yes, that's what I had in mind…