Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: tcpwrap_check - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Tidy関数" width="11" height="7"/> <TCP ラッパ関数(TCP Wrappers)
Last updated: Mon, 05 Feb 2007

view this page in

tcpwrap_check

(PECL)

tcpwrap_check — tcpwrap のチェックを実行する

説明

bool tcpwrap_check ( string daemon, string address [, string user [, bool nodns]] )

この関数は /etc/hosts.allow および /etc/hosts.deny の内容をもとに、あるクライアントが daemon サービスへのアクセスを許可されているか 否かを調べます。

パラメータ

daemon

サービスの名前。

address

クライアントのリモートアドレス。IP アドレスあるいはドメイン名の どちらでも指定可能。

user

ユーザ名(オプション)。

nodns

address がドメイン名の場合、それを IP アドレスに名前解決するために DNS が使用されます。 nodnsTRUE に指定すると、この処理を 禁止します。

返り値

アクセスが許可されている場合に TRUE 、それ以外の場合に FALSE を返します。

例 2352. ローカルホストからの全接続を拒否する

/etc/hosts.deny ファイルに以下の行が含まれており、


php: 127.0.0.1

   

以下のようなコードを実行する

<?php
if (!tcpwrap_check('php', $_SERVER['REMOTE_ADDR'])) {
  die(
'You are not welcome here');
}
?>

参考

詳細な情報は、hosts_access(3) の man ページを参照ください。



add a note add a note User Contributed Notes
tcpwrap_check
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites