When we create temporary files using tmpfile, in most cases we cannot easily predict the name. Coverity scan also complains about its vulnerability. So is there any function to create a temporary file which cannot be guessed easily?
Asked
Active
Viewed 369 times
-4
-
5What is the question? – Sourav Ghosh Nov 02 '17 at 12:23
-
What you can do is generate a random string (please search internet how to do this) and use this random string to name your file in `fopen()`. – Gaurav Pathak Nov 02 '17 at 12:29
-
I was looking for a similar function like tmpfile, Of course I can choose to call fopen, but if there is already a function why should I write ? – RAFI KC Nov 06 '17 at 16:01
1 Answers
2
-
1`mkstemp()` also has some security issues, Refer [this link](http://www.securiteam.com/unixfocus/6H00S0K6AA.html). – Gaurav Pathak Nov 02 '17 at 12:32
-
-