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 660146 - gnome-user-share fails to discover a port for webdav server
gnome-user-share fails to discover a port for webdav server
Status: RESOLVED FIXED
Product: gnome-user-share
Classification: Core
Component: general
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-user-share maintainers
gnome-user-share maintainers
: 618811 660658 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-26 15:06 UTC by Michael Terry
Modified: 2011-10-17 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (993 bytes, patch)
2011-09-26 15:06 UTC, Michael Terry
none Details | Review

Description Michael Terry 2011-09-26 15:06:38 UTC
Created attachment 197489 [details] [review]
Proposed patch

Originally filed in Ubuntu: https://launchpad.net/bugs/856732

"""
gnome-user-share (as of 3.0.0, as seen in Oneiric beta) tries to discover a free port to run Apache on by bind()ing a struct sockaddr_in with no port specified in src/http.c:get_port(). However, it neglects to specify an address family, so that attempt fails with EINVAL, and the -1 returned gets passed to spawn_httpd() as the port that Apache should be listening on, which causes to Apache promptly and silently bail. I've attached a debdiff that contains a patch fixing this by specifying AF_INET as the address family.
"""

Bug discovered by and patch written by Adam Glasgall <adam@crossproduct.net>.
Comment 1 Bastien Nocera 2011-10-17 13:37:21 UTC
*** Bug 618811 has been marked as a duplicate of this bug. ***
Comment 2 Bastien Nocera 2011-10-17 13:37:36 UTC
*** Bug 660658 has been marked as a duplicate of this bug. ***
Comment 3 Bastien Nocera 2011-10-17 13:40:07 UTC
$ diffstat -l /tmp/Proposed-patch-A76PRU.patch
08_fix_port_discovery.patch

Patch to a patch, and the final patch is in non-git format. While I appreciate the one-liner, I'm sure a bit more prep work could be done for us busy upstreams.
Comment 4 Bastien Nocera 2011-10-17 14:00:10 UTC
commit 24cc0e2ecc60619af0e51e730ef68bf750182dcf
Author: Adam Glasgall <adam@crossproduct.net>
Date:   Mon Oct 17 14:40:29 2011 +0100

    Fix http sharing not workin on Linux 3.0
    
    gnome-user-share tries to discover a free port to run Apache on by
    bind()ing a struct sockaddr_in with no port specified in
    src/http.c:get_port(). However, it neglects to specify an address
    family, so that attempt fails with EINVAL, and the -1 returned gets
    passed to spawn_httpd() as the port that Apache should be listening on,
    which causes to Apache promptly and silently bail.
    
    This error was caused by a regression in Linux 3.0:
    http://thread.gmane.org/gmane.linux.network/205326/focus=205328
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660146