YANO's digital garage

Copyright ©YANO All rights reserved. https://www.bravotouring.com/~yano/

Last-modified: 2024-04-17 (水)


[一語一絵/IT系]

ウェブメーラーの巻 / 2005-01-03 (月)

perlソースとhtmlファイルをEUCからUTF-8に変換しただけだとやはりダメ。selinuxのお約束enforcingモードをpermissiveモードに切り替えて動作確認したところ、日本語は化け化けだが取り敢えず動く事は動いたようなのでOK。

というわけで、いつものように "audit2allow -d -l" の出力をポリシーに追加。その結果 /etc/selinux/targeted/src/policy/domains/program/apache.te の追加分(累計)は

allow httpd_suexec_t user_home_dir_t:dir search;
allow httpd_suexec_t user_home_t:dir { getattr search };
allow httpd_suexec_t user_home_t:file { execute execute_no_trans getattr ioctl read };
allow httpd_sys_script_t devpts_t:chr_file { read write };
allow httpd_sys_script_t httpd_sys_script_exec_t:dir { read add_name remove_name write };
allow httpd_sys_script_t httpd_sys_script_exec_t:file { create unlink write };
allow httpd_sys_script_t httpd_sys_script_exec_t:lnk_file read;
allow httpd_sys_script_t var_t:dir { add_name remove_name write };
allow httpd_sys_script_t var_t:fifo_file write;
allow httpd_sys_script_t var_t:file { create execute execute_no_trans getattr link read unlink write };
allow httpd_t httpd_sys_script_exec_t:lnk_file read;
allow httpd_t user_home_t:dir { getattr search };
allow httpd_t user_home_t:file { getattr read };
のようになった。

さて漢字化けの調査、ていうかUTF-8エンコードの問題である事は間違い無いので、jcode.pl を流し読み。こちらもUTF-8非対応の気配が濃厚なので、代替バージョンを探したところ [External]Jcode.pm ならUTFに対応しているという事なので、perl CPAN モジュールを起動して [External]Jcode.pm をインストール

[yano@nx9030 ~]$ sudo perl -MCPAN -e shell
cpan> install Jcode
cpan> q

続いて全perlソースの

require 'jcode.pl';
$charset = &jcode::getcode(\'漢字');
use Jcode;
$charset = &Jcode::getcode(\'漢字');
と変更して万事OK。

【参照】
●Akihiko Takeda's Homepage http://www.ai.is.saga-u.ac.jp/~takeda/
┗ウェブメーラー http://www.ai.is.saga-u.ac.jp/~takeda/software.phtml
●jcode.pl official page http://www.srekcah.org/jcode/
●オープンラボラトリ http://openlab.jp/
┗Jcode.pm - jcode.pl の後継 http://openlab.jp/Jcode/index-j.html