aboutsummaryrefslogtreecommitdiffstats
path: root/japanese
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2008-11-02 00:45:39 +0800
committerhrs <hrs@FreeBSD.org>2008-11-02 00:45:39 +0800
commit0dfbbdaaec01bd027484dbd1acfe9954dfab2ea0 (patch)
tree1c71323fd501bd698ecfc180d715116e3d961f90 /japanese
parent392bb7d15afd1e93f4678ff1135b503e513b10bc (diff)
downloadfreebsd-ports-graphics-0dfbbdaaec01bd027484dbd1acfe9954dfab2ea0.tar.gz
freebsd-ports-graphics-0dfbbdaaec01bd027484dbd1acfe9954dfab2ea0.tar.zst
freebsd-ports-graphics-0dfbbdaaec01bd027484dbd1acfe9954dfab2ea0.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.
Diffstat (limited to 'japanese')
-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 379833b160b..c30324feb25 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 00000000000..d37e11eba2b
--- /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 00000000000..f280fdc5db9
--- /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 00000000000..68eeb8685ed
--- /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);
+