All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [pull request] Pull request for branch snmp-fix
@ 2009-08-04 14:15 Thomas Petazzoni
  2009-08-04 14:15 ` [Buildroot] [PATCH 1/3] netsnmp: convert to autotools.in and fix build issues Thomas Petazzoni
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2009-08-04 14:15 UTC (permalink / raw)
  To: buildroot

The following changes since commit 5b72dda69f72e1953dfc7987dd1b418e1afe79a4:
  Peter Korsgaard (1):
        buildroot: fix fallout after qtopia4 -> qt rename

are available in the git repository at:

  git://git.busybox.net/~tpetazzoni/git/buildroot snmp-fix

Thomas Petazzoni (3):
      netsnmp: convert to autotools.in and fix build issues
      netsnmp: update TODO
      netsnmp: add patch to fix CVE-2008-6123

 TODO                                               |   10 +
 .../netsnmp/netsnmp-5.4.2.1-CVE-2008-6123.patch    |   29 +++
 .../netsnmp-5.4.2.1-build-system-fixup.patch       |   29 +++
 package/netsnmp/netsnmp.mk                         |  179 ++++++--------------
 4 files changed, 119 insertions(+), 128 deletions(-)
 create mode 100644 package/netsnmp/netsnmp-5.4.2.1-CVE-2008-6123.patch
 create mode 100644 package/netsnmp/netsnmp-5.4.2.1-build-system-fixup.patch

Thanks,
-- 
Thomas Petazzoni

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/3] netsnmp: convert to autotools.in and fix build issues
  2009-08-04 14:15 [Buildroot] [pull request] Pull request for branch snmp-fix Thomas Petazzoni
@ 2009-08-04 14:15 ` Thomas Petazzoni
  2009-08-04 15:14   ` Peter Korsgaard
  2009-08-04 14:15 ` [Buildroot] [PATCH 2/3] netsnmp: update TODO Thomas Petazzoni
  2009-08-04 14:15 ` [Buildroot] [PATCH 3/3] netsnmp: add patch to fix CVE-2008-6123 Thomas Petazzoni
  2 siblings, 1 reply; 5+ messages in thread
From: Thomas Petazzoni @ 2009-08-04 14:15 UTC (permalink / raw)
  To: buildroot

In order to fix build issues on net-snmp with openssl configured
reported on the mailing-list, this patch converts net-snmp to the
Makefile.autotools.in infrastructure. This allows to fix build issues.

This patch removes support for the Perl stuff in net-snmp because it
doesn't build. This is most likely not a problem, since Perl support
was dependent on BR2_HAVE_PERL, a configuration symbol that doesn't
exist in Buildroot since several years.

Moreover, we introduce a patch to the build system so that it doesn't
call ldconfig on /usr/lib at install time, which is completely useless
when doing cross-compilation.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../netsnmp-5.4.2.1-build-system-fixup.patch       |   29 +++
 package/netsnmp/netsnmp.mk                         |  179 ++++++--------------
 2 files changed, 80 insertions(+), 128 deletions(-)
 create mode 100644 package/netsnmp/netsnmp-5.4.2.1-build-system-fixup.patch

diff --git a/package/netsnmp/netsnmp-5.4.2.1-build-system-fixup.patch b/package/netsnmp/netsnmp-5.4.2.1-build-system-fixup.patch
new file mode 100644
index 0000000..f9c50ab
--- /dev/null
+++ b/package/netsnmp/netsnmp-5.4.2.1-build-system-fixup.patch
@@ -0,0 +1,29 @@
+Index: net-snmp-5.4.2.1/Makefile.rules
+===================================================================
+--- net-snmp-5.4.2.1.orig/Makefile.rules
++++ net-snmp-5.4.2.1/Makefile.rules
+@@ -172,7 +172,6 @@
+ 			echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
+ 			$(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
+ 		done ; \
+-		$(LIB_LDCONFIG_CMD) ; \
+ 	fi
+ 
+ installpostlibs: $(INSTALLPOSTLIBS)
+@@ -184,7 +183,6 @@
+ 			echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
+ 			$(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
+ 		done ; \
+-		$(LIB_LDCONFIG_CMD) ; \
+ 	fi
+ 
+ installucdlibs: $(INSTALLUCDLIBS)
+@@ -196,7 +194,6 @@
+ 			echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
+ 			$(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
+ 		done ; \
+-		$(LIB_LDCONFIG_CMD) ; \
+ 	fi
+ 
+ installsubdirlibs:
+
diff --git a/package/netsnmp/netsnmp.mk b/package/netsnmp/netsnmp.mk
index 2af8e0c..fe60979 100644
--- a/package/netsnmp/netsnmp.mk
+++ b/package/netsnmp/netsnmp.mk
@@ -2,28 +2,15 @@
 #
 # netsnmp
 #
-#############################################################
-NETSNMP_VERSION:=5.4.2.1
-NETSNMP_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/net-snmp/
-NETSNMP_DIR:=$(BUILD_DIR)/net-snmp-$(NETSNMP_VERSION)
-NETSNMP_SOURCE:=net-snmp-$(NETSNMP_VERSION).tar.gz
-
-NETSNMP_WO_TRANSPORT:=
-ifneq ($(BR2_INET_IPX),y)
-NETSNMP_WO_TRANSPORT+= IPX
-endif
-ifneq ($(BR2_INET_IPV6),y)
-NETSNMP_WO_TRANSPORT+= UDPIPv6 TCPIPv6
-endif
-
-$(DL_DIR)/$(NETSNMP_SOURCE):
-	$(call DOWNLOAD,$(NETSNMP_SITE),$(NETSNMP_SOURCE))
-
-$(NETSNMP_DIR)/.unpacked: $(DL_DIR)/$(NETSNMP_SOURCE)
-	$(ZCAT) $(DL_DIR)/$(NETSNMP_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
-	toolchain/patch-kernel.sh $(NETSNMP_DIR) package/netsnmp/ \*$(NETSNMP_VERSION)\*.patch
-	$(CONFIG_UPDATE) $(@D)
-	touch $@
+############################################################
+NETSNMP_VERSION = 5.4.2.1
+NETSNMP_SOURCE = net-snmp-$(NETSNMP_VERSION).tar.gz
+NETSNMP_SITE = http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/net-snmp/
+NETSNMP_AUTORECONF = NO
+NETSNMP_INSTALL_STAGING = YES
+NETSNMP_INSTALL_TARGET = YES
+# netsnmp doesn't understand install-strip
+NETSNMP_INSTALL_TARGET_OPT = DESTDIR=$(TARGET_DIR) install
 
 ifeq ($(BR2_ENDIAN),"BIG")
 NETSNMP_ENDIAN=big
@@ -31,21 +18,6 @@ else
 NETSNMP_ENDIAN=little
 endif
 
-ifeq ($(BR2_HAVE_PERL),y)
-NETSNMP_CONFIGURE_PERL_ENV:=\
-		PERLCC="$(TARGET_CC)"
-NETSNMP_CONFIGURE_PERL:=\
-		--disable-embedded-perl \
-		--disable-perl-cc-checks \
-		--enable-as-needed
-else
-NETSNMP_CONFIGURE_PERL_ENV:=
-NETSNMP_CONFIGURE_PERL:=\
-		--disable-embedded-perl \
-		--disable-perl-cc-checks \
-		--without-perl-modules
-endif
-
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
 NETSNMP_CONFIGURE_OPENSSL:=--with-openssl=$(STAGING_DIR)/usr/include/openssl
 else
@@ -56,104 +28,55 @@ ifneq ($(findstring y,$(BR2_HAVE_MANPAGES)$(BR2_HAVE_INFOPAGES)),y)
 NETSNMP_DOCS:=--disable-manuals
 endif
 
-$(NETSNMP_DIR)/.configured: $(NETSNMP_DIR)/.unpacked
-	(cd $(NETSNMP_DIR); rm -f config.cache; \
-		autoconf && \
-		ac_cv_NETSNMP_CAN_USE_SYSCTL=yes \
-		$(NETSNMP_CONFIGURE_PERL_ENV) \
-		$(TARGET_CONFIGURE_OPTS) \
-		$(TARGET_CONFIGURE_ARGS) \
-		./configure \
-		--target=$(GNU_TARGET_NAME) \
-		--host=$(GNU_TARGET_NAME) \
-		--build=$(GNU_HOST_NAME) \
-		--with-cc=$(TARGET_CROSS)gcc \
-		--with-linkcc=$(TARGET_CROSS)gcc \
-		--with-ar=$(TARGET_CROSS)ar \
-		--with-cflags="$(TARGET_CFLAGS)" \
-		--with-ldflags="$(TARGET_LDFLAGS)" \
-		--with-endianness=$(NETSNMP_ENDIAN) \
-		--with-persistent-directory=/var/lib/snmp \
-		--enable-ucd-snmp-compatibility \
-		--enable-shared \
-		--disable-static \
-		--with-logfile=none \
-		--without-rpm \
-		$(NETSNMP_CONFIGURE_OPENSSL) \
-		$(NETSNMP_DOCS) \
-		$(NETSNMP_CONFIGURE_PERL) \
-		--without-dmalloc \
-		--without-efence \
-		--without-rsaref \
-		--with-sys-contact="root" \
-		--with-sys-location="Unknown" \
-		--with-mib-modules="host smux ucd-snmp/dlmod" \
-		--with-out-transports="$(NETSNMP_WO_TRANSPORT)" \
-		--with-defaults \
-		--disable-debugging \
-		--prefix=/usr \
-		--sysconfdir=/etc \
-		--enable-mini-agent \
-		--without-kmem-usage \
-		$(DISABLE_IPV6) \
-	)
-	touch $@
-
-$(NETSNMP_DIR)/agent/snmpd: $(NETSNMP_DIR)/.configured
-	$(MAKE1) -C $(NETSNMP_DIR)
-	touch -c $@
-
-$(TARGET_DIR)/usr/sbin/snmpd: $(NETSNMP_DIR)/agent/snmpd
-	$(MAKE) PREFIX=$(TARGET_DIR)/usr \
-	    prefix=$(TARGET_DIR)/usr \
-	    exec_prefix=$(TARGET_DIR)/usr \
-	    persistentdir=$(TARGET_DIR)/var/lib/snmp \
-	    includedir=$(STAGING_DIR)/usr/include/net-snmp \
-	    ucdincludedir=$(STAGING_DIR)/usr/include/ucd-snmp \
-	    -C $(NETSNMP_DIR) install
-	rm -rf $(TARGET_DIR)/usr/share/doc
-ifneq ($(BR2_HAVE_MANPAGES),y)
-	rm -rf $(TARGET_DIR)/usr/share/man
-endif
-ifneq ($(BR2_HAVE_INFOPAGES),y)
-	rm -rf $(TARGET_DIR)/usr/share/info
-endif
+NETSNMP_CONF_ENV = \
+	ac_cv_NETSNMP_CAN_USE_SYSCTL=yes
+
+NETSNMP_CONF_OPT = \
+	--with-endianness=$(NETSNMP_ENDIAN) \
+	--with-persistent-directory=/var/lib/snmp \
+	--enable-ucd-snmp-compatibility \
+	--enable-shared \
+	--disable-static \
+	--with-logfile=none \
+	--without-rpm \
+	$(NETSNMP_CONFIGURE_OPENSSL) \
+	$(NETSNMP_DOCS) \
+	--without-dmalloc \
+	--without-efence \
+	--without-rsaref \
+	--with-sys-contact="root" \
+	--with-sys-location="Unknown" \
+	--with-mib-modules="host smux ucd-snmp/dlmod" \
+	--with-out-transports="$(NETSNMP_WO_TRANSPORT)" \
+	--with-defaults \
+	--disable-debugging \
+	--enable-mini-agent \
+	--without-kmem-usage \
+	--disable-embedded-perl \
+	--disable-perl-cc-checks \
+	--without-perl-modules \
+	$(DISABLE_IPV6)
+
+NETSNMP_DEPENDENCIES = uclibc \
+	$(if $(BR2_PACKAGE_OPENSSL),openssl)
+
+$(eval $(call AUTOTARGETS,package,netsnmp))
+
+$(NETSNMP_HOOK_POST_INSTALL):
 	# Copy the .conf files.
 	$(INSTALL) -D -m 0644 $(NETSNMP_DIR)/EXAMPLE.conf $(TARGET_DIR)/etc/snmp/snmpd.conf
 	-mv $(TARGET_DIR)/usr/share/snmp/mib2c*.conf $(TARGET_DIR)/etc/snmp
-	# Remove the unsupported snmpcheck program
-	rm -f $(TARGET_DIR)/usr/bin/snmpcheck
+	# Remove the Perl programs
+	for i in snmpconf mib2c fixproc snmpcheck tkmib ipf-mod.pl traptoemail ; do \
+		rm -f $(TARGET_DIR)/usr/bin/$$i ; \
+	done
+	# Remove the useless -config script
+	rm -f $(TARGET_DIR)/usr/bin/net-snmp-config
 	# Install the "broken" headers
 	$(INSTALL) -D -m 0644 $(NETSNMP_DIR)/agent/mibgroup/struct.h $(STAGING_DIR)/usr/include/net-snmp/agent/struct.h
 	$(INSTALL) -D -m 0644 $(NETSNMP_DIR)/agent/mibgroup/util_funcs.h $(STAGING_DIR)/usr/include/net-snmp/util_funcs.h
 	$(INSTALL) -D -m 0644 $(NETSNMP_DIR)/agent/mibgroup/mibincl.h $(STAGING_DIR)/usr/include/net-snmp/library/mibincl.h
 	$(INSTALL) -D -m 0644 $(NETSNMP_DIR)/agent/mibgroup/header_complex.h $(STAGING_DIR)/usr/include/net-snmp/agent/header_complex.h
 	$(INSTALL) -D -m 0755 package/netsnmp/S59snmpd $(TARGET_DIR)/etc/init.d/S59snmpd
+	touch $@
 
-netsnmp: $(if $(BR2_PACKAGE_OPENSSL),openssl) $(TARGET_DIR)/usr/sbin/snmpd
-
-netsnmp-headers: $(TARGET_DIR)/usr/include/net-snmp/net-snmp-config.h
-	$(INSTALL) -d $(TARGET_DIR)/usr/include/net-snmp
-	cp -a $(STAGING_DIR)/usr/include/net-snmp $(TARGET_DIR)/usr/include/net-snmp
-	cp -a $(STAGING_DIR)/usr/include/ucd-snmp $(TARGET_DIR)/usr/include/net-snmp
-
-netsnmp-source: $(DL_DIR)/$(NETSNMP_SOURCE)
-
-netsnmp-clean:
-	-$(MAKE) PREFIX=$(TARGET_DIR) INSTALL_PREFIX=$(TARGET_DIR) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(NETSNMP_DIR) uninstall
-	-$(MAKE) -C $(NETSNMP_DIR) clean
-	-rm -rf $(TARGET_DIR)/etc/snmp/{snmpd{,trapd},mib2c*}.conf \
-		$(TARGET_DIR)/etc/default/snmpd \
-		$(TARGET_DIR)/usr/include/net-snmp
-
-netsnmp-dirclean:
-	rm -rf $(NETSNMP_DIR)
-
-#############################################################
-#
-# Toplevel Makefile options
-#
-#############################################################
-ifeq ($(BR2_PACKAGE_NETSNMP),y)
-TARGETS+=netsnmp
-endif
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 2/3] netsnmp: update TODO
  2009-08-04 14:15 [Buildroot] [pull request] Pull request for branch snmp-fix Thomas Petazzoni
  2009-08-04 14:15 ` [Buildroot] [PATCH 1/3] netsnmp: convert to autotools.in and fix build issues Thomas Petazzoni
