summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con/efl_net_server_unix.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-02-15 11:56:13 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-02-15 11:58:12 +0000
commit6a0de945e00938f86c5224bf4f2fb5e8a526b3b3 (patch)
tree53039dbf3200796969f31c784ac07ddc99e981aa /src/lib/ecore_con/efl_net_server_unix.c
parent0802f4dc95603b2c95c854c627fd297dd95412aa (diff)
ecore con - also be paranoid with same nul byte checks in path str
this won't affect the target system which doesn't do abstract sockets anyway, and it's just unlink "" ... but check if first byte is nul for an asbtract socket and dont do lock files or unlinking in this case
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_con/efl_net_server_unix.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/ecore_con/efl_net_server_unix.c b/src/lib/ecore_con/efl_net_server_unix.c
index 9f9af5a2a4..37d2c7302d 100644
--- a/src/lib/ecore_con/efl_net_server_unix.c
+++ b/src/lib/ecore_con/efl_net_server_unix.c
@@ -61,8 +61,6 @@ _efl_net_server_unix_bind_hang_lock_workaround(const char *address, Eina_Bool lo
61 char *lockfile; 61 char *lockfile;
62 int ret; 62 int ret;
63 63
64 if (strncmp(address, "abstract:", strlen("abstract:")) == 0) return -1;
65
66 addrlen = strlen(address); 64 addrlen = strlen(address);
67 lockfile = malloc(addrlen + 1 + 5); 65 lockfile = malloc(addrlen + 1 + 5);
68 if (!lockfile) return -1; 66 if (!lockfile) return -1;
@@ -189,15 +187,18 @@ _efl_net_server_unix_bind(Eo *o, Efl_Net_Server_Unix_Data *pd)
189 } 187 }
190 188
191#ifdef BIND_HANG_WORKAROUND 189#ifdef BIND_HANG_WORKAROUND
192 pd->lock_fd = _efl_net_server_unix_bind_hang_lock_workaround 190 if (addr.sun_path[0] != '\0')
193 (address, EINA_TRUE, -1);
194 if (pd->lock_fd < 0)
195 { 191 {
196 err = EADDRINUSE; 192 pd->lock_fd = _efl_net_server_unix_bind_hang_lock_workaround
197 goto error; 193 (addr.sun_path, EINA_TRUE, -1);
194 if (pd->lock_fd < 0)
195 {
196 err = EADDRINUSE;
197 goto error;
198 }
199 pd->have_lock_fd = EINA_TRUE;
200 unlink(addr.sun_path);
198 } 201 }
199 unlink(addr.sun_path);
200 pd->have_lock_fd = EINA_TRUE;
201#endif 202#endif
202 r = bind(fd, (struct sockaddr *)&addr, addrlen); 203 r = bind(fd, (struct sockaddr *)&addr, addrlen);
203 if (r != 0) 204 if (r != 0)