[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
[webdav-jp:0623] Re: Apache2 WebDAV エンコード操作
吉山です。
とりあえず、http://www.debian.or.jp/~yosshy/ に必要なファイルを置きま
した。御賞味下さい。
なお、011_path_iconv は 010_diskquota 適用を前提に作ってあります(機能
上は必要ではありません)。どうしても 010_diskquota を使わずに
011_path_iconv を使用したい場合は手でパッチの内容をソースに反映して下さ
い。
---
010_diskquota.gz … Apache 2.0.43 用 Disk Quota パッチ
diskquota.txt … ↑の簡単な説明(添付ファイル)
chown_user.c.gz … ↑が呼び出すツールのソース
011_path_iconv.gz … Apache 2.0.43 用ファイルシステム上のパスのエンコード変換パッチ
path_iconv.txt … ↑の簡単な説明(添付ファイル)
012_escape_amp.gz … Apache WebDAV を IE でアクセスする際、パス名で問題となる '&' の対処パッチ
--
吉山あきら <yosshy@xxxxxxxxxxxx>
On Wed, 27 Nov 2002 23:44:57 +0900
Akira YOSHIYAMA <yosshy@xxxxxxxxxxxx> wrote:
>
> 吉山です。
>
> 最近 Apache 2.0.43 で色々 hack してみました。
>
> ・一般ユーザ権限で Apache を動作させながら、ファイルシステムの Quota 機
> 能を使えるようにするパッチ
>
> ・Apache 1.3 系と同様、ファイル名に日本語 EUC やシフト JIS 等を使えるよ
> うにしたパッチ + autoindex の長いファイル名/ディレクトリ名を途中で切っ
> た部分が文字化けしないようにするパッチ
>
> ・IE + Apache の組合せにおいて、WebDAV のパスで '&' が問題なく使えるよう
> にするパッチ
>
> ML に流すにはそれなりに量があるのでまだ流していませんが、興味のある方
> はおられますか?
>
> --
> 吉山あきら <yosshy@xxxxxxxxxxxx>
>
Apache WebDAV (mod_dav_fs) Disk Quota ?p?b?`
?g?R? ?«?ç <yosshy@xxxxxxxxxxxx>
2002/12/01
?¡?Ü?¦?ª?«
ISP ?Å?ñ???³?ê?é?P???[?U???½?è?Ì?f?B?X?N?e?Ê?Ì?§?À?Í?Ê?í?ADisk Quota
?Æ?Ä?Î?ê?é OS ?Ì?@?\?ð?p?¢?Ä?À?»?³?ê?Ä?¢?Ü?·?B?±?ê?Í?P?Â?Ì?¯?¶?A?J?E??
?g?ª???L?Ò?Å? ?é?t?@?C???^?f?B???N?g???Ì???Ê?ð?ê?è?Ê?É?§?À?·?é?@?\?Å?A
Solaris ?â HP-UX ?È?Ç?Ì?¤?p OS ?Í?à?¿?ë?ñ?ALinux ?â *BSD ?È?Ç?Ì?t???[
OS ?É?à?W???Å?p?Ó?³?ê?Ä?¢?Ü?·?B
FTP ?Å?t?@?C???ð?T?[?o?É?A?b?v???[?h?·?é?Û?A?Ê?í?Í?T?[?r?X?ð?ñ???·?é
FTP ?f?[?????ª root ? ?À?Å?®?ì?µ?Ä?¨?è?A?K?v?É???¶?Ä???O?C???µ?½?ê?Ê?A
?J?E???g?Ì? ?À?É?Ú?s?µ?Ä?t?@?C???^?f?B???N?g???ð?ì?¬?µ?Ü?·?B?±?Ì?½?ß?A
?ì?¬?³?ê?½?t?@?C???^?f?B???N?g???Ì???L?Ò?Í???O?C???µ?½?A?J?E???g?É?È?è
?Ü?·?B
?Æ?±?ë?ª?AApache ?Í?Z?L?????e?B?ã?Ì???R?É?æ?è?Aroot ? ?À?Å?Ì?®?ì?ð??
?§?µ?Ä?¢?Ü?¹?ñ?B?±?Ì?½?ß?AApache ?Í?Ê?í?A?ê?p?Ì?ê?Ê?A?J?E???g?â nobody
?A?J?E???g?Å?®?ì?·?é?æ?¤?Ý?è?³?ê?Ü?·?B?±?Ì?½?ß?AApache WebDAV ?Å?ì?¬?³
?ê?½?t?@?C???Ì???L?Ò?E?O???[?v?Í Apache ?Ì?®?ì?A?J?E???g?É?È?è?A?Á?è?Ì
???[?U?A?J?E???g?É???L?Ò?ð?Ï?X?Å?«?È?¢?Ì?Å?A???[?U?P?Ê?Å?Ì Disk Quota
?@?\?ª?g?¦?Ü?¹?ñ?B?±?Ì?â?è?Í ISP ?É?¨?¯?é WebDAV ?T?[?r?X?ñ???Ì?l?b?N
?Å? ?è?AApache ?É?æ?é WebDAV ?Ì???y?ð?W?°?é?ê?ö?Å? ?Á?½?Æ?l?¦?Ä?¢?Ü?·?B
?{?p?b?`?Í?AApache WebDAV ?ª?V?µ??t?@?C???^?f?B???N?g???ð?ì?¬?E?Ú?®
?·?é?Û?A?Á?ê?È?R?}???h?ð?Ä?Ñ?o?·???Å?AApache ?ð?ê?Ê?A?J?E???g? ?À?Å?®
?ì?³?¹?È?ª?ç Disk Quota ?@?\?ð?L?ø?É?·?é?½?ß?Ì?à?Ì?Å?·?B
?¡?{?p?b?`?Ì?í?ª
?{?p?b?`?ð?K?p?µ?½ Apache ?Í?A?t?@?C???^?f?B???N?g???Ì?ì?¬?^?Ú?®???É?A
?Â?\?È?À?è?À?S?É?z?¶?µ?½?Á?ê?È?c?[??(chown_user)?ð?À?s?µ?Ü?·?B?±?Ì?c?[
???Í setuid ?³?ê?Ä?¨?è?A?ø???Å?w?è?³?ê?½?t?@?C???^?f?B???N?g???Ì?p?[?~?b
?V?????ð
???L?Ò?FApache ?Ì?®?ì???[?U ?¨ ?»?f?B???N?g???Ì???L?Ò (rw)
?O???[?v?FApache ?Ì?®?ì?O???[?v(r/rw ?¨ rw)
?»?Ì?¼?F(r ?È?¢?µ?½?à?È?µ)
(?f?B???N?g???Í?±?ê?É x ?ª?ü?Á?½?à?Ì)
?É?Ï?X?µ?Ü?·?B
?Ê?í?A?P?Â?Ì?A?J?E???g?p?Ì?f?B???N?g???É???L?Ò?ª?Ê?A?J?E???g?Ì?t?@?C
???ð?u??K?v?Í?Ù?Æ?ñ?Ç? ?è?Ü?¹?ñ?B?æ?Á?Ä?A?t?@?C???^?f?B???N?g???Ì?ì?¬
???É?A?»?ê?ª?u?©?ê?é?f?B???N?g???Ì???L?Ò?Æ?¯?¶???L?Ò?É?Ï?X?·?é?æ?¤?É?µ
?Ä?µ?Ü?¦?Î?A?P???[?U?Ì?f?B???N?g???z?º?Ì?t?@?C???^?f?B???N?g???Í?S?Ä?¯
?¶???L?Ò?ð???Â?±?Æ?É?È?è?Ü?·?B?±?ê?É?æ?è Disk Quota ?ð?À?»?µ?Ü?·?B
?±?±?Å???Ó?·?×?«???ª? ?è?Ü?·?B?t?@?C???^?f?B???N?g???ð???ì?Å?«?é?A?J
?E???g?ð?A?»?Ì???L?Ò?Æ Apache ?¾?¯?É?§?À?·?é?½?ß?É?A?ê?Ê???[?U?ð
Apache ?Ì?®?ì?O???[?v?É?o?^?µ?Ä?Í?¢?¯?Ü?¹?ñ?B
?¡?p?Ó?·?é?à?Ì
?EApache Web Server ver.2 (?Å?V?Í 2.0.43)
?Edisk quota ?p?b?` (010_diskquota.gz)
?Echown_user ?\?[?X(chown_user.c.gz)
?¡?\?z
1)Apache ?Ì?\?[?X?ð?W?J?µ?Ä?A010_diskquota ?p?b?`?ð???Ä?Ü?·?B
?±?Ì???A~httpd/srclib/apr/include/apr_file_diskquota.h ?Ì?Å???É? ?é
chown_user ?R?}???h?Ö?Ì?p?X?ð?A?C???X?g?[???µ?æ?¤?Æ?µ?Ä?¢?é?Â?«?É??
?í?¹?Ä?º?³?¢(?»?Ý?Ì?p?X"/usr/lib/apache2/chown_user" ?Í Debian ?Â?«
?É???í?¹?Ä? ?è?Ü?·)
FixMe: ?N?© suexec ?Æ?¯?l?É?p?X?ð?Ý?è?·?é?û?@?ð?³?¦?Ä?º?³?¢?B
2)Apache ?ð???Ê?É?C???X?g?[???µ?Ü?·
3)chown_user.c ?ð?C?³?µ?Ü?·?B?`?ª?Ì?è?`?Ì?¤?¿
#define ROOT_DIR "/var/www/dav" ?c dav ?t?H???_?Ì?g?b?v?f?B???N?g??
#define MAX_PATH_LEN 128 ?c ???ì?·?é?t?@?C???Ì?Å?å?t???p?X?·
#define APACHE_OWNER "www-data" ?c Apache ?Ì?®?ì?A?J?E???g
#define APACHE_GROUP "www-data" ?c Apache ?Ì?®?ì?O???[?v
#define MIN_UID 1000 ?c ???[?U?A?J?E???g?Ì?Å?¬?l
#define MAX_UID 9999 ?c ???[?U?A?J?E???g?Ì?Å?å?l
?ð?C?³?µ?Ü?·?B?K?Ø?É?Ý?è?µ?È?¢?Æ?À?ø?ã?Ù?í?I?¹?µ?Ü?·?B
4)chown_user.c ?ð?R???p?C???E?C???X?g?[???µ?Ü?·?B
# gcc -Wall -o chown_user chown_user.c
# chmod root.www-data chwon_user
# chown 4050 chown_user
# cp chown_user /usr/lib/apache2
"www-data" ?Ì???Í Apache ?Ì?®?ì?O???[?v?A"/usr/lib/apache2" ?Í 1)?Å
?w?è?µ?½?f?B???N?g???ð?w?è?µ?Ü?·?B
5)Apache ?Ì?Ý?è?t?@?C???ð?K?Ø?É?Ý?è?µ?ADAV ?ð?L?ø?É?µ?Ä?º?³?¢?B?Å?à?V
???v???È?w?è?Í?º?L?Ì?æ?¤?É?È?è?Ü?·?B
--- /var/www/dav ?ð WebDAV ?L?ø?É?·?é?Ý?è
DAVLockDB /var/lock/apache2/DAVLock
Alias /dav "/var/www/dav/"
<Location /dav>
DAV on
</Location>
---
6)Apache ?ð?N?®?µ?A?@?\?ð?m?F?µ?Ü?·?B
?¡chown_user ?R?}???h?Ì?Z?L?????e?B
chown_user ?Ì?g?¢?û?Í?º?L?Ì?Ê?è?Å?·?B
usage: chown_user <path of a file/directory>
chown_user ?R?}???h?Í?Å?«?é?¾?¯?À?S?È?ì?è?É?µ?½?Â?à?è?Å?·?B?º?L?Ì?ð
???`?F?b?N?ð?s?¢?A?ð???É???í?È?¢?ê???Í?G???[?I?¹?µ?Ü?·?B
?E?ê?è?·?È?ã?Ì?p?X?¼?ð???Û?µ?Ü?·(?o?b?t?@?I?[?o?t???[?Î?ô)?B
?E???Î?p?X?ð???Û?µ?Ü?·?B
?EROOT_DIR ?Å?w?è?µ?½?f?B???N?g???z?º?Å?È?¢?p?X?ð???Û?µ?Ü?·?B
?EROOT_DIR ?Å?w?è?µ?½?f?B???N?g???»?Ì?à?Ì?ð???Û?µ?Ü?·?B
?E?Ê?í?Ì?t?@?C???A?f?B???N?g???È?O?Ì?p?X?ð???Û?µ?Ü?·?B
?E?¡???Ì?n?[?h?????N?ð???Â?t?@?C???Ö?Ì?p?X?ð???Û?µ?Ü?·?B
?E".."?ð?Ü?Þ?p?X?ð???Û?µ?Ü?·?B
?E?V???{???b?N?????N?ð?Ü?Þ?p?X?ð???Û?µ?Ü?·?B
?E?J?????g?f?B???N?g???ª MIN_UID?AMAX_UID ?Å?w?è?³?ê?½?Í?Í?Ì UID ?ð??
?Â?p?X?ð???Û?µ?Ü?·?B
?EApache ?Ì?®?ì?O???[?v?Æ?Ù?È?é?O???[?v?ð???Â?p?X?ð???Û?µ?Ü?·?B
?È?¨?A?Ý?è?t?@?C???Ï?X?É?æ?é?N???b?L???O?ð?h?~?·?é?½?ß?Achown_user
?Í?Ý?è?t?@?C???ð?p?¢?¸?A?K?v?È?Ý?è?Í?S?Ä?R???p?C?????É?\?[?X?É???«???Þ
?æ?¤?É?µ?Ä? ?è?Ü?·?B
?¡?A?N?Z?X?§?À?É?Â?¢?Ä
Apache ?Ì?ê???A?P???É WebDAV ?p?É?e???[?U?Ì?f?B???N?g???É?Î?µ?Ä?A?N
?Z?X?§?À?ð?t?¯?é?Æ?A?t?@?C???{???Ì?Û?É?à?A?N?Z?X?§?À?ª??«?Ü?·?BLinux
?Ì?ê???A?Á?ê?È?}?E???g?I?v?V????(-o bind)?Å?Á?è?f?B???N?g???z?º?ð?Ê?Ì
?f?B???N?g???É?}?E???g?Å?«?é?Ì?Å?A?Ð?û?Å WebDAV ?p?É?A?N?Z?X?§?À?ð?t?¯?A
?à?¤?Ð?û?Å WWW ?p?É?A?N?Z?X?§?À?ð?µ?È?¢?æ?¤?Ý?è?·?é?û?@?ª? ?è?Ü?·?B
?¼?Ì OS ?Å?À?»?·?é?ê???Í?A?V???{???b?N?????N?ð???Â?·?é?æ?¤?É?Ý?è?µ?Ä
?ã?L?Æ?¯?l?É?·?é?©?AWebDAV ?p?Æ WWW ?p?Ì?Ý?è?t?@?C???ð?p?Ó?µ?A?|?[?g?Ô
???ð?ª?¯?Ä?Q?Â?Ì Apache ?ð?N?®?·?é???Å?â?è?ð?ñ?ð?·?é???ª?Å?«?Ü?·?B
?¡?Å?ã?É
?Ê?í?AApache ?ª?T?[?r?X?Æ?µ?Ä?N?®?³?ê?é?Û?A???O?p?â suexec ?p?É?g?b
?v?Ì apache ?v???Z?X?Í root ? ?À?Å?®?ì?µ?Ä?¢?Ü?·?B?Â?Ü?è?A?±?±?Å
chown_user ?????Ì?????ð?s?¤?æ?¤?É?Å?«?ê?Î?Asetuid ?³?ê?½ chown_user ?R
?}???h?ð?s?x?À?s?·?é?K?v?Í?È??È?è?Ü?·?B?»?ê?Ç?±?ë?©?Amod_dav_fs ?¾?¯
root ? ?À?Å?®?ì?³?¹?é???ª?Å?«?ê?Î?A?½?Ì?ê?J?à? ?è?Ü?¹?ñ?B
?±?¤?µ?½?p?b?`?ª?ì?ç?ê?Achown_user ?R?}???h?Ì?K?v?ª?³??È?é???ð?F?O
?µ?Ä?¨?è?Ü?·?B
Apache2 ?t?@?C???¼?^?f?B???N?g???¼?G???R?[?h?Ï?·?p?b?`
2002/12/01
?g?R? ?«?ç <yosshy@xxxxxxxxxxxx>
?¡?Í?¶?ß?É
???ú?Ì WWW ?Ì?d?l?É?Í URL ?Ì?G???R?[?h?É?Ö?·?é?K?è?ª? ?è?Ü?¹?ñ?Å?µ?½?B
?µ?©?µ?AWeb ?R???e???c?Ì?t?@?C???¼?ð ASCII ?É?·?é?Ì?ª?Ã?Ù?Ì?¹?ð?Å?µ?½
?Ì?Å?A?³?Ù?Ç?å?«?È?â?è?Í?N?±?è?Ü?¹?ñ?Å?µ?½?B
?µ?©?µ?A?z?[???y?[?W?ð?ì?¬?·?é???[?U?w?Ì?g?å?É?º?¢?A?p?X?¼?É?e???ê?Ì
?G???R?[?h?ð?g?p?·?é???[?U?ª?o?ê?µ?Ü?µ?½?B?X?É?AInternet Explorer ?â
MS Office ?É WebDAV ?N???C?A???g?@?\?ª???Ú?³?ê?é?Æ?A?p?X?¼?Ì?G???R?[?h
?â?è?Í?X?É?[???»?µ?Ü?µ?½?B
Apache ?É?¨?¢?Ä?A?±?Ì?â?è?ð?ð???·?é?Ì?ª IIJ ?R?c???ì?Ì mod_encoding
?p?b?`?Å?·?B?±?Ì?p?b?`?Í Web ?â WebDAV ?Ì?N???C?A???g?ð?»?Ê?µ?AURI ?ð
?w?è?µ?½?G???R?[?h?Ö?Ï?·?·?é?@?\?ð?ñ???µ?Ü?·?B
?µ?©?µ?A?±?Ì?p?b?`?ð?g?p?·?é?É? ?½?è?A?P?Â?â?è?ª? ?è?Ü?µ?½?B
Apache mod_dav ???W???[???Í WebDAV ???N?G?X?g?É?Î?·?é???X?|???X?ð
UTF-8 ?G???R?[?h?Æ?µ?Ä?Ô?µ?Ü?·?ª?A?³?X Apache ?Í?t?@?C???V?X?e???ã?Ì?t?@
?C???¼?^?f?B???N?g???¼?Ì?G???R?[?h?ð?ê?Ø?l?¶?µ?Ä?¨?ç?¸?A?»?Ì?Ü?Ü?§?ß?I
?É?????ð?s?¢?Ü?·?B?»?Ì?½?ß?Amod_encoding ?Å?w?è?·?é?Ï?·?æ?G???R?[?h?ð
UTF-8 ?È?O?É?·?é?Æ?s?³?È???X?|???X?É?È?Á?Ä?µ?Ü?¢?A?N???C?A???g?¤?Å?³?µ
?¢?????ª?s?¦?È??È?è?Ü?·?B
?{?p?b?`?Í?±?¤?µ?½?â?è?É?Î???·?×??Aiconv() ?Ö???ð???p?µ?Ä?t?@?C??
I/O ?Ì?O?ã?Å?t?@?C???¼?^?f?B???N?g???¼?ð?C?Ó?Ì?G???R?[?h?É?Ï?·?µ?Ü?·?B
UNIX ?n OS ?Ì?ê???Í?A?ú?{?ê?Ì?G???R?[?h?É EUC-JP ?ð?g?p?·?é?Æ?Ö???Å?·
?µ?AFTP ?T?[?o?Æ?µ?Ä Windows ?â Mac OS ?©?ç?A?N?Z?X?³?ê?é?Û?Í?V?t?g
JIS ?ð?g?p?·?é?Æ?Ö???Å?µ?å?¤?B
?Ü?½?A?{?? WebDAV ?p?É?ì?Á?½?p?b?`?Å?·?ª?AWeb ?u???E?Y?Å?f?B???N?g??
?Ì?à?e?ê???ð?\?¦?·?é autoindex ?p?b?`?É?à?F?X?Æ?è?ð?Á?¦?Ä? ?è?A?]???
?¶?µ?Ä?¢?½?¶???»?¯?ð?h?~?·?é?æ?¤?É?È?Á?Ä?¢?Ü?·?B
?¡?{?p?b?`?Ì?í?ª
Apache 2 ?ª?A?[?L?e?N?`???·?Ù?z?û???C?u???? libapr ?ð?o?R?µ?Ä file
I/O ?·?é?_?É???Ú?µ?Afile I/O ?Ì?V?X?e???R?[???ð?Ä?Ñ?o?·???ª?Ì?O?ã?É?G
???R?[?h?Ï?·???[?`???ð?ü?ê?Ä? ?è?Ü?·(?¾?í?Î?u???Û?Ï?·?v)?B
? ?¿?ç?±?¿?ç?Å?A?Á?Ê?È?p?b?`?³?µ?Å?à mod_encoding ?ð?g?Á?Ä?t?@?C???V
?X?e???¤?ðUTF-8 ?É?Ý?è?µ?Ä?®?¢?Ä?¢?½?À?Ñ?©?ç?AApache ?à???Ì?????ª
UTF-8?Å?â?è?È?¢???ª?ª?©?Á?Ä?¢?Ü?·?Ì?Å?A
Apache2 (?t?????g?G???h)
?ªmod_encoding (?ü?Í URI ?Ì?¶???ñ?Ï?·)
?ª?« ?c[UTF-8]
mod_dav (WebDAV ?v???g?R???????t?????g?G???h)
?ª?« ?c[UTF-8]
mod_dav_fs (?t?@?C???V?X?e???p WebDAV ?o?b?N?G???h)
?ª?« ?c[UTF-8]
libapr (?A?[?L?e?N?`???·?Ù?z?û???C??)
?ª?« ?c[?C?Ó?Ì?R?[?h]
?V?X?e???R?[??
?Æ?¢?¤?`?É?µ?Ä? ?è?Ü?·?B
?¡?g?¢?û
?{?p?b?`?Í?A?æ?É?ö?J?µ?Ä?¢?½ diskquota ?p?b?`?ð???Ä?½?ã?É?K?p?·?é?æ?¤
?É?ì?Á?Ä? ?è?Ü?·?B?»?¿?ç?ð?g?¢?½??È?¢?ê???Í?è?Å?p?b?`?ð???Ä?Ä?º?³?¢?B
1)Apache 2 ?Ì?\?[?X?ð?W?J?µ?Ü?·?B
2)diskquota ?p?b?`?A?{?p?b?`?Ì???Å?p?b?`?ð?K?p?µ?Ü?·?B
3)?t?@?C???¼?Ì?G???R?[?f?B???O?Í EUC-JP ???ß?Å?¿?É?È?Á?Ä?¢?Ü?·?B
?Ï?X?µ?½?¢?ê???Í ~httpd/srclib/apr/file_io/unix/path_iconv.h ?Ì
#define FS_ENCODE "EUC-JP"
?ð?D?«?É?Ï?X?µ?Ä?º?³?¢?B
4)?Ê?í?Ê?è Apache ?ð build ?µ?A?C???X?g?[???µ?Ü?·?B
?¡?§?À????
?E?Ý?è?t?@?C???Ì?p?X?¼?É?à?ú?{?ê?ð?g?¦?Ü?·?ª?A?Ý?è?t?@?C?????Ì?p?X?¼?Ì
?G???R?[?h?Í UTF-8 ?Å?È?¯?ê?Î?È?è?Ü?¹?ñ?B
?E?G???R?[?h?Ï?·?É iconv ?ð?g?p?µ?Ä?¢?Ü?·?ª?Aiconv_hook ?Ì?×?Ì?Á?Ê?È?z
?¶?Í?µ?Ä?¢?Ü?¹?ñ?B?K?v?È?ç?©?ª?Å hack ?µ?Ä?º?³?¢?B
?E?P?Â?Ì?p?X?¼?Ì?r???Å?G???R?[?f?B???O?ð?Ï?¦?é?±?Æ?Í?Å?«?Ü?¹?ñ?B
?E?¡???Ì?G???R?[?f?B???O?ð?¯???É?µ?¦?Ü?¹?ñ?B