GNOME Bugzilla – Bug 660146
gnome-user-share fails to discover a port for webdav server
Last modified: 2011-10-17 14:00:10 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>.
*** Bug 618811 has been marked as a duplicate of this bug. ***
*** Bug 660658 has been marked as a duplicate of this bug. ***
$ 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.
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