head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.54 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.3.0.52 pkgsrc-2012Q4-base:1.3 pkgsrc-2011Q4:1.3.0.50 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q2:1.3.0.48 pkgsrc-2011Q2-base:1.3 pkgsrc-2009Q4:1.3.0.46 pkgsrc-2009Q4-base:1.3 pkgsrc-2008Q4:1.3.0.44 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.42 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.40 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.38 pkgsrc-2008Q2-base:1.3 pkgsrc-2008Q1:1.3.0.36 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.34 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.32 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.30 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.28 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.26 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.24 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.22 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.20 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.18 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.16 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.14 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.3.0.12 pkgsrc-2005Q1-base:1.3 pkgsrc-2004Q4:1.3.0.10 pkgsrc-2004Q4-base:1.3 pkgsrc-2004Q3:1.3.0.8 pkgsrc-2004Q3-base:1.3 pkgsrc-2004Q2:1.3.0.6 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.3.0.4 pkgsrc-2004Q1-base:1.3 pkgsrc-2003Q4:1.3.0.2 pkgsrc-2003Q4-base:1.3 buildlink2:1.2.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.2 netbsd-1-5-PATCH001:1.2 netbsd-1-5-RELEASE:1.1.1.1 netbsd-1-4-PATCH003:1.1.1.1 netbsd-1-4-PATCH002:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.3 date 2002.05.31.15.37.03; author seb; state dead; branches; next 1.2; 1.2 date 2000.11.09.03.52.51; author itohy; state Exp; branches 1.2.2.1; next 1.1; 1.1 date 99.12.24.03.19.23; author itohy; state Exp; branches 1.1.1.1; next ; 1.2.2.1 date 2002.06.23.18.49.50; author jlam; state dead; branches; next ; 1.1.1.1 date 99.12.24.03.19.23; author itohy; state Exp; branches; next ; desc @@ 1.3 log @Remove all package and category files from the japanese category. This effectively retire the japanese category. @ text @$NetBSD: patch-ag,v 1.2 2000/11/09 03:52:51 itohy Exp $ --- jisyo-tools/skkdic-expr.c.orig Tue Dec 17 14:51:28 1996 +++ jisyo-tools/skkdic-expr.c Mon Nov 6 01:34:22 2000 @@@@ -78,59 +78,86 @@@@ } } +#if !defined(dbm_pagfno) || defined(DBM_SUFFIX) +#define NEW_DB +#endif + /* 作業用データベースファイルを削除 file_name には content が格納される */ static void db_remove_files() { - char pag_name[256]; - char dir_name[256]; + char db_name[256]; db_remove_file(file_name); - sprintf(pag_name, "%s.pag", file_name); - db_remove_file(pag_name); - sprintf(dir_name, "%s.dir", file_name); - db_remove_file(dir_name); +#ifdef NEW_DB + sprintf(db_name, "%s.db", file_name); + db_remove_file(db_name); +#else + sprintf(db_name, "%s.pag", file_name); + db_remove_file(db_name); + sprintf(db_name, "%s.dir", file_name); + db_remove_file(db_name); +#endif if (okurigana_flag) { db_remove_file(okuri_head_name); - sprintf(pag_name, "%s.pag", okuri_head_name); - db_remove_file(pag_name); - sprintf(dir_name, "%s.dir", okuri_head_name); - db_remove_file(dir_name); +#ifdef NEW_DB + sprintf(db_name, "%s.db", okuri_head_name); + db_remove_file(db_name); +#else + sprintf(db_name, "%s.pag", okuri_head_name); + db_remove_file(db_name); + sprintf(db_name, "%s.dir", okuri_head_name); + db_remove_file(db_name); +#endif db_remove_file(okuri_tail_name); - sprintf(pag_name, "%s.pag", okuri_tail_name); - db_remove_file(pag_name); - sprintf(dir_name, "%s.dir", okuri_tail_name); - db_remove_file(dir_name); +#ifdef NEW_DB + sprintf(db_name, "%s.db", okuri_tail_name); + db_remove_file(db_name); +#else + sprintf(db_name, "%s.pag", okuri_tail_name); + db_remove_file(db_name); + sprintf(db_name, "%s.dir", okuri_tail_name); + db_remove_file(db_name); +#endif } } +#ifndef O_EXCL +#define O_EXCL 0 +#endif + /* データベースファイルを作成 */ -static void db_make_files() +static void db_make_files(tmpdir) + char *tmpdir; { - sprintf(file_name, "/tmp/skkjisyo.%d", getpid()); + int pid = getpid(); + int fd; + + sprintf(file_name, "%s/skkjisyo.%d", tmpdir, pid); if (okurigana_flag) { - sprintf(okuri_head_name, "/tmp/skkhead.%d", getpid()); - sprintf(okuri_tail_name, "/tmp/skktail.%d", getpid()); + sprintf(okuri_head_name, "%s/skkhead.%d", tmpdir, pid); + sprintf(okuri_tail_name, "%s/skktail.%d", tmpdir, pid); } db_remove_files(); - if ((db = dbm_open(file_name, O_RDWR|O_CREAT, 0600)) == NULL){ + if ((db = dbm_open(file_name, O_RDWR|O_CREAT|O_EXCL, 0600)) == NULL){ perror(file_name); exit(1); } - if ((dbcontent = fopen(file_name, "w+")) == NULL){ + if ((fd = open(file_name, O_RDWR|O_CREAT|O_EXCL, 0600)) < 0 || + (dbcontent = fdopen(fd, "w+")) == NULL){ perror(file_name); exit(1); } if (okurigana_flag) { - if ((okuriheaddb = dbm_open(okuri_head_name, O_RDWR|O_CREAT, 0600)) + if ((okuriheaddb = dbm_open(okuri_head_name, O_RDWR|O_CREAT|O_EXCL, 0600)) == NULL){ perror(okuri_head_name); exit(1); } - if ((okuritaildb = dbm_open(okuri_tail_name, O_RDWR|O_CREAT, 0600)) + if ((okuritaildb = dbm_open(okuri_tail_name, O_RDWR|O_CREAT|O_EXCL, 0600)) == NULL){ perror(okuri_tail_name); exit(1); @@@@ -698,7 +725,7 @@@@ for (key = dbm_firstkey(db); key.dptr != NULL; key = dbm_nextkey(db)) { content = dbm_fetch(db, key); for(i = 0; i < key.dsize; ++ i) - putc((key.dptr)[i], output); + putc(((char *) key.dptr)[i], output); putc(' ', output); fseek(dbcontent, getpos(content.dptr), 0); db_gets(kanji, BLEN, dbcontent); @@@@ -716,7 +743,7 @@@@ if (entry.dptr != NULL) continue; for(i = 0; i < key.dsize; ++ i) - putc((key.dptr)[i], output); + putc(((char *) key.dptr)[i], output); putc(' ', output); putc('/', output); okuri_type_out(&key, output); @@@@ -775,9 +802,8 @@@@ exit(1); } - sprintf(file_name, "%s/skkjisyo.%d", tmpdir, getpid()); set_signal_handler(); - db_make_files(); + db_make_files(tmpdir); negate = 0; for (; i < argc; ++ i) { @ 1.2 log @skkserv: IPv6 support. More reliable dictionary re-reading. Avoid copying fd_set. getuid() -> geteuid() Update version to 3.9.4nb1. skkdic-expr: Safer temporary file handling against symlink attack (O_EXCL). @ text @d1 1 a1 1 $NetBSD: patch-ag,v 1.1.1.1 1999/12/24 03:19:23 itohy Exp $ @ 1.2.2.1 log @Merge from pkgsrc-current to buildlink2 branch. @ text @d1 1 a1 1 $NetBSD: patch-ag,v 1.2 2000/11/09 03:52:51 itohy Exp $ @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ d4 2 a5 2 +++ jisyo-tools/skkdic-expr.c Tue Dec 21 20:37:29 1999 @@@@ -78,41 +78,62 @@@@ d69 4 d80 1 d91 24 a114 1 @@@@ -698,7 +719,7 @@@@ d123 1 a123 1 @@@@ -716,7 +737,7 @@@@ d132 1 a132 1 @@@@ -775,9 +796,8 @@@@ @ 1.1.1.1 log @Dictionary server for Simple Kana-Kanji conversion programs. This pkg is composed of: - skkserv-3.9.4 (from SKK-9.6), - SKK dictionary, and - dictionary manipulation tools. @ text @@