From d5ba29d0cba62d9b374a08184636d3ea6b6ab6bc Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Sun, 14 Oct 2007 03:56:56 +0000 Subject: [PATCH] update patches --- ...fix-crash-on-background-load-failure.patch | 10 -- gdm-2.99.0-fix-invalid-read.patch | 144 +++++++++--------- 2 files changed, 74 insertions(+), 80 deletions(-) diff --git a/gdm-2.99.0-fix-crash-on-background-load-failure.patch b/gdm-2.99.0-fix-crash-on-background-load-failure.patch index 6281511..2e2bd22 100644 --- a/gdm-2.99.0-fix-crash-on-background-load-failure.patch +++ b/gdm-2.99.0-fix-crash-on-background-load-failure.patch @@ -1,13 +1,3 @@ - Prevent greeter from crashing if background can't be loaded - In Fedora 8 we default to animated backgrounds, and - the simple greeter doesn't understand that format. This exposed - a crasher bug in the simple greter where it assumed background - loading would always succeed. - - As a side note, the greeter should probably use libbackground - (or is it libgnome-desktop?) to draw the background, so it can - do animated backgrounds, too. - --- gdm-2.99.0/gui/simple-greeter/gdm-greeter-background.c.fix-crash-on-background-load-failure +++ gdm-2.99.0/gui/simple-greeter/gdm-greeter-background.c @@ -481,6 +481,10 @@ update_background (GdmGreeterBackground *background) diff --git a/gdm-2.99.0-fix-invalid-read.patch b/gdm-2.99.0-fix-invalid-read.patch index 753fb5d..4fa258f 100644 --- a/gdm-2.99.0-fix-invalid-read.patch +++ b/gdm-2.99.0-fix-invalid-read.patch @@ -1,114 +1,118 @@ - Pass size of socket address to gdm_address_new_from_sockaddr_storage - While sockaddr_storage is big enough to hold most socket address types, - we can't assume all socket address types will be as big as sockaddr_storage. - This means when copying a sockaddr, we need to know its size. - ---- gdm-2.99.0/common/gdm-address.c.fix-invalid-read -+++ gdm-2.99.0/common/gdm-address.c -@@ -92,14 +92,18 @@ gdm_address_get_family_type (GdmAddress *address) +diff -up gdm-2.99.0/common/gdm-address.h.fix-invalid-read gdm-2.99.0/common/gdm-address.h +--- gdm-2.99.0/common/gdm-address.h.fix-invalid-read 2007-10-13 19:38:03.000000000 -0400 ++++ gdm-2.99.0/common/gdm-address.h 2007-10-13 23:50:30.000000000 -0400 +@@ -40,7 +40,8 @@ typedef struct _GdmAddress GdmAddress; + + GType gdm_address_get_type (void); + +-GdmAddress * gdm_address_new_from_sockaddr_storage (struct sockaddr_storage *ss); ++GdmAddress * gdm_address_new_from_sockaddr (struct sockaddr *sa, ++ size_t size); + + int gdm_address_get_family_type (GdmAddress *address); + struct sockaddr_storage *gdm_address_get_sockaddr_storage (GdmAddress *address); +diff -up gdm-2.99.0/common/gdm-address.c.fix-invalid-read gdm-2.99.0/common/gdm-address.c +--- gdm-2.99.0/common/gdm-address.c.fix-invalid-read 2007-10-13 19:38:03.000000000 -0400 ++++ gdm-2.99.0/common/gdm-address.c 2007-10-13 23:55:37.000000000 -0400 +@@ -84,22 +84,27 @@ gdm_address_get_family_type (GdmAddress + + /** + * gdm_address_new_from_sockaddr: +- * @sa: A pointer to a sockaddr_storage. ++ * @sa: A pointer to a sockaddr. ++ * @size: size of sockaddr in bytes. + * +- * Creates a new #GdmAddress from @ss. ++ * Creates a new #GdmAddress from @sa. + * + * Return value: The new #GdmAddress * or %NULL if @sa was invalid or the address family isn't supported. **/ GdmAddress * -gdm_address_new_from_sockaddr_storage (struct sockaddr_storage *ss) -+gdm_address_new_from_sockaddr_storage (struct sockaddr_storage *ss, -+ size_t size) ++gdm_address_new_from_sockaddr (struct sockaddr *sa, ++ size_t size) { GdmAddress *addr; - g_return_val_if_fail (ss != NULL, NULL); +- g_return_val_if_fail (ss != NULL, NULL); ++ g_return_val_if_fail (sa != NULL, NULL); + g_return_val_if_fail (size >= sizeof (struct sockaddr), NULL); + g_return_val_if_fail (size <= sizeof (struct sockaddr_storage), NULL); addr = g_new0 (GdmAddress, 1); - addr->ss = g_memdup (ss, sizeof (struct sockaddr_storage)); + addr->ss = g_new0 (struct sockaddr_storage, 1); -+ memcpy (addr->ss, ss, size); ++ memcpy (addr->ss, sa, size); return addr; } -@@ -315,7 +319,8 @@ gdm_address_peek_local_list (void) +@@ -315,7 +320,7 @@ gdm_address_peek_local_list (void) for (res = result; res != NULL; res = res->ai_next) { GdmAddress *address; - address = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)res->ai_addr); -+ address = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)res->ai_addr, -+ res->ai_addrlen); ++ address = gdm_address_new_from_sockaddr (res->ai_addr, res->ai_addrlen); the_list = g_list_append (the_list, address); } ---- gdm-2.99.0/common/gdm-address.h.fix-invalid-read -+++ gdm-2.99.0/common/gdm-address.h -@@ -40,7 +40,8 @@ typedef struct _GdmAddress GdmAddress; - - GType gdm_address_get_type (void); - --GdmAddress * gdm_address_new_from_sockaddr_storage (struct sockaddr_storage *ss); -+GdmAddress * gdm_address_new_from_sockaddr_storage (struct sockaddr_storage *ss, -+ size_t size); - - int gdm_address_get_family_type (GdmAddress *address); - struct sockaddr_storage *gdm_address_get_sockaddr_storage (GdmAddress *address); ---- gdm-2.99.0/daemon/gdm-xdmcp-display-factory.c.fix-invalid-read -+++ gdm-2.99.0/daemon/gdm-xdmcp-display-factory.c -@@ -446,7 +446,8 @@ do_bind (guint port, - char *serv; - GdmAddress *addr; - -- addr = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)ai->ai_addr); -+ addr = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)ai->ai_addr, -+ ai->ai_addrlen); - - host = NULL; - serv = NULL; -@@ -1356,7 +1357,8 @@ create_address_from_request (ARRAY8 *req_addr, - if (ai != NULL) { - found = TRUE; - if (address != NULL) { -- *address = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)ai->ai_addr); -+ *address = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)ai->ai_addr, -+ ai->ai_addrlen); - } - } - -@@ -2629,7 +2631,8 @@ decode_packet (GIOChannel *source, +diff -up gdm-2.99.0/gui/simple-chooser/gdm-host-chooser-widget.c.fix-invalid-read gdm-2.99.0/gui/simple-chooser/gdm-host-chooser-widget.c +--- gdm-2.99.0/gui/simple-chooser/gdm-host-chooser-widget.c.fix-invalid-read 2007-10-13 19:38:03.000000000 -0400 ++++ gdm-2.99.0/gui/simple-chooser/gdm-host-chooser-widget.c 2007-10-13 23:53:35.000000000 -0400 +@@ -237,7 +237,7 @@ decode_packet (GIOChannel *sou return TRUE; } - address = gdm_address_new_from_sockaddr_storage (&clnt_ss); -+ address = gdm_address_new_from_sockaddr_storage (&clnt_ss, -+ ss_len); ++ address = gdm_address_new_from_sockaddr ((struct sockaddr *) &clnt_ss, ss_len); if (address == NULL) { g_warning (_("XMDCP: Unable to parse address")); return TRUE; ---- gdm-2.99.0/gui/simple-chooser/gdm-host-chooser-widget.c.fix-invalid-read -+++ gdm-2.99.0/gui/simple-chooser/gdm-host-chooser-widget.c -@@ -237,7 +237,8 @@ decode_packet (GIOChannel *source, - return TRUE; - } - -- address = gdm_address_new_from_sockaddr_storage (&clnt_ss); -+ address = gdm_address_new_from_sockaddr_storage (&clnt_ss, -+ ss_len); - if (address == NULL) { - g_warning (_("XMDCP: Unable to parse address")); - return TRUE; -@@ -462,7 +463,8 @@ find_broadcast_addresses (GdmHostChooserWidget *widget) +@@ -462,7 +462,7 @@ find_broadcast_addresses (GdmHostChooser g_memmove (&sin, &ifreq.ifr_broadaddr, sizeof (struct sockaddr_in)); sin.sin_port = htons (XDM_UDP_PORT); - address = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)&sin); -+ address = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)&sin, -+ sizeof (struct sockaddr_in)); ++ address = gdm_address_new_from_sockaddr ((struct sockaddr *) &sin, sizeof (sin)); if (address != NULL) { g_debug ("Adding if %s", name); gdm_address_debug (address); -@@ -518,7 +520,8 @@ add_hosts (GdmHostChooserWidget *widget) +@@ -518,7 +518,7 @@ add_hosts (GdmHostChooserWidget *widget) for (ai = result; ai != NULL; ai = ai->ai_next) { GdmAddress *address; - address = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)ai->ai_addr); -+ address = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)ai->ai_addr, -+ ai->ai_addrlen); ++ address = gdm_address_new_from_sockaddr (ai->ai_addr, ai->ai_addrlen); if (address != NULL) { widget->priv->query_addresses = g_slist_append (widget->priv->query_addresses, address); } +diff -up gdm-2.99.0/daemon/gdm-xdmcp-display-factory.c.fix-invalid-read gdm-2.99.0/daemon/gdm-xdmcp-display-factory.c +--- gdm-2.99.0/daemon/gdm-xdmcp-display-factory.c.fix-invalid-read 2007-10-13 19:38:03.000000000 -0400 ++++ gdm-2.99.0/daemon/gdm-xdmcp-display-factory.c 2007-10-13 23:54:47.000000000 -0400 +@@ -446,7 +446,7 @@ do_bind (guint port, + char *serv; + GdmAddress *addr; + +- addr = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)ai->ai_addr); ++ addr = gdm_address_new_from_sockaddr (ai->ai_addr, ai->ai_addrlen); + + host = NULL; + serv = NULL; +@@ -1356,7 +1356,7 @@ create_address_from_request (ARRAY8 + if (ai != NULL) { + found = TRUE; + if (address != NULL) { +- *address = gdm_address_new_from_sockaddr_storage ((struct sockaddr_storage *)ai->ai_addr); ++ *address = gdm_address_new_from_sockaddr (ai->ai_addr, ai->ai_addrlen); + } + } + +@@ -2629,7 +2629,7 @@ decode_packet (GIOChannel *s + return TRUE; + } + +- address = gdm_address_new_from_sockaddr_storage (&clnt_ss); ++ address = gdm_address_new_from_sockaddr ((struct sockaddr *) &clnt_ss, ss_len); + if (address == NULL) { + g_warning (_("XMDCP: Unable to parse address")); + return TRUE;