summaryrefslogtreecommitdiff
path: root/src/bin/efreet
diff options
context:
space:
mode:
authorSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-10-14 13:20:44 +0200
committerSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-10-14 13:20:44 +0200
commite2dabc5d23c60a9faa79b4c5357da2a944c5272f (patch)
tree3a06246dcd8cd0a65a8b8ad0f3629cf8c1db7b9a /src/bin/efreet
parent67a8feeb08e9dd6e58a1fb148a826e781ca5260d (diff)
efreet: Set umask before creating temporary file
CID 1039615
Diffstat (limited to 'src/bin/efreet')
-rw-r--r--src/bin/efreet/efreetd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index fd4e8a05f0..18fc500db1 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -28,13 +28,17 @@ main(int argc, char *argv[])
28{ 28{
29 char path[PATH_MAX]; 29 char path[PATH_MAX];
30 FILE *log; 30 FILE *log;
31 mode_t um;
31 32
32 strcpy(path, "/tmp/efreetd_XXXXXX"); 33 strcpy(path, "/tmp/efreetd_XXXXXX");
34 um = umask(0077);
33 if (mkstemp(path) < 0) 35 if (mkstemp(path) < 0)
34 { 36 {
35 perror("mkstemp"); 37 perror("mkstemp");
38 umask(um);
36 return 1; 39 return 1;
37 } 40 }
41 umask(um);
38 if (chmod(path, 0700) < 0) 42 if (chmod(path, 0700) < 0)
39 { 43 {
40 perror("chmod"); 44 perror("chmod");