efreet: Use mkstemp for tempfile

CID: #1039615
This commit is contained in:
Sebastian Dransfeld 2013-08-07 10:18:59 +02:00
parent 6a7f417cec
commit f854efd041
1 changed files with 7 additions and 5 deletions

View File

@ -26,13 +26,15 @@ quit(void)
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
char buf[PATH_MAX]; char path[PATH_MAX];
char *path;
FILE *log; FILE *log;
strcpy(buf, "/tmp/efreetd_XXXXXX"); strcpy(path, "/tmp/efreetd_XXXXXX");
path = mktemp(buf); if (mkstemp(path) < 0)
if (!path) return 1; {
perror("mkstemp");
return 1;
}
if (chmod(path, 0700) < 0) if (chmod(path, 0700) < 0)
{ {
perror("chmod"); perror("chmod");