aboutsummaryrefslogtreecommitdiffstats
path: root/japanese
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2008-11-08 16:49:01 +0800
committerhrs <hrs@FreeBSD.org>2008-11-08 16:49:01 +0800
commit8b2d5e4b9cc00abe0c8e3673f8253c146a1df267 (patch)
treeb9c0d13e90e08f71d2334d024aa0512e0a1a4b8f /japanese
parent32065e1e627eea04027c715985e233802fde4730 (diff)
downloadfreebsd-ports-gnome-8b2d5e4b9cc00abe0c8e3673f8253c146a1df267.tar.gz
freebsd-ports-gnome-8b2d5e4b9cc00abe0c8e3673f8253c146a1df267.tar.zst
freebsd-ports-gnome-8b2d5e4b9cc00abe0c8e3673f8253c146a1df267.zip
- Use mode 0755 for unix domain socket directory to prevent write
access from users other than the owner (bin). - Remove /tmp/.iroha_unix before cannaserver starts and after it is killed.
Diffstat (limited to 'japanese')
-rw-r--r--japanese/canna-server/Makefile2
-rw-r--r--japanese/canna-server/files/canna.sh.in16
-rw-r--r--japanese/canna-server/files/patch-server-comm.c15
3 files changed, 26 insertions, 7 deletions
diff --git a/japanese/canna-server/Makefile b/japanese/canna-server/Makefile
index 35b55cc4d957..e571edbae957 100644
--- a/japanese/canna-server/Makefile
+++ b/japanese/canna-server/Makefile
@@ -7,7 +7,7 @@
PORTNAME= canna
PORTVERSION= 3.7p3
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= japanese
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP}
MASTER_SITE_SUBDIR= canna/9565/
diff --git a/japanese/canna-server/files/canna.sh.in b/japanese/canna-server/files/canna.sh.in
index 6197f41195ad..158d6c80638d 100644
--- a/japanese/canna-server/files/canna.sh.in
+++ b/japanese/canna-server/files/canna.sh.in
@@ -27,11 +27,12 @@ canna_flags=${canna_flags:-"-u bin"} # Flags to canna program
name="canna"
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/cannaserver"
-start_precmd="canna_precmd"
-stop_cmd="canna_stop"
+start_precmd="canna_start_precmd"
+stop_cmd="canna_stop_cmd"
-canna_precmd() {
- rm -f /tmp/.iroha_unix/IROHA
+canna_start_precmd() {
+ rm -f /tmp/.iroha_unix/IROHA*
+ rmdir /tmp/.iroha_unix > /dev/null 2>&1 || true
touch /var/log/CANNA0msgs
mkdir -p -m 0775 \
%%PREFIX%%/share/canna/dic/user/user \
@@ -42,9 +43,12 @@ canna_precmd() {
%%PREFIX%%/share/canna/dic/group
}
-canna_stop() {
+canna_stop_cmd() {
echo "Stopping ${name}."
- %%PREFIX%%/sbin/cannakill
+ if %%PREFIX%%/sbin/cannakill; then
+ rm -f /tmp/.iroha_unix/IROHA*
+ rmdir /tmp/.iroha_unix > /dev/null 2>&1 || true
+ fi
}
load_rc_config $name
diff --git a/japanese/canna-server/files/patch-server-comm.c b/japanese/canna-server/files/patch-server-comm.c
new file mode 100644
index 000000000000..587efec36700
--- /dev/null
+++ b/japanese/canna-server/files/patch-server-comm.c
@@ -0,0 +1,15 @@
+--- server/comm.c.orig 2004-04-27 06:48:37.000000000 +0900
++++ server/comm.c 2008-11-08 17:38:21.000000000 +0900
+@@ -555,10 +555,11 @@
+ unaddr->sun_family = AF_UNIX;
+ oldUmask = umask (0);
+
+- if ( mkdir( IR_UNIX_DIR, 0777 ) == -1 &&
++ if ( mkdir( IR_UNIX_DIR, 0755 ) == -1 &&
+ errno != EEXIST ) {
+ ir_debug( Dmsg(5, "Can't open %s error No. %d\n",IR_UNIX_DIR, errno));
+ }
++
+ if (RkiStrlcpy(unaddr->sun_path, IR_UNIX_PATH, sockpathmax) >= sockpathmax) {
+ ir_debug( Dmsg(5, "Path to socket is too long\n"));
+ goto last;