On Wed, 6 Oct 2010, Jonathan wrote:
On Wed, 6 Oct 2010 09:41:03 +0200 (CEST)
Michael Van Canneyt <mich...@freepascal.org> wrote:
I'm open for some more sophisticated algorithm which does some more checking.
Michael.
Honour one of the temp directory environment variables, I know of TMPDIR, TEMP,
TMP. I think it would be best to check them in order and then default to /tmp/.
Create a folder in the temp directory naming it after the user name. E.g
/tmp/myusername/
Ensure only the owner can read and write in the folder.
Create a folder in "/tmp/myusername/" using your program name.
Then create your temp file. so you have "/tmp/myusername/programname/tmp01"
You should only need to check for symlinks, hardlinks and read/write rights on the
"/tmp/myusername" folder.
What is the cost?
Two more inodes
More cpu time
What do you get?
It hides the file's names
Good layout
Easier to use Tomoyo and Apparmour.
I'm all for it, but I was kind of hoping for an implementation :-)
Michael.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal