public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH 0/1] tcp-wrappers: remove size_t.patch
@ 2013-02-02  8:18 rongqing.li
  2013-02-02  8:18 ` [PATCH 1/1] " rongqing.li
  0 siblings, 1 reply; 2+ messages in thread
From: rongqing.li @ 2013-02-02  8:18 UTC (permalink / raw)
  To: openembedded-core

From: "Roy.Li" <rongqing.li@windriver.com>

The following changes since commit 82602d2c55f5d233bd8351e95a84a65b792786e5:

  qt4: Add space for _appends (2013-02-01 22:49:27 +0000)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib tcp_wrapper_remove_size_t_patch
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=tcp_wrapper_remove_size_t_patch

Roy.Li (1):
  tcp-wrappers: remove size_t.patch

 .../tcp-wrappers/tcp-wrappers-7.6/size_t.patch     |   44 --------------------
 .../tcp-wrappers/tcp-wrappers_7.6.bb               |    3 +-
 2 files changed, 1 insertion(+), 46 deletions(-)
 delete mode 100644 meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/size_t.patch

-- 
1.7.10.4




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

* [PATCH 1/1] tcp-wrappers: remove size_t.patch
  2013-02-02  8:18 [PATCH 0/1] tcp-wrappers: remove size_t.patch rongqing.li
@ 2013-02-02  8:18 ` rongqing.li
  0 siblings, 0 replies; 2+ messages in thread
From: rongqing.li @ 2013-02-02  8:18 UTC (permalink / raw)
  To: openembedded-core

From: "Roy.Li" <rongqing.li@windriver.com>

1. it introduces bug in 64bit big endian process with __GLIBC__, At that
condition, size_t is 8byte, and the third parameter of getpeername is
socklen_t which is 4 byte. As a result, getpeername sees third parameter
is always 0, and can not return right value.

The similar program is below, the output is 0, not 9 on PPC64 cpu
	main()
	{
		long aa=9;
		printf("%d \n", *((int *)&aa));
	}

2. The correct fix is to change getpeername/getsockopt/recvfrom.. last
parameter type from int to socklen_t, but to simplify, we can remove
size_t.patch, since the size of int is same as socklen_t in 32bit/64bit
cpu. and size_t.patch only change three places, there are other places
which uses int, and work well.

2. Fedora, redhat el4 do not use this patch, but Debian uses it, does not
find why this patch is written, maybe it is gcc legency issue which does
not exist.

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
---
 .../tcp-wrappers/tcp-wrappers-7.6/size_t.patch     |   44 --------------------
 .../tcp-wrappers/tcp-wrappers_7.6.bb               |    3 +-
 2 files changed, 1 insertion(+), 46 deletions(-)
 delete mode 100644 meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/size_t.patch

diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/size_t.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/size_t.patch
deleted file mode 100644
index 8373e8a..0000000
--- a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/size_t.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-Upstream-Status: Backport
-
-diff -ruN tcp_wrappers_7.6.orig/fix_options.c tcp_wrappers_7.6/fix_options.c
---- tcp_wrappers_7.6.orig/fix_options.c	2003-08-21 03:41:33.000000000 +0200
-+++ tcp_wrappers_7.6/fix_options.c	2003-08-21 03:41:27.000000000 +0200
-@@ -38,7 +38,11 @@
- #ifdef IP_OPTIONS
-     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
-     char    lbuf[BUFFER_SIZE], *lp;
-+#ifdef __GLIBC__
-+    size_t  optsize = sizeof(optbuf), ipproto;
-+#else
-     int     optsize = sizeof(optbuf), ipproto;
-+#endif
-     struct protoent *ip;
-     int     fd = request->fd;
-     unsigned int opt;
-diff -ruN tcp_wrappers_7.6.orig/socket.c tcp_wrappers_7.6/socket.c
---- tcp_wrappers_7.6.orig/socket.c	2003-08-21 03:41:33.000000000 +0200
-+++ tcp_wrappers_7.6/socket.c	2003-08-21 03:40:51.000000000 +0200
-@@ -90,7 +90,11 @@
-     static struct sockaddr_in client;
-     static struct sockaddr_in server;
- #endif
-+#ifdef __GLIBC__
-+    size_t  len;
-+#else
-     int     len;
-+#endif
-     char    buf[BUFSIZ];
-     int     fd = request->fd;
- 
-@@ -421,7 +425,11 @@
- #else
-     struct sockaddr_in sin;
- #endif
-+#ifdef __GLIBC__
-+    size_t  size = sizeof(sin);
-+#else
-     int     size = sizeof(sin);
-+#endif
- 
-     /*
-      * Eat up the not-yet received datagram. Some systems insist on a
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb b/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
index 9b865ba..51ec7b2 100644
--- a/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
@@ -5,7 +5,7 @@ SECTION = "console/network"
 
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://DISCLAIMER;md5=071bd69cb78b18888ea5e3da5c3127fa"
-PR ="r9"
+PR ="r10"
 
 
 PACKAGES = "${PN}-dbg libwrap libwrap-doc libwrap-dev libwrap-staticdev ${PN} ${PN}-doc"
@@ -36,7 +36,6 @@ SRC_URI = "ftp://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \
            file://safe_finger.patch \
            file://sig_fix.patch \
            file://siglongjmp.patch \
-           file://size_t.patch \
            file://tcpdchk_libwrapped.patch \
            file://ldflags.patch \
            \
-- 
1.7.10.4




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

end of thread, other threads:[~2013-02-02  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-02  8:18 [PATCH 0/1] tcp-wrappers: remove size_t.patch rongqing.li
2013-02-02  8:18 ` [PATCH 1/1] " rongqing.li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox