Subject: pkg/24373: Fixes for net/gtk-gnutella
To: None <gnats-bugs@gnats.netbsd.org>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-bugs
Date: 02/09/2004 09:04:30
>Number:         24373
>Category:       pkg
>Synopsis:       Fixes for net/gtk-gnutella
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 09 09:05:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Christian Biere
>Release:        NetBSD 1.6ZH
>Organization:
>Environment:
System: NetBSD cyclonus 1.6ZH NetBSD 1.6ZH (STARSCREAM) #0: Fri Feb 6 00:16:58 CET 2004 root@cyclonus:/usr/src/sys/arch/i386/compile/STARSCREAM i386
>Description:

patch-aa fixes a format string vulnerability in GTK-Gnutella 0.93.3. I've
also edited the Makefile to support building for GTK+ 1.2.x or GTK+ 2.x.
There aren't any changes in the PLIST so it's pretty simple. There was
a little typo cflags vs. ccflags and I've added some arguments which
prevent adding -L/usr/local/lib (*sigh*). "official" should be set to
true because otherwise gtk-gnutella will try to access files from
the $srcdir. This used for developping and debugging. AFAIK, COPTS are
not meant to be used for pkgsrc. At least, it's mentioned in Packages.txt.
Therefore, "optimize" is undefined so that it doesn't interfere with
"ccflags".

>How-To-Repeat:
>Fix:

Makefile:
# $NetBSD: Makefile,v 1.30 2004/01/26 12:10:13 adam Exp $
#

DISTNAME=	gtk-gnutella-0.93.3
CATEGORIES=	net
MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=gtk-gnutella/}
EXTRACT_SUFX=	.tar.bz2

MAINTAINER=	adam@NetBSD.org
HOMEPAGE=	http://gtk-gnutella.sourceforge.net/
COMMENT=	GTK-based gnutella client

USE_BUILDLINK2=		yes
USE_GMAKE=		yes
USE_PKGLOCALEDIR=	yes
USE_X11=		yes
HAS_CONFIGURE=		yes
CONFIGURE_SCRIPT=	./Configure
CONFIGURE_ARGS+=	-Oders \
			-D cc="${CC}" \
			-D ccflags="${CFLAGS:Unone}" \
			-D ldflags="${LDFLAGS:Unone}" \
			-U loclibpth \
			-U optimize \
			-D official=true \
 			-D prefix="${PREFIX}" \
			-D privlib="${PREFIX}/share/gtk-gnutella" \
			-D sysman="${PREFIX}/man" \
			-D locale="${PREFIX}/${PKGLOCALEDIR}/locale" 

# Set to NO for building GTK-Gnutella with GTK+ 1.2
GTKG_WITH_GTK2=		no

.include "../../textproc/libxml2/buildlink2.mk"

.if !empty(GTKG_WITH_GTK2:M[Yy][Ee][Ss])
CONFIGURE_ARGS+=	-D gtkversion=2
.include "../../x11/gtk2/buildlink2.mk"
.else
CONFIGURE_ARGS+=	-D gtkversion=1
.include "../../x11/gtk/buildlink2.mk"
.endif

.include "../../mk/bsd.pkg.mk"

distinfo:
$NetBSD: distinfo,v 1.13 2004/01/26 12:10:13 adam Exp $

SHA1 (gtk-gnutella-0.93.3.tar.bz2) = 35972d17f2b7d826670d37cecd05db77590494fa
Size (gtk-gnutella-0.93.3.tar.bz2) = 1279197 bytes
SHA1 (patch-aa) = 1d9a3336ed7ab32489ea89dd1b7d6e3542632fb2

patch-aa:
--- src/sockets.c	2004-01-25 21:22:07.000000000 +0100
+++ src/sockets.c	2004-02-01 08:21:37.000000000 +0100
@@ -86,6 +86,8 @@
 static void guess_local_ip(int sd);
 static void socket_destroy(struct gnutella_socket *s, gchar *reason);
 
+#define show_error g_warning
+
 /* 
  * SOL_TCP and SOL_IP aren't standards. Some platforms define them, on
  * some it's safe to assume they're the same as IPPROTO_*, but the
@@ -1457,15 +1459,6 @@
 			s->file_desc, g_strerror(errno));
 }
 
-static void show_error(char *fmt, ...)
-{
-	va_list args;
-
-	va_start(args, fmt);
-	vfprintf(stderr, fmt, args);
-	va_end(args);
-}
-
 /*
  * The socks 4/5 code was taken from tsocks 1.16 Copyright (C) 2000 Shaun Clowes
  * It was modified to work with gtk_gnutella and non-blocking sockets. --DW
@@ -1662,7 +1655,7 @@
 			return -1;
 		}
 		if ((status/100) != 2) {
-			show_error(str);
+			show_error("%s", str);
 			return -1;
 		}
 		s->pos++;
>Release-Note:
>Audit-Trail:
>Unformatted: