diff options
author | Hiroki Sato <hrs@FreeBSD.org> | 2008-11-01 15:16:49 +0000 |
---|---|---|
committer | Hiroki Sato <hrs@FreeBSD.org> | 2008-11-01 15:16:49 +0000 |
commit | 17ecdee7b3bd797deb0a4bdca2559ebb9894532a (patch) | |
tree | 7cfcbae72596105ccaae6b5915c05b35e75b087c /japanese/skkserv/files | |
parent | dac2da7f40d31b1f449654988f940900b3fdd0b2 (diff) | |
download | ports-17ecdee7b3bd797deb0a4bdca2559ebb9894532a.tar.gz ports-17ecdee7b3bd797deb0a4bdca2559ebb9894532a.zip |
Notes
Diffstat (limited to 'japanese/skkserv/files')
-rw-r--r-- | japanese/skkserv/files/patch-skkserv.c | 63 | ||||
-rw-r--r-- | japanese/skkserv/files/patch-skkserv.h | 4 | ||||
-rw-r--r-- | japanese/skkserv/files/skkserv.sh.in | 18 |
3 files changed, 80 insertions, 5 deletions
diff --git a/japanese/skkserv/files/patch-skkserv.c b/japanese/skkserv/files/patch-skkserv.c index 901a4c14b6e0..0983a5d31cbb 100644 --- a/japanese/skkserv/files/patch-skkserv.c +++ b/japanese/skkserv/files/patch-skkserv.c @@ -1,6 +1,63 @@ ---- skkserv/skkserv.c.orig 2008-01-01 20:00:27.000000000 +0100 -+++ skkserv/skkserv.c 2008-01-01 20:01:01.000000000 +0100 -@@ -476,7 +476,7 @@ +--- skkserv/skkserv.c.orig 1997-01-21 04:16:36.000000000 +0900 ++++ skkserv/skkserv.c 2008-11-02 00:07:53.000000000 +0900 +@@ -124,6 +124,8 @@ + int clientsock[MAXCLNT]; /* socket for each client */ + int nclients; /* max index for active clients */ + ++char listenaddr[NI_MAXHOST]; ++ + main(argc, argv) + char *argv[]; + { +@@ -166,6 +168,12 @@ + case 'P': + if (parg +1 == argc) showusage(); + portnum = atoi(argv[++parg]); break; ++ case 'a': ++ case 'A': ++ if (parg +1 == argc) showusage(); ++ strncpy(listenaddr, argv[++parg], sizeof(listenaddr) - 1); ++ listenaddr[sizeof(listenaddr) - 1] = '\0'; ++ break; + default: showusage(); + } + } else if (setjisho == 0) { +@@ -232,9 +240,9 @@ + showusage() + { + fprintf(stderr, +- "Usage: %s [-d] [-l logfile] [-p port] \n", pgmnm); ++ "Usage: %s [-d] [-l logfile] [-p port] [-a listenaddr]\n", pgmnm); + fprintf(stderr, +- " %s [-d] [-l logfile] [-p port] skk-jisho\n", pgmnm); ++ " %s [-d] [-l logfile] [-p port] [-a listenaddr] skk-jisho\n", pgmnm); + exit(1); + } + +@@ -249,7 +257,21 @@ + + bzero((char*)&sin, sizeof(sin)); + sin.sin_family = AF_INET; +- sin.sin_addr.s_addr = htonl(INADDR_ANY); ++ if (listenaddr[0] == '\0') { ++ sin.sin_addr.s_addr = htonl(INADDR_ANY); ++ } else { ++ if (!inet_aton(listenaddr, &sin.sin_addr)) { ++ struct hostent *hp; ++ struct in_addr **pptr; ++ ++ if ((hp = gethostbyname(listenaddr)) == NULL) { ++ err("could not resolve the specified listen address"); ++ } ++ pptr = (struct in_addr **)hp->h_addr_list; ++ memcpy(&sin.sin_addr.s_addr, pptr[0], sizeof(struct in_addr)); ++ } ++ } ++ + if (portnum == 0) { + #ifdef PORTNUM + portnum = PORTNUM; +@@ -476,7 +498,7 @@ if (FD_ISSET(initsock, &readfds)) { len = sizeof(from); diff --git a/japanese/skkserv/files/patch-skkserv.h b/japanese/skkserv/files/patch-skkserv.h index c6c891559b2e..ae8375cca646 100644 --- a/japanese/skkserv/files/patch-skkserv.h +++ b/japanese/skkserv/files/patch-skkserv.h @@ -1,5 +1,5 @@ ---- skkserv/skkserv.h.orig 1997-01-20 20:16:36.000000000 +0100 -+++ skkserv/skkserv.h 2008-01-01 19:58:41.000000000 +0100 +--- skkserv/skkserv.h.orig 1997-01-21 04:16:36.000000000 +0900 ++++ skkserv/skkserv.h 2008-11-01 23:53:43.000000000 +0900 @@ -37,6 +37,8 @@ /* Necessary for SunOS 3.x and maybe other old systems */ diff --git a/japanese/skkserv/files/skkserv.sh.in b/japanese/skkserv/files/skkserv.sh.in new file mode 100644 index 000000000000..c8b364a7ca67 --- /dev/null +++ b/japanese/skkserv/files/skkserv.sh.in @@ -0,0 +1,18 @@ +#!/bin/sh +# $FreeBSD$ +# +# PROVIDE: skkserv +# REQUIRE: LOGIN +# KEYWORD: shutdown +# + +. %%RC_SUBR%% + +name=skkserv +rcvar=`set_rcvar` +command=%%PREFIX%%/sbin/skkserv + +: ${skkserv_flags:="-a 127.0.0.1"} + +load_rc_config ${name} +run_rc_command $1 |