replace usage of potential dangerous mktemp with mkstemp
authorAngel Guzman Maeso <shakaran@gmail.com>
Tue, 27 Aug 2013 19:29:01 +0000 (21:29 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 27 Aug 2013 19:29:01 +0000 (21:29 +0200)
commit7335eebea6dd43581d4650a8818b06383ab89901
tree043da39864bf345860068352cdff798f13ccfb04
parenta5a5dd04bb1b4a5dd406cfe6c335b3965ee07f28
replace usage of potential dangerous mktemp with mkstemp

Avoid the warning "the use of `mktemp' is dangerous,
better use `mkstemp' or `mkdtemp'". It is not strictly necessary to
change the usage from a security point of view here, but mktemp is
also removed from the standard since POSIX.1-2008.

The mkostemp call returns a file descriptor the logic for
TemporaryFileName has been changed accordingly to get the same results.
The file permissions are corrected by using fchmod() as the default for
FileFd is 666 while mkstemp creates files with 600 by default.
apt-pkg/contrib/fileutl.cc