From: Sebastian Harl Date: Sat, 29 Aug 2009 12:57:18 +0000 (+0200) Subject: patches: Updated plugin-fix-unregister.dpatch. X-Git-Tag: collectd-4.7.2-1~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bb3839a4016aca8f28982f8e2bd4a1744ceb6105;p=pkg-collectd.git patches: Updated plugin-fix-unregister.dpatch. A segfault in case the named plugin does not exists has been fixed in the upstream collectd-4.7 branch. --- diff --git a/debian/patches/plugin-fix-unregister.dpatch b/debian/patches/plugin-fix-unregister.dpatch index 7e12ceb..3bb4410 100755 --- a/debian/patches/plugin-fix-unregister.dpatch +++ b/debian/patches/plugin-fix-unregister.dpatch @@ -185,7 +185,7 @@ diff a/src/plugin.c b/src/plugin.c } /* int plugin_register_complex_read */ int plugin_register_write (const char *name, -@@ -816,12 +871,37 @@ int plugin_unregister_init (const char *name) +@@ -816,12 +871,45 @@ int plugin_unregister_init (const char *name) return (plugin_unregister (list_init, name)); } @@ -211,6 +211,14 @@ diff a/src/plugin.c b/src/plugin.c + } + + le = llist_search (read_list, name); ++ if (le == NULL) ++ { ++ pthread_mutex_unlock (&read_lock); ++ WARNING ("plugin_unregister_read: No such read function: %s", ++ name); ++ return (-ENOENT); ++ } ++ + llist_remove (read_list, le); + + rf = le->value; @@ -228,7 +236,7 @@ diff a/src/plugin.c b/src/plugin.c int plugin_unregister_write (const char *name) { -@@ -1093,6 +1173,12 @@ void plugin_shutdown_all (void) +@@ -1093,6 +1181,12 @@ void plugin_shutdown_all (void) stop_read_threads (); destroy_all_callbacks (&list_init);