[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
RE: how to i return a filesize to "0"....?
- From: "Mr. M" <mistrM gtemail net>
- To: <redhat-install-list redhat com>
- Subject: RE: how to i return a filesize to "0"....?
- Date: Sun, 1 Aug 1999 22:23:43 -0700
> Assuming you want to make file "/var/log/X" zero length you'd do (as root,
> or somebody with write permission for this file):
>
> rm /var/log/X
> touch /var/log/X
>
Don't do this. This can lead to SERIOUS security problems. When you
"touch" a file an empty plain file is created, yes. However, it is created
with the default permissions specified by your umask and group. If you
forget to chmod/chown/chgrp the file/directory you could possibly create a
security hole.
Try:
cat /dev/null > /path/to/my/file
The file ownership and permissions should remain correct.
Mario Paz - Paranoid and loving it! ;)
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]