After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 779175 - registry: Only scan plugin files that end with an extension
registry: Only scan plugin files that end with an extension
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 1.11.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-24 12:53 UTC by Thibault Saunier
Modified: 2018-01-28 18:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
registry: Only scan plugin files that end with an extension (1.85 KB, patch)
2017-02-24 12:53 UTC, Thibault Saunier
none Details | Review
registry: Only scan plugin files that end with an extension (1.04 KB, patch)
2017-02-24 13:23 UTC, Thibault Saunier
committed Details | Review

Description Thibault Saunier 2017-02-24 12:53:44 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'
Comment 1 Thibault Saunier 2017-02-24 12:53:48 UTC
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 2 Tim-Philipp Müller 2017-02-24 13:12:45 UTC
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)

?
Comment 3 Thibault Saunier 2017-02-24 13:23:52 UTC
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 4 Tim-Philipp Müller 2017-02-24 14:49:39 UTC
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?)
Comment 5 Tim-Philipp Müller 2017-02-24 14:50:02 UTC
(Other than that, just push it imho)
Comment 6 Thibault Saunier 2017-02-24 19:20:34 UTC
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