aboutsummaryrefslogtreecommitdiff
path: root/japanese/canna-lib
diff options
context:
space:
mode:
authorMasafumi Max NAKANE <max@FreeBSD.org>2002-11-14 02:25:20 +0000
committerMasafumi Max NAKANE <max@FreeBSD.org>2002-11-14 02:25:20 +0000
commita67b340beafbad50b0855a5d2d92bd2a17ec7509 (patch)
tree64a5517dd878e528d6f825cced7033dfd6fd2b1c /japanese/canna-lib
parentc62e5cfc9f518b1eaabd1ca0578832aa1e30951b (diff)
downloadports-a67b340beafbad50b0855a5d2d92bd2a17ec7509.tar.gz
ports-a67b340beafbad50b0855a5d2d92bd2a17ec7509.zip
Cannaserver now has the -u option which allow you to specify who should
own the server process. So instead of patching up the source to drop the root privilege, just use this. Suggested by: AIDA Shinra <aida-s@jcom.home.ne.jp>
Notes
Notes: svn path=/head/; revision=70075
Diffstat (limited to 'japanese/canna-lib')
-rw-r--r--japanese/canna-lib/files/canna.sh.in4
-rw-r--r--japanese/canna-lib/files/patch-ac10
-rw-r--r--japanese/canna-lib/files/patch-ah11
-rw-r--r--japanese/canna-lib/files/patch-ai41
4 files changed, 5 insertions, 61 deletions
diff --git a/japanese/canna-lib/files/canna.sh.in b/japanese/canna-lib/files/canna.sh.in
index 6d2fdf5864e1..1595ca688f9f 100644
--- a/japanese/canna-lib/files/canna.sh.in
+++ b/japanese/canna-lib/files/canna.sh.in
@@ -1,9 +1,9 @@
#!/bin/sh
-OPTIONS=
+OPTIONS="-u bin"
# Uncomment the following if you want to use a TCP connection
# instead of a UNIX domain socket.
-#OPTIONS="-inet"
+#OPTIONS="-u bin -inet"
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
echo "$0: Cannot determine the PREFIX" >&2
diff --git a/japanese/canna-lib/files/patch-ac b/japanese/canna-lib/files/patch-ac
index 42580ff94422..42a70332d271 100644
--- a/japanese/canna-lib/files/patch-ac
+++ b/japanese/canna-lib/files/patch-ac
@@ -1,5 +1,5 @@
--- Canna.conf.orig Thu Oct 24 23:37:25 2002
-+++ Canna.conf Thu Nov 7 09:14:12 2002
++++ Canna.conf Thu Nov 14 09:28:18 2002
@@ -132,11 +132,12 @@
/* rootにならずにインストールする時はこれを定義して下さい */
@@ -27,11 +27,7 @@
#endif
/* 次の3行は変更しないでください */
-@@ -161,10 +162,11 @@
- #else
- cannaOwnerGroup = -o $(cannaOwner) -g $(cannaGroup)
- #endif
-+cannaOwnerDefinition = -DcannaOwner="\"$(cannaOwner)\""
+@@ -164,7 +165,7 @@
pointerIntegerDef =
@@ -40,7 +36,7 @@
/* SunOS 4.x をお使いの方で shared object を利用する場合には
cannaDsoRev = 1.1
と指定してください。また、FreeBSD を利用する場合は、
-@@ -308,7 +310,7 @@
+@@ -308,7 +309,7 @@
* ここから下は変更しないようにしてください。
*/
diff --git a/japanese/canna-lib/files/patch-ah b/japanese/canna-lib/files/patch-ah
deleted file mode 100644
index 0dd3c35bed2f..000000000000
--- a/japanese/canna-lib/files/patch-ah
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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-lib/files/patch-ai b/japanese/canna-lib/files/patch-ai
deleted file mode 100644
index ca24441c7a54..000000000000
--- a/japanese/canna-lib/files/patch-ai
+++ /dev/null
@@ -1,41 +0,0 @@
---- 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() ;