Thus spake Tobias Weingartner (weingart@natasha.tepid.org):
> > > 4) "truncate file" should mean truncate to zero.
> > No, that's a security risk.
> Care to elaborate?!? How is this any different than
> cp /dev/null file? Why would it be a security risk?
Well, I meant because of the following:
truncate(1) will be often used in scripts.
If you do something like
/usr/bin/truncate ${size} ${file} and $size is empty, it will truncate
the file to 0, even if you wanted it to raise it by 100MB or similar.
This won't happen with rm, which also deletes content, since the
syntax for rm doesn't require to args.
Well, on the other hand, it has always been UNIX tradition to let
people shoot into their feet if they want to.
Alex
--
cat: /home/alex/.sig: No such file or directory