aboutsummaryrefslogtreecommitdiffstats
path: root/japanese/Canna
diff options
context:
space:
mode:
Diffstat (limited to 'japanese/Canna')
-rw-r--r--japanese/Canna/Makefile2
-rw-r--r--japanese/Canna/files/patch-ac19
-rw-r--r--japanese/Canna/files/patch-ah11
-rw-r--r--japanese/Canna/files/patch-ai41
4 files changed, 70 insertions, 3 deletions
diff --git a/japanese/Canna/Makefile b/japanese/Canna/Makefile
index f3f2cfec0faa..29a166df2443 100644
--- a/japanese/Canna/Makefile
+++ b/japanese/Canna/Makefile
@@ -49,7 +49,7 @@ STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/canna.sh
pre-install:
${MKDIR} /var/run/canna
- ${CHOWN} bin.bin /var/run/canna
+ ${CHOWN} bin:bin /var/run/canna
@${SED} -e "s;@PREFIX@;${PREFIX};g" ${FILESDIR}/canna.sh.in \
>${WRKDIR}/canna.sh
diff --git a/japanese/Canna/files/patch-ac b/japanese/Canna/files/patch-ac
index f16c082cb612..78ca78696ee5 100644
--- a/japanese/Canna/files/patch-ac
+++ b/japanese/Canna/files/patch-ac
@@ -1,5 +1,5 @@
--- Canna.conf.orig Thu Nov 28 04:27:01 1996
-+++ Canna.conf Wed Nov 14 18:14:10 2001
++++ Canna.conf Mon Nov 19 20:41:21 2001
@@ -128,14 +128,15 @@
* $Id: Canna.conf,v 3.13 1996/11/28 10:27:01 kon Exp $
*/
@@ -23,7 +23,13 @@
wcharDefinition = -DCANNA_WCHAR
Wlib =
-@@ -148,7 +149,7 @@
+@@ -143,12 +144,12 @@
+
+ cannaOwner = bin
+ cannaGroup = bin
+-
+ cannaOwnerGroup = -o $(cannaOwner) -g $(cannaGroup)
++cannaOwnerDefinition = -DcannaOwner="$(cannaOwner)"
pointerIntegerDef =
@@ -41,3 +47,12 @@
/* locale ディレクトリを持っている場合は以下を記述する */
/* #define LOCALE_DIR /usr/lib/locale */
+@@ -273,7 +274,7 @@
+ * ここから下は変更しないようにしてください。
+ */
+
+- CANNASERVER_DEFINES = $(wcharDefinition)
++ CANNASERVER_DEFINES = $(wcharDefinition) $(cannaOwnerDefinition)
+ RK_DEFINES = $(pointerIntegerDef)
+ RKC_DEFINES = $(wcharDefinition)
+ UILIB_DEFINES = $(wcharDefinition) $(pointerIntegerDef) \
diff --git a/japanese/Canna/files/patch-ah b/japanese/Canna/files/patch-ah
new file mode 100644
index 000000000000..0dd3c35bed2f
--- /dev/null
+++ b/japanese/Canna/files/patch-ah
@@ -0,0 +1,11 @@
+--- server/Imakefile.orig Wed Nov 27 01:25:24 1996
++++ server/Imakefile Mon Nov 19 20:25:46 2001
+@@ -7,7 +7,7 @@
+ INSTFLAGS = $(INSTUGIDFLAGS)
+ LOCAL_LIBRARIES = $(CANNAROOT)/lib/RK/RK.a
+ #else
+- INSTFLAGS = -s $(INSTUGIDFLAGS)
++ INSTFLAGS = -s
+ LOCAL_LIBRARIES = $(CANNAROOT)/lib/RK/libRK.a
+ #endif
+ DEFINES = $(CANNASERVER_DEFINES)
diff --git a/japanese/Canna/files/patch-ai b/japanese/Canna/files/patch-ai
new file mode 100644
index 000000000000..ca24441c7a54
--- /dev/null
+++ b/japanese/Canna/files/patch-ai
@@ -0,0 +1,41 @@
+--- server/main.c.orig Wed Nov 27 01:26:42 1996
++++ server/main.c Mon Nov 19 20:49:24 2001
+@@ -57,6 +57,7 @@
+ #include <errno.h>
+ #include <sys/types.h>
+ #include <signal.h>
++#include <pwd.h>
+
+ #include "IR.h"
+ #include "net.h"
+@@ -82,6 +83,8 @@
+ #ifdef USE_UNIX_SOCKET
+ extern struct sockaddr_un unsock;
+ #endif
++ struct passwd *pw;
++ uid_t binuid;
+
+ /* サーバを子プロセス(デーモン)として起動する */
+ parentid = BecomeDaemon(argc, argv);
+@@ -114,9 +117,21 @@
+ exit(2);
+ }
+
++ if ( (pw = getpwnam(cannaOwner)) == NULL ) {
++ fprintf(stderr, "User %s unknown\n", cannaOwner);
++ exit(1);
++ }
++
+ /* エラー出力の切り替え、TTYの切り離し */
+ if (parentid) kill(parentid, SIGTERM);
+ DetachTTY();
++
++ /* Drop root privilege. */
++ binuid = pw->pw_uid;
++ if ( setuid(binuid) < 0 ) {
++ fprintf(stderr, "Unable to setuid to %s(UID: %s).\n", cannaOwner, binuid);
++ exit(1);
++ }
+
+ /* ディスパッチループ */
+ Dispatch() ;