@ 2009-08-04 14:15 ` Thomas Petazzoni
  2009-08-04 14:15 ` [Buildroot] [PATCH 3/3] netsnmp: add patch to fix CVE-2008-6123 Thomas Petazzoni
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2009-08-04 14:15 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 TODO |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/TODO b/TODO
index bf98fea..8a73c7f 100644
--- a/TODO
+++ b/TODO
@@ -15,3 +15,13 @@ Buildroot2 TODOs
   present, and rerun the configuration... with the wrong environment
   variables (STRIP= is missing). An autoreconf on this package is
   probably necessary.
+
+- net-snmp:
+   - Figure out why the net-snmp build systems hardcodes rpath into
+     the libraries (and these rpath are completely wrong since they
+     are based on the host directory hierarchy)
+   - Figure out how to get the Perl support compiled
+   - Find someone more knowledgeable in net-snmp usage to tell how the
+     packaging could be improve (many files installed in /usr/share/,
+     many tools in /usr/bin, is this all necessary ? should it be
+     split in subpackages somehow ?)
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 3/3] netsnmp: add patch to fix CVE-2008-6123
  2009-08-04 14:15 [Buildroot] [pull request] Pull request for branch snmp-fix Thomas Petazzoni
  2009-08-04 14:15 ` [Buildroot] [PATCH 1/3] netsnmp: convert to autotools.in and fix build issues Thomas Petazzoni
  2009-08-04 14:15 ` [Buildroot] [PATCH 2/3] netsnmp: update TODO Thomas Petazzoni
@ 2009-08-04 14:15 ` Thomas Petazzoni
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2009-08-04 14:15 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../netsnmp/netsnmp-5.4.2.1-CVE-2008-6123.patch    |   29 ++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 package/netsnmp/netsnmp-5.4.2.1-CVE-2008-6123.patch

diff --git a/package/netsnmp/netsnmp-5.4.2.1-CVE-2008-6123.patch b/package/netsnmp/netsnmp-5.4.2.1-CVE-2008-6123.patch
new file mode 100644
index 0000000..2ecc1bb
--- /dev/null
+++ b/package/netsnmp/netsnmp-5.4.2.1-CVE-2008-6123.patch
@@ -0,0 +1,29 @@
+This patch fixes CVE-2008-6123, according to
+http://bugs.gentoo.org/show_bug.cgi?id=250429. It has been found
+upstream at
+http://net-snmp.svn.sourceforge.net/viewvc/net-snmp/branches/V5-4-patches/net-snmp/snmplib/snmpUDPDomain.c?view=patch&r1=17367&r2=17366&pathrev=17367.
+
+---
+ snmplib/snmpUDPDomain.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+Index: netsnmp-5.4.2.1/snmplib/snmpUDPDomain.c
+===================================================================
+--- netsnmp-5.4.2.1.orig/snmplib/snmpUDPDomain.c
++++ netsnmp-5.4.2.1/snmplib/snmpUDPDomain.c
+@@ -104,12 +104,12 @@
+ 	char tmp[64];
+         to = (struct sockaddr_in *) &(addr_pair->remote_addr);
+         if (to == NULL) {
+-            sprintf(tmp, "UDP: [%s]->unknown",
++            sprintf(tmp, "UDP: unknown->[%s]",
+                     inet_ntoa(addr_pair->local_addr));
+         } else {
+-            sprintf(tmp, "UDP: [%s]->", inet_ntoa(addr_pair->local_addr));
+-            sprintf(tmp + strlen(tmp), "[%s]:%hd",
++            sprintf(tmp, "UDP: [%s]:%hu->",
+                     inet_ntoa(to->sin_addr), ntohs(to->sin_port));
++            sprintf(tmp + strlen(tmp), "[%s]", inet_ntoa(addr_pair->local_addr));
+         }
+         return strdup(tmp);
+     }
-- 
1.6.0.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH 1/3] netsnmp: convert to autotools.in and fix build issues
  2009-08-04 14:15 ` [Buildroot] [PATCH 1/3] netsnmp: convert to autotools.in and fix build issues Thomas Petazzoni
@ 2009-08-04 15:14   ` Peter Korsgaard
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2009-08-04 15:14 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

Hi,

 Thomas> Moreover, we introduce a patch to the build system so that it
 Thomas> doesn't call ldconfig on /usr/lib at install time, which is
 Thomas> completely useless when doing cross-compilation.

Wouldn't it be simpler to just provide a different value to
LIB_LDCONFIG_CMD on the make commandline instead of the patch?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-08-04 15:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-04 14:15 [Buildroot] [pull request] Pull request for branch snmp-fix Thomas Petazzoni
2009-08-04 14:15 ` [Buildroot] [PATCH 1/3] netsnmp: convert to autotools.in and fix build issues Thomas Petazzoni
2009-08-04 15:14   ` Peter Korsgaard
2009-08-04 14:15 ` [Buildroot] [PATCH 2/3] netsnmp: update TODO Thomas Petazzoni
2009-08-04 14:15 ` [Buildroot] [PATCH 3/3] netsnmp: add patch to fix CVE-2008-6123 Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.