c++ - On Linux, is the command-line program mktemp less safe than the C-function mkstemp? -


Both operations create an empty file and return the file name but opens the mkstemp file in unique mode and lets you handle . Is there a security benefit to the c-function? Does this mean that the command line version has a security hole? On the one hand, it is interesting that there are many related functions in the C APIs on Linux, and most of them use "don" t or function "(or similar) in their man page.

/ Div>

As you easily mktemp (1) source code, it is essentially the There is nothing to call on mkstemp (3) .

Special mode in Linux means that the function file will fail, already exists, this locking is not guaranteed

The function compared to the command line utility.


Comments