Secure Coding mailing list archives
temporary directories
From: ljknews at mac.com (ljknews)
Date: Sat, 30 Dec 2006 13:28:13 -0500
At 5:11 PM +0100 12/30/06, Florian Weimer wrote:
I gather you are saying that the innards of Unix will force creation of an unwanted directory entry on the Ada implementation of the required null name support for <packagename>.CREATE . The Ada implementation could rely on exclusive access to the file (surely Unix has that, right?)You can create files in a way that fails if the file already exists, using the O_EXCL flag. (Rumors have it that this won't work reliably over NFS, though, but I don't see why.)coupled with whatever Unix has that passes for the FAB$V_DLT bit to delete the file on Close (such as at <insert Unix words for image rundown>).You can delete open files on Unix, so you could in theory unlink it after creation. But the whole discussion is moot because existing Ada code seems to require that temporary files have names. 8-/
The Ada language does not have such a requirement, and in fact has a requirement that names are _not_ required for temporary files.
But these are problems that have been solved by those who provided the Ada implementation (ACT and Aonix come to mind for Unix), and thus are not an issue for the high level language programmer.AdaCore's implementation used mktemp and featured the usual race condition.
Yucko !!! -- Larry Kilgallen
Current thread:
- Compilers, (continued)
- Compilers Leichter, Jerry (Dec 27)
- Compilers David A. Wheeler (Dec 28)
- Compilers Leichter, Jerry (Dec 29)
- temporary directories Robert C. Seacord (Dec 29)
- temporary directories ljknews (Dec 29)
- temporary directories Leichter, Jerry (Dec 29)
- temporary directories ljknews (Dec 29)
- temporary directories Leichter, Jerry (Dec 30)
- temporary directories ljknews (Dec 30)
- temporary directories Florian Weimer (Dec 30)
- temporary directories ljknews (Dec 30)
- Compilers Leichter, Jerry (Dec 29)
- temporary directories der Mouse (Dec 29)
- temporary directories Mark Rockman (Dec 30)