[Mew-dist 11983] Re: im-133 y2k bugfix (Fw: [Kondara-devel:01032])

Koga Youichirou y-koga at example.com
2000年 1月 4日 (火) 21:35:29 JST


Hidetomo Hosono <h at example.com>:
> 当初問題にしていた部分は、
> ----------------------------------------------------------------------
>     ## RFC822 しか守っていない MUA からのメッセージの Date: フィールドは

ちなみに、RFC 1123 も draft-ietf-drums-msg-fmt-07.txt も 2桁を許して
います。

>     ## 年を2桁で表すので、50未満なら2000を足したものと、
>     ## 50以上で100以下であれば1900を足したものとみなす。
>     ## Date: フィールドのないメッセージに関しては
>     ## 処理が終わっているのでチェックにもはやひっかからない。
>     if ($year < 50) {
> 	$year += 2000;
>     } elsif ($year < 100) {
> 	$year += 1900;
>     }
>     ## ここでいかなる場合でもメッセージの年の4桁化が終了。
> ----------------------------------------------------------------------
> あまり正確ではないのですが、私はこう理解しています。

SAITO Tetsuya (さいとてつや) <saito at example.com>:
> ここの処理にひっかかります.1 桁の年を通すようなパッチ([Mew-dist
> 11960])を当てていれば,ここでの処理もうまくいきますが,それでも 3 桁
> の場合はそのまま抜けてしまいます.
> 
> もちろん 1 桁だとか 3 桁の年を Date: に入れる方が悪いと思うのですが,
> 私が判断することでもないので,この部分はかずさんにまかせます(^^;).

3桁については、draft-ietf-drums-msg-fmt-07.txt の処理を採用するのがい
いかな?

4.3. Obsolete Date and Time

The syntax for the obsolete date format allows a 2 digit year in the 
date field and allows for a list of alphabetic time zone specifications 
that were used in earlier versions of this standard. It also permits 
comments and folding white space between many of the tokens.
… さくっと略 …
Where a two or three digit year occurs in a date, the year is to be 
interpreted as follows: If a two digit year is encountered whose value 
is between 00 and 49, the year is interpreted by adding 2000, ending up 
with a value between 2000 and 2049. If a two digit year is encountered 
with a value between 50 and 99, or any three digit year is encountered, 
the year is interpreted by adding 1900.

これにしたがうならば、

    } elsif ($year < 100) {

ではなく、

    } elsif ($year < 1000) {

とするのがよさそうですね。
----
こがよういちろう
#1桁も 00-49 と同様に扱っても、利用者が困ることはないような気がする。



Mew-dist メーリングリストの案内