...
Removal before termination
It is important to remember to cleanup in order to allow filenames and other resources such as secondary storage to be recycled. In the case of abnormal termination, there is no sure method that can guarantee the removal of orphaned files. For this reason tmp cleaner utilities are widely used. These tmp cleaners are invoked manually by a system administrator or run as a cron daemon to sweep temporary directories and remove old files. These tmp cleaners are themselves vulnerable to file-based [exploits|BB. Definitions#exploit], and often require the use of shared directories (see \[[FIO15-A. Do not create temporary files in shared directories]\]). However, during normal operation, it is the responsibility of the program to ensure that temporary files are either removed explicitly, or through the use of library routines such as {{ Wiki Markup tmpfile_s
}} which guarantee their removal upon program termination.
Non-Compliant Code Example: fopen()/open()
with tmpnam()
...