- Fix off-by-one error in sockaddr_un length calculation[*].

- Style clean-ups.

Spotted by:	Yoshihiko Sarumaru[*]
This commit is contained in:
Hiroki Sato 2008-12-29 17:22:53 +00:00
parent 6448e6c85d
commit 4f42ac237a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=224952
5 changed files with 52 additions and 40 deletions

View file

@ -7,20 +7,19 @@
PORTNAME= Wnn7-lib
PORTVERSION= 2001.10.17
PORTREVISION= 1
CATEGORIES= japanese
MASTER_SITES= ftp://ftp.omronsoft.co.jp/pub/Wnn7/sdk_source/
DISTNAME= Wnn7SDK
EXTRACT_SUFX= .tgz
MAINTAINER= ports@FreeBSD.org
COMMENT= Include files and a library of Wnn7
BUILD_DEPENDS= imake:${PORTSDIR}/devel/imake
WRKSRC= ${WRKDIR}/src
DOCDIR= ${PREFIX}/share/doc/ja-Wnn7-lib
MAINTAINER= hrs@FreeBSD.org
COMMENT= Wnn7 client library
USE_IMAKE= yes
USE_LDCONFIG= yes
WRKSRC= ${WRKDIR}/src
PORTDOCS= README
.include <bsd.port.pre.mk>
@ -32,12 +31,14 @@ post-patch:
# Warning: we cannot use USE_IMAKE.
do-build:
( cd ${WRKSRC} ; make World -f Makefile.ini )
cd ${WRKSRC} && make World -f Makefile.ini
post-install:
@${MKDIR} ${PREFIX}/include/wnn7/wnn
@${INSTALL_DATA} ${WRKSRC}/Wnn/include/*.h ${PREFIX}/include/wnn7/wnn
@${MKDIR} ${DOCDIR}
@${INSTALL_DATA} ${WRKSRC}/README ${DOCDIR}
${MKDIR} ${PREFIX}/include/wnn7/wnn
${INSTALL_DATA} ${WRKSRC}/Wnn/include/*.h ${PREFIX}/include/wnn7/wnn
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR}
.endif
.include <bsd.port.post.mk>

View file

@ -0,0 +1,14 @@
--- README.orig 2008-12-30 02:10:05.000000000 +0900
+++ README 2008-12-30 02:09:54.000000000 +0900
@@ -129,6 +129,11 @@
Comments on Modifications:
+2008/12/29: hrs@FreeBSD.org
+ Add SUN_LEN() macro to fix calculation of length of sockaddr_un when
+ sun_len is included in the structure. This fixes the mangled unix
+ domain socket name issue; "/tmp/jd_sockV" is used instead of
+ "/tmp/jd_sockV7".
***************************************************************************

View file

@ -1,5 +1,5 @@
--- Wnn/jlib/js.c.orig 2007-11-11 17:46:58.000000000 +0900
+++ Wnn/jlib/js.c 2007-11-11 17:47:59.000000000 +0900
--- Wnn/jlib/js.c.orig 2001-10-17 10:37:17.000000000 +0900
+++ Wnn/jlib/js.c 2008-12-30 01:41:03.000000000 +0900
@@ -159,9 +159,9 @@
*/
@ -21,3 +21,23 @@
typedef struct _host_address {
int address_len;
char *address;
@@ -358,14 +356,17 @@
/* find socket name from table by lang */
sock_name = UNIX_SOCKET_NAME; /* Jserver */
strcpy(saddr.sun_path, sock_name);
-#if ((defined AIXV3) || (defined FREEBSD))
+#if ((defined AIXV3))
strcat(saddr.sun_path, "=");
#endif
if ((sd = socket(AF_UNIX,SOCK_STREAM, 0)) == ERROR) {
return -1;
}
- if (connect(sd,(struct sockaddr *)&saddr,strlen(saddr.sun_path)+sizeof(saddr.sun_family)) == ERROR) {
+#if !defined(SUN_LEN)
+# define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
+#endif
+ if (connect(sd,(struct sockaddr *)&saddr, SUN_LEN(&saddr)) == ERROR) {
close(sd);
return -1;
}

View file

@ -1,26 +1,4 @@
This port has include files (e.g. wnn/commonhd.h) and a library file
(e.g. libwnn.a) to build Wnn7 clients. The files are compiled from
sources Wnn7SDK.tgz which you can get in
This port is Wnn7 client library including header and library files
for Wnn7 client development.
WWW: http://www.omronsoft.co.jp/
The license of the sources is in
/usr/local/share/doc/ja-Wnn7-lib/README
By the way, you must buy the server of Wnn7, whose name is jserver,
from Omron Software Co., Ltd.
+------------------------------------------+
| URL: http://www.omronsoft.co.jp |
| E-mail: wnn-info@omronsoft.co.jp |
| TEL: +81-44-246-6006 |
| FAX: +81-44-246-6011 |
+------------------------------------------+
Wnn7 is one of Japanese input methods. 'Wnn7 Personal'
supports Japanese method only. However, FreeWnn (which is free)
supports Chinese and Korean ones, too.
- S. Taoka
taoka@FreeBSD.org

View file

@ -1,3 +1,4 @@
@comment $FreeBSD$
include/wnn7/wnn/commonhd.h
include/wnn7/wnn/config.h
include/wnn7/wnn/copyright.h
@ -22,5 +23,3 @@ include/wnn7/wnn/wnnerror.h
lib/libwnn7.a
lib/libwnn7.so
lib/libwnn7.so.1
share/doc/ja-Wnn7-lib/README
@dirrm share/doc/ja-Wnn7-lib