GNOME Bugzilla – Bug 779175
registry: Only scan plugin files that end with an extension
Last modified: 2018-01-28 18:10:42 UTC
Currently the plugin scanner will also scan files like: (gst-plugin-scanner:26801): GStreamer-WARNING **: Failed to load plugin '/home/thiblahute/devel/gstreamer/gst-build/build/subprojects/gst-docs/GStreamer-doc/html/gstreamer-libs-doc-1.0/python/net/assets/js/search/also': /home/thiblahute/devel/gstreamer/gst-build/build/subprojects/gst-docs/GStreamer-doc/html/gstreamer-libs-doc-1.0/python/net/assets/js/search/also: invalid ELF header We should only inspect files that end with '.G_MODULE_SUFFIX'
Created attachment 346632 [details] [review] registry: Only scan plugin files that end with an extension Not file that would for some reason end with 'so' or 'dll', etc...
Comment on attachment 346632 [details] [review] registry: Only scan plugin files that end with an extension >+ gchar *filename, *plugin_extension = g_strconcat (".", G_MODULE_SUFFIX, NULL); >+#ifdef GST_EXTRA_MODULE_SUFFIX >+ gchar *extra_plugin_extension = >+ g_strconcat (".", GST_EXTRA_MODULE_SUFFIX, NULL); >+#endif >- if (!g_str_has_suffix (dirent, G_MODULE_SUFFIX) >+ if (!g_str_has_suffix (dirent, plugin_extension) > #ifdef GST_EXTRA_MODULE_SUFFIX >- && !g_str_has_suffix (dirent, GST_EXTRA_MODULE_SUFFIX) >+ && !g_str_has_suffix (dirent, extra_plugin_extension) > #endif How about just g_str_has_suffix (dirent, "." G_MODULE_SUFFIX) ?
Created attachment 346636 [details] [review] registry: Only scan plugin files that end with an extension Not file that would for some reason end with 'so' or 'dll', etc...
Comment on attachment 346636 [details] [review] registry: Only scan plugin files that end with an extension >- if (!g_str_has_suffix (dirent, G_MODULE_SUFFIX) >+ if (!g_str_has_suffix (dirent, "." G_MODULE_SUFFIX) > #ifdef GST_EXTRA_MODULE_SUFFIX >- && !g_str_has_suffix (dirent, GST_EXTRA_MODULE_SUFFIX) >+ && !g_str_has_suffix (dirent, "." GST_EXTRA_MODULE_SUFFIX) > #endif I just checked and it seems GST_EXTRA_MODULE_SUFFIX already contains a ".", so we just need to do this for G_MODULE_SUFFIX (I think it's kinda right that the define contains the dot, so I'd rather keep it inconsistent here in the code than fix up the GST_EXTRA_MODULE_SUFFIX define - what do you think?)
(Other than that, just push it imho)
Comment on attachment 346636 [details] [review] registry: Only scan plugin files that end with an extension commit 18a5cff70c619e5bb08e0a1c1e4eeb1b996bb478 Author: Thibault Saunier <thibault.saunier@osg.samsung.com> Date: Fri Feb 24 10:23:01 2017 -0300 registry: Only scan plugin files that end with an extension Not file that would for some reason end with 'so' or 'dll', etc... https://bugzilla.gnome.org/show_bug.cgi?id=779175