From 4f42ac237a9d0b483490adb59e273ef15ab95563 Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Mon, 29 Dec 2008 17:22:53 +0000 Subject: - Fix off-by-one error in sockaddr_un length calculation[*]. - Style clean-ups. Spotted by: Yoshihiko Sarumaru[*] --- japanese/Wnn7-lib/Makefile | 25 +++++++++++++------------ japanese/Wnn7-lib/files/patch-README | 14 ++++++++++++++ japanese/Wnn7-lib/files/patch-Wnn_jlib_js.c | 24 ++++++++++++++++++++++-- japanese/Wnn7-lib/pkg-descr | 26 ++------------------------ japanese/Wnn7-lib/pkg-plist | 3 +-- 5 files changed, 52 insertions(+), 40 deletions(-) create mode 100644 japanese/Wnn7-lib/files/patch-README (limited to 'japanese/Wnn7-lib') diff --git a/japanese/Wnn7-lib/Makefile b/japanese/Wnn7-lib/Makefile index 0f43ceb80e2c..25c259b4cb7c 100644 --- a/japanese/Wnn7-lib/Makefile +++ b/japanese/Wnn7-lib/Makefile @@ -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 @@ -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 diff --git a/japanese/Wnn7-lib/files/patch-README b/japanese/Wnn7-lib/files/patch-README new file mode 100644 index 000000000000..cc593a9cf278 --- /dev/null +++ b/japanese/Wnn7-lib/files/patch-README @@ -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". + + + *************************************************************************** diff --git a/japanese/Wnn7-lib/files/patch-Wnn_jlib_js.c b/japanese/Wnn7-lib/files/patch-Wnn_jlib_js.c index ab5c21ff0217..939c5ec5f780 100644 --- a/japanese/Wnn7-lib/files/patch-Wnn_jlib_js.c +++ b/japanese/Wnn7-lib/files/patch-Wnn_jlib_js.c @@ -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; + } diff --git a/japanese/Wnn7-lib/pkg-descr b/japanese/Wnn7-lib/pkg-descr index 62561c22991c..12bfc7ea5c7f 100644 --- a/japanese/Wnn7-lib/pkg-descr +++ b/japanese/Wnn7-lib/pkg-descr @@ -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 diff --git a/japanese/Wnn7-lib/pkg-plist b/japanese/Wnn7-lib/pkg-plist index 931d3c471bad..cefabb53c272 100644 --- a/japanese/Wnn7-lib/pkg-plist +++ b/japanese/Wnn7-lib/pkg-plist @@ -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 -- cgit v1.2.3