aboutsummaryrefslogtreecommitdiff
path: root/japanese/kinput2
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2008-11-01 16:45:39 +0000
committerHiroki Sato <hrs@FreeBSD.org>2008-11-01 16:45:39 +0000
commitb17d51b0d4bbe31b0b9fff35e22b320e987aadcd (patch)
tree7a58d1c26b160b006137f76ae1c31696b82811e3 /japanese/kinput2
parent7709499828643a9d70d2d120e606a8e1f3f4b913 (diff)
downloadports-b17d51b0d4bbe31b0b9fff35e22b320e987aadcd.tar.gz
ports-b17d51b0d4bbe31b0b9fff35e22b320e987aadcd.zip
Use 127.0.0.1 for incoming communication socket (internally-used
one) instead of INADDR_ANY. This is not a user-visible change of the original functionality.
Notes
Notes: svn path=/head/; revision=222278
Diffstat (limited to 'japanese/kinput2')
-rw-r--r--japanese/kinput2/Makefile2
-rw-r--r--japanese/kinput2/files/patch-lib-IMProto.c11
-rw-r--r--japanese/kinput2/files/patch-lib-imlib-imfuncs.h11
-rw-r--r--japanese/kinput2/files/patch-lib-imlib-imxport.c45
4 files changed, 68 insertions, 1 deletions
diff --git a/japanese/kinput2/Makefile b/japanese/kinput2/Makefile
index 379833b160b6..c30324feb25a 100644
--- a/japanese/kinput2/Makefile
+++ b/japanese/kinput2/Makefile
@@ -7,7 +7,7 @@
PORTNAME= kinput2
PORTVERSION= 3.1
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= japanese x11
MASTER_SITES= ftp://ftp.sra.co.jp/pub/x11/kinput2/
DISTNAME= ${PORTNAME}-v${PORTVERSION}
diff --git a/japanese/kinput2/files/patch-lib-IMProto.c b/japanese/kinput2/files/patch-lib-IMProto.c
new file mode 100644
index 000000000000..d37e11eba2bb
--- /dev/null
+++ b/japanese/kinput2/files/patch-lib-IMProto.c
@@ -0,0 +1,11 @@
+--- lib/IMProto.c.orig 2002-10-03 18:35:28.000000000 +0900
++++ lib/IMProto.c 2008-11-02 01:12:32.000000000 +0900
+@@ -259,7 +259,7 @@
+ #ifdef IM_TCP_TRANSPORT
+ if (ipw->imp.use_tcp_transport) {
+ ipw->imp.tcp_port = 0; /* let the system choose the port number */
+- ipw->imp.tcp_sock = IMCreateTCPService(&ipw->imp.tcp_port);
++ ipw->imp.tcp_sock = IMCreateTCPService(&ipw->imp.tcp_port, "127.0.0.1");
+ }
+ if (ipw->imp.tcp_sock >= 0) {
+ TRACE(("call XtAppAddInput for tcp socket(%d)\n", ipw->imp.tcp_sock));
diff --git a/japanese/kinput2/files/patch-lib-imlib-imfuncs.h b/japanese/kinput2/files/patch-lib-imlib-imfuncs.h
new file mode 100644
index 000000000000..f280fdc5db9a
--- /dev/null
+++ b/japanese/kinput2/files/patch-lib-imlib-imfuncs.h
@@ -0,0 +1,11 @@
+--- lib/imlib/imfuncs.h.orig 2002-10-03 18:35:30.000000000 +0900
++++ lib/imlib/imfuncs.h 2008-11-02 01:08:11.000000000 +0900
+@@ -60,7 +60,7 @@
+ /*
+ * Transport layer functions (defined in imxport.c)
+ */
+-extern int IMCreateTCPService _Pt_((int *portp));
++extern int IMCreateTCPService _Pt_((int *portp, char *listenaddr));
+ extern IMConnection *IMTCPConnection _Pt_((Widget protocol, int socket));
+ extern int IMCreateUnixService _Pt_((char *path));
+ extern IMConnection *IMUnixConnection _Pt_((Widget protocol, int socket));
diff --git a/japanese/kinput2/files/patch-lib-imlib-imxport.c b/japanese/kinput2/files/patch-lib-imlib-imxport.c
new file mode 100644
index 000000000000..68eeb8685ed0
--- /dev/null
+++ b/japanese/kinput2/files/patch-lib-imlib-imxport.c
@@ -0,0 +1,45 @@
+--- lib/imlib/imxport.c.orig 2002-10-03 18:35:31.000000000 +0900
++++ lib/imlib/imxport.c 2008-11-02 01:23:56.000000000 +0900
+@@ -35,6 +35,7 @@
+
+ #ifdef IM_TCP_TRANSPORT
+ #include <netinet/in.h>
++#include <netdb.h>
+ #endif
+
+ extern int errno;
+@@ -412,8 +413,9 @@
+
+ #ifdef IM_TCP_TRANSPORT
+ int
+-IMCreateTCPService(portp)
++IMCreateTCPService(portp, listenaddr)
+ int *portp;
++char *listenaddr;
+ {
+ struct sockaddr_in addr;
+ int optval = 1;
+@@ -431,7 +433,22 @@
+ (char *)&optval, sizeof(optval));
+ #endif /* SO_REUSEADDR */
+
+- bzero((char *)&addr, sizeof(addr));
++ memset((void *)&addr, 0, sizeof(addr));
++ if (listenaddr[0] == '\0') {
++ addr.sin_addr.s_addr = htonl(INADDR_ANY);
++ } else {
++ if (!inet_aton(listenaddr, &addr.sin_addr)) {
++ struct hostent *hp;
++ struct in_addr **pptr;
++
++ if ((hp = gethostbyname((const char *)listenaddr)) == NULL) {
++ DPRINT(("Can't resolve %s\n", listenaddr));
++ return -1;
++ }
++ pptr = (struct in_addr **)hp->h_addr_list;
++ memcpy((void *)&addr.sin_addr, pptr[0], sizeof(struct in_addr));
++ }
++ }
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(*portp);
+