17347731 iftop core dumps when using more than one -f option
authorLeibo Wang <Leibo.Wang@Sun.COM>
Wed, 11 Dec 2013 18:51:23 -0800
changeset 1594 7302abf31ae0
parent 1593 b0666dd4d31d
child 1595 20abf2f97330
17347731 iftop core dumps when using more than one -f option 17363623 iftop should support 64-bit building for Solaris
components/iftop/Makefile
components/iftop/iftop.p5m
components/iftop/patches/07.cfgfile.c.patch
--- a/components/iftop/Makefile	Wed Dec 11 15:19:02 2013 -0800
+++ b/components/iftop/Makefile	Wed Dec 11 18:51:23 2013 -0800
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
@@ -59,9 +59,9 @@
 
 
 # common targets
-build:		$(BUILD_32)
+build:		$(BUILD_64)
 
-install:	$(INSTALL_32)
+install:	$(INSTALL_64)
 
 test:		$(NO_TESTS)
 
--- a/components/iftop/iftop.p5m	Wed Dec 11 15:19:02 2013 -0800
+++ b/components/iftop/iftop.p5m	Wed Dec 11 18:51:23 2013 -0800
@@ -35,5 +35,5 @@
 
 license iftop.license license='GPLv2'
 
-file path=usr/sbin/iftop
+file usr/bin/$(MACH64)/iftop path=usr/sbin/iftop
 file path=usr/share/man/man8/iftop.8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/iftop/patches/07.cfgfile.c.patch	Wed Dec 11 18:51:23 2013 -0800
@@ -0,0 +1,23 @@
+This patch fixed segfault when supplying multiple options like '-f' for iftop.
+The fixing has been integrated into open iftop-1.0 pre-release version. We can
+see the fixing log here: 
+http://www.ex-parrot.com/~pdw/iftop/cvs/iftop/ChangeLog
+
+--- cfgfile.c.orig	2013-12-02 00:37:09.851645000 -0800
++++ cfgfile.c	2013-12-02 00:31:53.734822000 -0800
+@@ -230,8 +230,13 @@
+     stringmap S;
+ 
+     S = stringmap_find(config, directive);
+-    if (S) stringmap_delete_free(S);
+-    stringmap_insert(config, directive, item_ptr(xstrdup(s)));
++    if (S) {
++	xfree(S->d.v);
++	S->d = item_ptr(xstrdup(s));
++    }
++    else {
++	stringmap_insert(config, directive, item_ptr(xstrdup(s)));
++    }
+ }
+ 
+ int read_config(char *file, int whinge_on_error) {