おおさとです。
> From: Wan Shigyoku <wanshi_vspec@xxxxxxxxx>
> Subject: [vine-users:059806] Re: 属性変更しても外部から見える
> Date: Sun, 20 Apr 2003 00:18:57 +0900
> 問題は上に書いているように、Apacheを動かすUser,GroupIDとファイル所有者の
> User,Groupが等しくないと、cgi の属性を711 にすると動かないということです。
> (ちなみに等しくすると、cgi が711で動作することは確認しています)
やりたいことが、いまひとつ具体的に見えないのですが、引っかかっ
ているのは、このような問題でしょうか?
CGI とか apache とかの話はひとまず置いといて。
[実験]おなじみの hello,world です。
$ cat hello.c
#include <stdio.h>
int main(void)
{
printf("%s\n", "hello, world.");
return 0;
}
$ cc hello.c -o hello
$ ./hello
hello, world.
$ chmod 111 hello
$ ./hello
hello, world.
というように、実行属性だけで動きます。
では、つぎに perl 版。
$ cat hello.pl
#! /usr/bin/perl
print "hello, wirld.\n";
$ ./hello.pl
hello, wirld.
$ chmod 111 hello.pl
$ ./hello.pl
Can't open perl script "./hello.pl": 許可がありません
というように、読み取り属性を取ると動きません。
perl に限りませんが、 #! interpreter と書かれた実行 script は
まず、interpreter が起動され、その interpreter が script file
を読みこんで実行します。(この動作に関しては man bash など)
したがって、script file には interpreter が実行されるユーザに
対する読み取り属性は必須です。
--
4月19日17時29分更新のYAHOO!Weatherによると --
東京23区の本日の花粉はやや多いです。明日の花粉は少ないです。
kazz@xxxxxxxxxxxxxx / 大里和朗