[Momonga-devel.ja:00346] Re: card service doesn't read /etc/pcmcia/*.conf?


ほそのひでともです。

  To: devel.ja@xxxxxxxxxxxxxxxxx
  From: HOSONO Hidetomo <h@xxxxxxxx>
  Subject: [Momonga-devel.ja:00345] card service doesn't read /etc/pcmcia/*.conf?
  Date: Mon, 19 Aug 2002 10:51:12 +0900 (JST)
  
  > どうも、kernel-pcmcia-cs-3.2.0-3mになってから、/etc/pcmcia/config末尾の
  > 
  >   # Include configuration files for add-on drivers
  >   
  >   source ./*.conf
  > 
  > が効いていないように見えます。

諸悪の根源を見つけた気がします。
pcmcia-cs-3.1.34とpcmcia-cs-3.2.0の間で
cardmgr/lex_config.lの差分を取ってみたのですが、

  --- pcmcia-cs-3.1.34/cardmgr/lex_config.l	2002-05-16 14:51:04.000000000 +0900
  +++ pcmcia-cs-3.2.0/cardmgr/lex_config.l	2002-07-02 16:55:27.000000000 +0900
  ....
  @@ -64,7 +68,7 @@
   
   source		BEGIN(src); return SOURCE;
   <src>[ \t]*	/* skip */ ;
  -<src>[^ \t\n]+	do_source(yytext); BEGIN(INITIAL);
  +<src>[^\n]+	do_source(yytext); BEGIN(INITIAL);
   <<EOF>>		if (do_eof()) yyterminate();
   
   \n		current_lineno++;
  ....

って変更は正しくないような気がしています。

この変更(エンバグ?)のおかげで、/etc/pcmcia/config内の

  source ./*.conf

部分は、' ./*.conf'という文字列がglob()に渡り、展開できないので
get_glob()のfnに' ./*.conf'という文字列がそのまま渡り、1980行目の

  	s->file = fopen(fn, "r");

の部分でfopen()に失敗し、更に

  	if (s->file == NULL) {
  	    if (strpbrk(fn, "?*[") == NULL)
  		syslog(LOG_INFO, "could not open '%s': %m", fn);
  	    s->fileno++;

の部分ではstrpbrk(fn, "?*[")がNULLにならないので、
*何もsyslogに吐かずに素通りしている、ということです。
lex知らないので、まだ正解かどうかは分かりませんが…。

  To: devel.ja@xxxxxxxxxxxxxxxxx
  From: Takayuki Nakagawa <tnaka@xxxxxxxxxxxxx>
  Subject: [Momonga-devel.ja:00272] kernel-pcmcia-cs-3.2.0-2mでエラー
  Date: Thu, 01 Aug 2002 22:23:34 +0900 (JST)
  
  > HEADの kernel-pcmcia-cs-3.2.0-2m についてですが、
  > 私だけの問題とも思えないので報告します。
  > 
  >     cardmgr[1152]: could not open ' ./config.opts': No such file or directory
  > 
  > で、よく見ると、./config.optsの前に半角スペースが入っています。

も同根なんじゃないか、と思います。従って、

  To: devel.ja@xxxxxxxxxxxxxxxxx
  From: YAMAZAKI Makoto <uomaster@xxxxxxxxx>
  Subject: [Momonga-devel.ja:00273] Re: kernel-pcmcia-cs-3.2.0-2mでエラー
  Date: Fri, 2 Aug 2002 01:20:33 +0900
  
  > > で、よく見ると、./config.optsの前に半角スペースが入っています。
  > 
  > 報告ありがとうございます。
  > もともとは wordexp(3) を使うコードだったのですが、momonga(インストーラ)の都合で
  > glob(3) を使うように変更したために起こった問題のようです。
  > pcmcia-cs-cardmgr-no-wordexp.patch を修正して 3m として commit しました。

以下の対処では不十分のような気がしています。
たぶんpcmcia-csそのもののバグでしょう。

--
ほそのひでとも