aboutsummaryrefslogtreecommitdiffstats
path: root/x11
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2009-05-17 06:15:20 +0800
committermarcus <marcus@FreeBSD.org>2009-05-17 06:15:20 +0800
commitfa10011c113a7502eae907b241191d08f54249cb (patch)
treeb8c5c10c8907023eacd35e6479c6815fe9e1f803 /x11
parent8a871ae553ce74685f82c3f09c637354861f48c3 (diff)
downloadfreebsd-ports-gnome-fa10011c113a7502eae907b241191d08f54249cb.tar.gz
freebsd-ports-gnome-fa10011c113a7502eae907b241191d08f54249cb.tar.zst
freebsd-ports-gnome-fa10011c113a7502eae907b241191d08f54249cb.zip
* Fix XDMCP support with gdm. Note: that for IPv4 support to work, one
must rebuild gdm after disabling IPV6 support in the OPTIONS menu. * Set IPV6 support to DISABLED by default. * Add support for '&' in the gecos field.
Diffstat (limited to 'x11')
-rw-r--r--x11/gdm/Makefile8
-rw-r--r--x11/gdm/files/patch-common_gdm-address.c22
-rw-r--r--x11/gdm/files/patch-common_gdm-address.h11
-rw-r--r--x11/gdm/files/patch-daemon-gdm-xdmcp-display-factory.c141
-rw-r--r--x11/gdm/files/patch-gui_simple-chooser_gdm-host-chooser-widget.c26
-rw-r--r--x11/gdm/files/patch-gui_simple-greeter_gdm-user.c34
6 files changed, 230 insertions, 12 deletions
diff --git a/x11/gdm/Makefile b/x11/gdm/Makefile
index bf7dfe3c1e4d..ba88d04917d5 100644
--- a/x11/gdm/Makefile
+++ b/x11/gdm/Makefile
@@ -8,7 +8,7 @@
PORTNAME= gdm
PORTVERSION= 2.26.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= x11 gnome
MASTER_SITES= GNOME
DIST_SUBDIR= gnome2
@@ -36,7 +36,7 @@ USE_GNOME= gnomehack intlhack gnomehier libgnomeui librsvg2 gnomedocutils \
GCONF_SCHEMAS= gdm-simple-greeter.schemas
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --with-working-directory=${PREFIX}/etc/gdm/home
-CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -DHAS_SA_LEN" \
LDFLAGS="-L${LOCALBASE}/lib" \
GTKDOC="false"
@@ -47,7 +47,7 @@ PKGMESSAGE= ${WRKDIR}/pkg-message
GNOME_LOCALSTATEDIR= /var
-OPTIONS= IPV6 "Enable IPv6 support" on \
+OPTIONS= IPV6 "Enable IPv6 support" off \
KEYRING "Enable GnomeKeyring/PAM integration" on
.include <bsd.port.pre.mk>
@@ -59,7 +59,7 @@ RUN_DEPENDS+= ${LOCALBASE}/lib/pam_gnome_keyring.so:${PORTSDIR}/security/gnome-k
SUB_LIST+= PAM_KEYRING=
.endif
-.if !defined(WITHOUT_IPV6)
+.if defined(WITH_IPV6)
CONFIGURE_ARGS+= --enable-ipv6
.else
CONFIGURE_ARGS+= --disable-ipv6
diff --git a/x11/gdm/files/patch-common_gdm-address.c b/x11/gdm/files/patch-common_gdm-address.c
index 4c38474cb637..a827d4b6d1b6 100644
--- a/x11/gdm/files/patch-common_gdm-address.c
+++ b/x11/gdm/files/patch-common_gdm-address.c
@@ -1,5 +1,5 @@
---- common/gdm-address.c.orig 2008-04-17 23:29:27.000000000 -0400
-+++ common/gdm-address.c 2008-05-02 14:36:15.000000000 -0400
+--- common/gdm-address.c.orig 2009-02-19 21:45:13.000000000 -0500
++++ common/gdm-address.c 2009-05-11 02:38:17.000000000 -0400
@@ -29,6 +29,8 @@
#include <stropts.h>
#endif
@@ -25,3 +25,21 @@
#include <glib-object.h>
+@@ -206,7 +208,7 @@ gdm_address_get_hostname (GdmAddress *ad
+
+ host [0] = '\0';
+ res = getnameinfo ((const struct sockaddr *)address->ss,
+- sizeof (struct sockaddr_storage),
++ gdm_sockaddr_len (address->ss),
+ host, sizeof (host),
+ NULL, 0,
+ 0);
+@@ -245,7 +247,7 @@ gdm_address_get_numeric_info (GdmAddress
+ host [0] = '\0';
+ serv [0] = '\0';
+ res = getnameinfo ((const struct sockaddr *)address->ss,
+- sizeof (struct sockaddr_storage),
++ gdm_sockaddr_len (address->ss),
+ host, sizeof (host),
+ serv, sizeof (serv),
+ NI_NUMERICHOST | NI_NUMERICSERV);
diff --git a/x11/gdm/files/patch-common_gdm-address.h b/x11/gdm/files/patch-common_gdm-address.h
new file mode 100644
index 000000000000..a4fd3931075a
--- /dev/null
+++ b/x11/gdm/files/patch-common_gdm-address.h
@@ -0,0 +1,11 @@
+--- common/gdm-address.h.orig 2009-05-09 21:08:07.000000000 -0400
++++ common/gdm-address.h 2009-05-09 21:08:34.000000000 -0400
+@@ -36,6 +36,8 @@ G_BEGIN_DECLS
+
+ #define GDM_TYPE_ADDRESS (gdm_address_get_type ())
+
++#define gdm_sockaddr_len(sa) (((struct sockaddr *)sa)->sa_family == AF_INET6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in))
++
+ typedef struct _GdmAddress GdmAddress;
+
+ GType gdm_address_get_type (void);
diff --git a/x11/gdm/files/patch-daemon-gdm-xdmcp-display-factory.c b/x11/gdm/files/patch-daemon-gdm-xdmcp-display-factory.c
index e3062eeeaa89..fead3654c4b8 100644
--- a/x11/gdm/files/patch-daemon-gdm-xdmcp-display-factory.c
+++ b/x11/gdm/files/patch-daemon-gdm-xdmcp-display-factory.c
@@ -1,5 +1,5 @@
---- daemon/gdm-xdmcp-display-factory.c.orig 2007-11-01 10:15:58.269325570 -0400
-+++ daemon/gdm-xdmcp-display-factory.c 2007-11-01 10:20:19.093220785 -0400
+--- daemon/gdm-xdmcp-display-factory.c.orig 2009-03-16 16:12:08.000000000 -0400
++++ daemon/gdm-xdmcp-display-factory.c 2009-05-11 02:35:37.000000000 -0400
@@ -35,6 +35,7 @@
#include <netdb.h>
#include <arpa/inet.h>
@@ -8,3 +8,140 @@
#ifdef HAVE_SYS_SOCKIO_H
#include <sys/sockio.h>
#endif
+@@ -404,6 +405,11 @@ static int
+ create_socket (struct addrinfo *ai)
+ {
+ int sock;
++#ifdef ENABLE_IPV6
++#ifdef IPV6_V6ONLY
++ int off = 0;
++#endif
++#endif
+
+ sock = socket (ai->ai_family, ai->ai_socktype, ai->ai_protocol);
+ if (sock < 0) {
+@@ -411,6 +417,16 @@ create_socket (struct addrinfo *ai)
+ return sock;
+ }
+
++#ifdef ENABLE_IPV6
++#ifdef IPV6_V6ONLY
++ if (setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&off, sizeof (off)) < 0) {
++ g_warning ("setsockopt: %s", g_strerror (errno));
++ close (sock);
++ return -1;
++ }
++#endif
++#endif
++
+ if (bind (sock, ai->ai_addr, ai->ai_addrlen) < 0) {
+ g_warning ("bind: %s", g_strerror (errno));
+ close (sock);
+@@ -833,7 +849,7 @@ gdm_xdmcp_send_willing (GdmXdmcpDisplayF
+ XdmcpFlush (factory->priv->socket_fd,
+ &factory->priv->buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+
+ g_free (status.data);
+ }
+@@ -877,7 +893,7 @@ gdm_xdmcp_send_unwilling (GdmXdmcpDispla
+ XdmcpFlush (factory->priv->socket_fd,
+ &factory->priv->buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+
+ last_time = time (NULL);
+ }
+@@ -986,7 +1002,7 @@ gdm_xdmcp_send_forward_query (GdmXdmcpDi
+ XdmcpFlush (factory->priv->socket_fd,
+ &factory->priv->buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (ic->chosen_address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (ic->chosen_address)));
+
+ g_free (port.data);
+ g_free (addr.data);
+@@ -1689,7 +1705,7 @@ gdm_xdmcp_really_send_managed_forward (G
+ XdmcpFlush (factory->priv->socket_fd,
+ &factory->priv->buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+
+ g_free (addr.data);
+ }
+@@ -1770,7 +1786,7 @@ gdm_xdmcp_send_got_managed_forward (GdmX
+ XdmcpFlush (factory->priv->socket_fd,
+ &factory->priv->buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+ }
+
+ static gboolean
+@@ -1943,7 +1959,7 @@ gdm_xdmcp_send_decline (GdmXdmcpDisplayF
+ XdmcpFlush (factory->priv->socket_fd,
+ &factory->priv->buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+
+ /* Send MANAGED_FORWARD to indicate that the connection
+ * reached some sort of resolution */
+@@ -2091,7 +2107,7 @@ gdm_xdmcp_send_accept (GdmXdmcpDisplayFa
+ XdmcpFlush (factory->priv->socket_fd,
+ &factory->priv->buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+
+ host = NULL;
+ gdm_address_get_numeric_info (address, &host, NULL);
+@@ -2309,8 +2325,6 @@ gdm_xdmcp_handle_request (GdmXdmcpDispla
+ authorization_data.data = (CARD8 *) cookie->data;
+ authorization_data.length = cookie->len;
+
+- g_array_free (cookie, TRUE);
+-
+ /* the addrs are NOT copied */
+ gdm_xdmcp_send_accept (factory,
+ address,
+@@ -2319,6 +2333,8 @@ gdm_xdmcp_handle_request (GdmXdmcpDispla
+ &authentication_data,
+ &authorization_name,
+ &authorization_data);
++
++ g_array_free (cookie, TRUE);
+ }
+ }
+ } else {
+@@ -2422,7 +2438,7 @@ gdm_xdmcp_send_failed (GdmXdmcpDisplayFa
+ XdmcpFlush (factory->priv->socket_fd,
+ &factory->priv->buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+ }
+
+ static void
+@@ -2446,7 +2462,7 @@ gdm_xdmcp_send_refuse (GdmXdmcpDisplayFa
+ XdmcpFlush (factory->priv->socket_fd,
+ &factory->priv->buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+
+ /*
+ * This was from a forwarded query quite apparently so
+@@ -2717,7 +2733,7 @@ gdm_xdmcp_send_alive (GdmXdmcpDisplayFac
+ XdmcpFlush (factory->priv->socket_fd,
+ &factory->priv->buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+ }
+
+ static void
diff --git a/x11/gdm/files/patch-gui_simple-chooser_gdm-host-chooser-widget.c b/x11/gdm/files/patch-gui_simple-chooser_gdm-host-chooser-widget.c
index 6f0c08d8a00a..340e955b3832 100644
--- a/x11/gdm/files/patch-gui_simple-chooser_gdm-host-chooser-widget.c
+++ b/x11/gdm/files/patch-gui_simple-chooser_gdm-host-chooser-widget.c
@@ -1,5 +1,23 @@
---- gui/simple-chooser/gdm-host-chooser-widget.c.orig 2008-03-04 14:42:37.000000000 -0500
-+++ gui/simple-chooser/gdm-host-chooser-widget.c 2008-08-03 01:48:49.000000000 -0400
+--- gui/simple-chooser/gdm-host-chooser-widget.c.orig 2009-02-19 21:45:09.000000000 -0500
++++ gui/simple-chooser/gdm-host-chooser-widget.c 2009-05-11 02:34:20.000000000 -0400
+@@ -311,7 +311,7 @@ do_ping (GdmHostChooserWidget *widget,
+ res = XdmcpFlush (widget->priv->socket_fd,
+ &widget->priv->broadcast_buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+ if (! res) {
+ g_warning ("Unable to flush the XDMCP broadcast packet: %s", g_strerror (errno));
+ }
+@@ -328,7 +328,7 @@ do_ping (GdmHostChooserWidget *widget,
+ res = XdmcpFlush (widget->priv->socket_fd,
+ &widget->priv->query_buf,
+ (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
+- (int)sizeof (struct sockaddr_storage));
++ (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
+ if (! res) {
+ g_warning ("Unable to flush the XDMCP query packet");
+ }
@@ -442,7 +442,7 @@ find_broadcast_addresses (GdmHostChooser
/* paranoia */
ifreq.ifr_name[sizeof (ifreq.ifr_name) - 1] = '\0';
@@ -13,8 +31,8 @@
#ifdef ENABLE_IPV6
widget->priv->socket_fd = socket (AF_INET6, SOCK_DGRAM, 0);
if (widget->priv->socket_fd != -1) {
-+ int no = 0;
-+ setsockopt(widget->priv->socket_fd, IPPROTO_IPV6, IPV6_V6ONLY, &no, sizeof(no));
++ int off = 0;
++ setsockopt(widget->priv->socket_fd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&off, sizeof (off));
widget->priv->have_ipv6 = TRUE;
}
#endif
diff --git a/x11/gdm/files/patch-gui_simple-greeter_gdm-user.c b/x11/gdm/files/patch-gui_simple-greeter_gdm-user.c
new file mode 100644
index 000000000000..67ceb5a28d8f
--- /dev/null
+++ b/x11/gdm/files/patch-gui_simple-greeter_gdm-user.c
@@ -0,0 +1,34 @@
+--- gui/simple-greeter/gdm-user.c.orig 2009-05-16 17:52:57.000000000 -0400
++++ gsimple-greeter/dm-user.c 2009-05-16 18:08:08.000000000 -0400
+@@ -412,6 +412,7 @@ _gdm_user_update (GdmUser *u
+ /* Display Name */
+ if (pwent->pw_gecos && pwent->pw_gecos[0] != '\0') {
+ gchar *first_comma;
++ gchar *ampersand;
+
+ first_comma = strchr (pwent->pw_gecos, ',');
+ if (first_comma) {
+@@ -425,6 +426,23 @@ _gdm_user_update (GdmUser *u
+ g_free (real_name);
+ real_name = NULL;
+ }
++
++ while (real_name != NULL && (ampersand = strchr (real_name, '&')) != NULL) {
++ gchar *temp_real_name1;
++ gchar *temp_real_name2;
++ gchar *temp_name;
++
++ temp_real_name1 = g_strndup (real_name,
++ (ampersand - real_name));
++ temp_real_name2 = g_strdup (ampersand + 1);
++ temp_name = g_strdup (pwent->pw_name);
++ temp_name[0] = toupper (temp_name[0]);
++ g_free (real_name);
++ real_name = g_strdup_printf ("%s%s%s", temp_real_name1, temp_name, temp_real_name2);
++ g_free (temp_real_name1);
++ g_free (temp_real_name2);
++ g_free (temp_name);
++ }
+ } else {
+ real_name = NULL;
+ }