patches/compizconfig-backend-gconf-01-solaris-port.diff
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 18110 93461edb1490
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446

diff -x '*.*~' -x '*.rej' -x '*.orig' -Nrup compizconfig-backend-gconf-0.7.6/configure.ac compizconfig-backend-gconf-0.7.6.modif/configure.ac
--- compizconfig-backend-gconf-0.7.6/configure.ac	2008-05-29 14:59:03.000000000 +0200
+++ compizconfig-backend-gconf-0.7.6.modif/configure.ac	2008-06-16 15:21:56.365882156 +0200
@@ -1,12 +1,12 @@
 AC_PREREQ(2.57)
 
-AC_INIT([compizconfig-backend-gconf],esyscmd(. ./VERSION;echo -n $VERSION), [[email protected]])
+AC_INIT([compizconfig-backend-gconf],esyscmd(. ./VERSION;echo $VERSION | tr -d "\n"), [[email protected]])
 
 #AC_CONFIG_AUX_DIR(config)
 
 AM_INIT_AUTOMAKE([1.9 dist-bzip2])
 
-#AC_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADER([config.h])
 AM_MAINTAINER_MODE
 
 AC_ISC_POSIX
@@ -15,6 +15,7 @@ AC_PROG_CPP
 AC_PROG_LIBTOOL
 AC_HEADER_STDC
 AC_CHECK_HEADERS([stdlib.h sys/time.h unistd.h])
+AC_CHECK_FUNCS(va_copy __va_copy vasprintf asprintf strsep)
 
 if test "x$GCC" = "xyes"; then
   case " $CFLAGS " in
diff -x '*.*~' -x '*.rej' -x '*.orig' -Nrup compizconfig-backend-gconf-0.7.6/settings-backend/Makefile.am compizconfig-backend-gconf-0.7.6.modif/settings-backend/Makefile.am
--- compizconfig-backend-gconf-0.7.6/settings-backend/Makefile.am	2008-05-29 14:59:03.000000000 +0200
+++ compizconfig-backend-gconf-0.7.6.modif/settings-backend/Makefile.am	2008-06-16 15:21:56.367784131 +0200
@@ -6,7 +6,7 @@ INCLUDES = @GLIB_CFLAGS@ \
 
 libgconf_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries)
 libgconf_la_LIBADD = @CCS_LIBS@ @GCONF_LIBS@ @GLIB_LIBS@
-libgconf_la_SOURCES = gconf.c
+libgconf_la_SOURCES = gconf.c compat.c
 backenddir = $(libdir)/compizconfig/backends
 
 METASOURCES = AUTO
