summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-01-07 17:49:29 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-01-07 20:46:24 +0900
commitaa5d996d3c57314d285d005f168d0a6ffe418c3a (patch)
tree5fbd567f2b7d66d6ddb53db7933c5e4b476489e9
parenteb23cc28bbd2782d6963f1a0e73d530704078790 (diff)
eio - protect against posible segv on rename with eio
this MIGHT fix T45 but i can't reproduce to confirm, but reading a backtrace indicates this could have been the issue. it looks like there is room for a dangling pointer anyway, so fix. stable release - cherry-pick me!
-rw-r--r--src/lib/eio/eio_monitor.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/eio/eio_monitor.c b/src/lib/eio/eio_monitor.c
index 247fe7c..53581a4 100644
--- a/src/lib/eio/eio_monitor.c
+++ b/src/lib/eio/eio_monitor.c
@@ -201,7 +201,11 @@ _eio_monitor_rename(Eio_Monitor *monitor, const char *newpath)
201 const char *tmp; 201 const char *tmp;
202 202
203 /* destroy old state */ 203 /* destroy old state */
204 if (monitor->exist) eio_file_cancel(monitor->exist); 204 if (monitor->exist)
205 {
206 eio_file_cancel(monitor->exist);
207 monitor->exist = NULL;
208 }
205 209
206 if (monitor->backend) 210 if (monitor->backend)
207 { 211 {
@@ -218,11 +222,15 @@ _eio_monitor_rename(Eio_Monitor *monitor, const char *newpath)
218 eina_stringshare_del(tmp); 222 eina_stringshare_del(tmp);
219 223
220 /* That means death (cmp pointer and not content) */ 224 /* That means death (cmp pointer and not content) */
225 /* this - i think, is wrong. if the paths are the same, we should just
226 * re-stat anyway. imagine the file was renamed and then replaced?
227 * disable this as this was part of a possible crash due to eio.
221 if (tmp == monitor->path) 228 if (tmp == monitor->path)
222 { 229 {
223 _eio_monitor_error(monitor, -1); 230 _eio_monitor_error(monitor, -1);
224 return; 231 return;
225 } 232 }
233 */
226 234
227 EINA_REFCOUNT_REF(monitor); /* as we spawn a thread for this monitor, we need to refcount specifically for it */ 235 EINA_REFCOUNT_REF(monitor); /* as we spawn a thread for this monitor, we need to refcount specifically for it */
228 236