summaryrefslogtreecommitdiff
path: root/src/bin/e_ipc.c
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2013-12-07 21:32:11 +0100
committerSebastian Dransfeld <sd@tango.flipp.net>2013-12-07 21:32:11 +0100
commit05f00710f22382902ac866461f8287a0fce90616 (patch)
treeceb4cf461bb23e6c56dcf32548652ab6c91514de /src/bin/e_ipc.c
parentc0fa42fcdd09e5a32a8ea62e2c8f7f1cc1ee2ca5 (diff)
Check return value from mkdir
If mkdir fails, no need to stat. Fixes CID 1039963
Diffstat (limited to 'src/bin/e_ipc.c')
-rw-r--r--src/bin/e_ipc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/e_ipc.c b/src/bin/e_ipc.c
index 765b56e..e2853ce 100644
--- a/src/bin/e_ipc.c
+++ b/src/bin/e_ipc.c
@@ -80,7 +80,8 @@ e_ipc_init(void)
80 { 80 {
81 snprintf(buf, sizeof(buf), "%s/e-%s@%x", 81 snprintf(buf, sizeof(buf), "%s/e-%s@%x",
82 base, user, id1); 82 base, user, id1);
83 mkdir(buf, S_IRWXU); 83 if (mkdir(buf, S_IRWXU) < 0)
84 goto retry;
84 if (stat(buf, &st) == 0) 85 if (stat(buf, &st) == 0)
85 { 86 {
86 if ((st.st_uid == getuid()) && 87 if ((st.st_uid == getuid()) &&
@@ -94,6 +95,7 @@ e_ipc_init(void)
94 if (_e_ipc_server) break; 95 if (_e_ipc_server) break;
95 } 96 }
96 } 97 }
98retry:
97 id1 = rand(); 99 id1 = rand();
98 } 100 }
99 if (!_e_ipc_server) 101 if (!_e_ipc_server)