diff -x '*.*~' -x '*.rej' -x '*.orig' -Nrup compizconfig-backend-gconf-0.7.6/settings-backend/compat.c compizconfig-backend-gconf-0.7.6.modif/settings-backend/compat.c
--- compizconfig-backend-gconf-0.7.6/settings-backend/compat.c	1970-01-01 01:00:00.000000000 +0100
+++ compizconfig-backend-gconf-0.7.6.modif/settings-backend/compat.c	2008-06-16 15:21:56.366247598 +0200
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2007 Albert Lee <[email protected]>.
+ * 
+ * Copyright (c) 2004 Darren Tucker.
+ *
+ * Based originally on asprintf.c from OpenBSD:
+ * Copyright (c) 1997 Todd C. Miller <[email protected]>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "config.h"
+#include "compat.h"
+
+#ifndef HAVE_VASPRINTF
+#include <errno.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <limits.h>
+
+#ifndef VA_COPY
+# ifdef HAVE_VA_COPY
+#  define VA_COPY(dest, src) va_copy(dest, src)
+# else
+#  ifdef HAVE___VA_COPY
+#   define VA_COPY(dest, src) __va_copy(dest, src)
+#  else
+#   define VA_COPY(dest, src) (dest) = (src)
+#  endif
+# endif
+#endif
+
+#define INIT_SZ	128
+
+static int vasprintf(char **str, const char *fmt, va_list ap);
+
+static int vasprintf(char **str, const char *fmt, va_list ap)
+{
+	int ret = -1;
+	va_list ap2;
+	char *string, *newstr;
+	size_t len;
+
+	VA_COPY(ap2, ap);
+	if ((string = malloc(INIT_SZ)) == NULL)
+		goto fail;
+
+	ret = vsnprintf(string, INIT_SZ, fmt, ap2);
+	if (ret >= 0 && ret < INIT_SZ) { /* succeeded with initial alloc */
+		*str = string;
+	} else if (ret == INT_MAX) { /* shouldn't happen */
+		goto fail;
+	} else {	/* bigger than initial, realloc allowing for nul */
+		len = (size_t)ret + 1;
+		if ((newstr = realloc(string, len)) == NULL) {
+			free(string);
+			goto fail;
+		} else {
+			va_end(ap2);
+			VA_COPY(ap2, ap);
+			ret = vsnprintf(newstr, len, fmt, ap2);
+			if (ret >= 0 && (size_t)ret < len) {
+				*str = newstr;
+			} else { /* failed with realloc'ed string, give up */
+				free(newstr);
+				goto fail;
+			}
+		}
+	}
+	va_end(ap2);
+	return (ret);
+
+fail:
+	*str = NULL;
+	errno = ENOMEM;
+	va_end(ap2);
+	return (-1);
+}
+#endif
+
+#ifndef HAVE_ASPRINTF
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+int asprintf(char **str, const char *fmt, ...)
+{
+	va_list ap;
+	int ret;
+	
+	*str = NULL;
+	va_start(ap, fmt);
+	ret = vasprintf(str, fmt, ap);
+	va_end(ap);
+
+	return ret;
+}
+#endif
+
+#ifndef HAVE_STRSEP
+#include <string.h>
+    	
+char *strsep(char **stringp, const char *delim)
+{
+	char *s = *stringp;
+	char *e;
+
+	if (!s)
+		return NULL;
+
+	e = strpbrk(s, delim);
+	if (e)
+		*e++ = '\0';
+
+	*stringp = e;
+	return s;
+}
+#endif
+
diff -x '*.*~' -x '*.rej' -x '*.orig' -Nrup compizconfig-backend-gconf-0.7.6/settings-backend/compat.h compizconfig-backend-gconf-0.7.6.modif/settings-backend/compat.h
--- compizconfig-backend-gconf-0.7.6/settings-backend/compat.h	1970-01-01 01:00:00.000000000 +0100
+++ compizconfig-backend-gconf-0.7.6.modif/settings-backend/compat.h	2008-06-16 15:21:56.366500278 +0200
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2007 Albert Lee <[email protected]>.
+ * 
+ * Copyright (c) 2004 Darren Tucker.
+ *
+ * Based originally on asprintf.c from OpenBSD:
+ * Copyright (c) 1997 Todd C. Miller <[email protected]>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "config.h"
+
+#ifndef HAVE_ASPRINTF
+int asprintf(char **str, const char *fmt, ...);
+#endif
+
+#ifndef HAVE_STRSEP
+char *strsep(char **stringp, const char *delim);
+#endif
diff -x '*.*~' -x '*.rej' -x '*.orig' -Nrup compizconfig-backend-gconf-0.7.6/settings-backend/gconf.c compizconfig-backend-gconf-0.7.6.modif/settings-backend/gconf.c
--- compizconfig-backend-gconf-0.7.6/settings-backend/gconf.c	2008-05-29 14:59:03.000000000 +0200
+++ compizconfig-backend-gconf-0.7.6.modif/settings-backend/gconf.c	2008-06-16 15:21:56.367512110 +0200
@@ -24,6 +24,9 @@
  *
  **/
 
+#include "config.h"
+#include "compat.h"
+
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>