Re: [libosinfo PATCH 0/7] Drop GVFS dependency in favour of libsoup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 2, 2019 at 9:29 PM Cole Robinson <crobinso@xxxxxxxxxx> wrote:
>
> On 7/2/19 2:07 PM, Fabiano Fidêncio wrote:
> > On Tue, Jul 2, 2019 at 1:51 AM Cole Robinson <crobinso@xxxxxxxxxx> wrote:
> >>
> >> On 6/27/19 8:56 AM, Fabiano Fidêncio wrote:
> >>> Let's rely on libsoup in order to to http://, https://, and ftp://
> >>> requests.
> >>>
> >>> By doing this, GVFS (more specifically, gvfs-http) won't be dragged as
> >>> a dependency, which caused errors for apps running as root (as GVFS
> >>> relies on being run in the user's session).
> >>>
> >>> https://gitlab.com/libosinfo/libosinfo/issues/30
> >>>
> >>> Fabiano Fidêncio (7):
> >>>   media: Fix indentation in create_from_location_asunc_data_free()
> >>>   tree: Remove not used Tree from _CreateFromLocationAsyncData struct
> >>>   media: Improve on_location_read error message readability
> >>>   media: Use GInpuStream directly in on_location_read()
> >>>   media: Use libsoup for http://, https://, and ftp:// requests
> >>>   tree: Use libsoup for http://, https://, and ftp:// requests
> >>>   spec: Drop gvfs dependency
> >>>
> >>>  configure.ac          |   5 +-
> >>>  libosinfo.spec.in     |   2 +-
> >>>  osinfo/Makefile.am    |   5 +-
> >>>  osinfo/libosinfo.syms |   2 +
> >>>  osinfo/osinfo_media.c |  86 ++++++++++++++++++++++++---------
> >>>  osinfo/osinfo_tree.c  | 108 +++++++++++++++++++++++++++++-------------
> >>>  osinfo/osinfo_tree.h  |  11 +++++
> >>>  7 files changed, 159 insertions(+), 60 deletions(-)
> >>>
> >>
> >> Does libsoup actually handle FTP?
> >
> > Theoretically, yes:
> > https://gitlab.gnome.org/GNOME/libsoup/blob/master/libsoup/soup-uri.h#L35
> >
>
> I just grepped through the sources and git log, I don't see any evidence
> that it supports actual use of the ftp protocol, unless it's using some
> extra library for that. There's mention of http-aliases which seems to
> indicate that libsoup can be taught to treat ftp:// URLs as just an
> alias for http://, and the git log seems to suggest that was the
> historical default.
>
> >> Googling doesn't turn up any obvious
> >> hits. That said I don't know if GVFS handles it either.
> >
> > It also should, through gvfs-ftp, which seems to just use GSocket
> > under the hood.
> > >> With the
> >> virt-manager test suite and libosinfo git master, I see:
> >>
> >> $ ./setup.py test_urls --debug --force-libosinfo --only fedora-ftp
> >> ...
> >> DEBUG    Error creating libosinfo tree object for
> >> location=ftp://ftp.tu-chemnitz.de/pub/linux/fedora/linux/releases/30/Server/x86_64/os/
> >> : g-io-error-quark: Failed to load .treeinfo|treeinfo file: The
> >> specified location is not mounted (16)
> >> ...
> >>
> >> So it doesn't seem to work anyway. But with your patch series it hangs
> >> until it hits a two minute socket timeout. Which makes me wonder if
> >> libsoup is trying to talk http to an ftp URL.
> >
> > May be the case and may be a bug in libsoup.
> >
> >>
> >> FWIW I don't think that should be an argument for keeping a gvfs
> >> dependency. It's getting hard to even find public ftp mirrors these days
> >
> > Indeed.
> > I'm wondering about the check to do. Hardcoding "https://";, "http://";
> > seems quite bad.
>
> FWIW that's what we've done in virt-install for years and it's never
> really been a problem.
>
>  Maybe I should just create the file and then check
> > for g_file_is_native() as done in osinfo-db-tools?
>
> I'd need to study up on this approach more to give an opinion. I think
> the important thing is to try and limit accidental access to gvfs,
> unless it's for an explicit case we really don't care much about like ftp://


Based on this and on the answer above, I'll just have the harcoded
check for "http://"; and "https://"; and be happy about this.
I'll change the docs to mention explicitly that we support local,
http://, and https:// files and submit a v2.

Thanks a lot for the input!

>
> - Cole

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux