1 .\" $NetBSD: rcmd.3,v 1.9 1996/05/28 02:07:39 mrg Exp $
3 .\" Copyright (c) 1983, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\" must display the following acknowledgement:
16 .\" This product includes software developed by the University of
17 .\" California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" @(#)rcmd.3 8.1 (Berkeley) 6/4/93
36 .\" Contributed as Linux man page by David A. Holland, 970908
37 .\" I have not checked whether the Linux situation is exactly the same.
39 .\" 2007-12-08, mtk, Converted from mdoc to man macros
42 .\" Japanese Version Copyright (c) 1999 NAKANO Takeo all rights reserved.
43 .\" Translated Mon Mar 1 1999 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
45 .\"WORD: standard name (ホストの) 標準名
46 .\"WORD: regular file 通常ファイル
48 .TH RCMD 3 2007-12-28 "Linux" "Linux Programmer's Manual"
50 rcmd, rresvport, iruserok, ruserok \- リモートコマンドにストリームを返す関数群
53 .B #include <netdb.h> \ \ \fP/* Or <unistd.h> on some systems */
55 .BI "int rcmd(char **" ahost ", int " inport ", const char *" locuser ", "
56 .BI " const char *" remuser ", const char *" cmd ", int *" fd2p );
58 .BI "int rresvport(int *" port );
60 .BI "int iruserok(uint32_t " raddr ", int " superuser ", "
61 .BI " const char *" ruser ", const char *" luser );
63 .BI "int ruserok(const char *" rhost ", int " superuser ", "
64 .BI " const char *" ruser ", const char *" luser );
69 .RB ( feature_test_macros (7)
79 関数は、スーパーユーザーがリモートマシンでコマンドを実行するために
80 用いられる。このとき特権ポート番号をもとにした認証スキームが
83 関数は、特権ポート空間のアドレスを持つソケットの
90 でサービス要求を行ったクライアントの認証を行うために
92 以上の 4 つの関数は、すべて同じファイルに記述されており、
94 サーバーによって (他の関数とともに) 利用される。
101 の参照を行う。ホストが存在しない場合は \-1 を返す。
104 にホストの標準名 (standard name) をセットして、
109 接続に成功したら、インターネットドメインに存在するタイプ
118 がゼロでない場合は、制御プロセスへの接続がもう一つ用意され、
122 制御プロセスはリモートコマンドからの標準エラー出力 (unit 2) を
124 また制御プロセスはこの接続から受け取ったバイトデータを
125 UNIX シグナルの番号として扱い、リモートコマンドのプロセス
132 と一緒にまとめられる。またこの場合はリモートプロセスへ
134 ただし帯域外 (out-of-band) データを用いれば、
135 リモートプロセスの注意を引くことはできるかもしれない。
142 関数は特権アドレスにバインドされたソケットを取得するために用いられる。
145 などの関数での利用に適している。インターネットポートの特権ポートは、
146 0 から 1023 の範囲である。スーパーユーザーだけがこれらのアドレスを
152 関数は、まず以下の引数を取る: リモートホスト
156 はホスト名で指定)、 2 つのユーザー名、ローカルユーザーの名前が
157 スーパーユーザーのものであるかどうかを示すフラグ、である。
158 もしユーザーが\fBスーパーユーザーではない\fP場合は、これらの関数は
160 ファイルをチェックする。ファイルが見つからなかったり、
162 ローカルユーザーのホームディレクトリにある
164 ファイルをチェックして、サービス要求が許可されているかどうか調べる。
167 通常ファイル (regular file) ではなかったり、
168 指定ユーザーまたはスーパーユーザー以外の所有だったり、
169 所有者以外から書き込み可能だったりした場合には、
176 ファイルに書かれていた場合には 0 が返される。
182 .RB ( gethostname (2)
183 によって取得される) ローカルドメインがリモートのドメインと同じ場合は、
186 リモートホストの IP アドレスがわかっている場合は、
189 .BR iruserok () を用いる方が良いだろう。
191 はリモートホストの所属するドメインの DNS サーバーが信頼できなくても
195 関数は成功すると有効なソケットディスクリプターを返す。
196 失敗すると \-1 を返し、標準エラー出力に診断メッセージを
200 関数は、成功するとバインドされた有効なソケットディスクリプターを返す。
201 失敗すると \-1 を返し、グローバル変数
206 は、この関数においては「すべてのネットワークポートが使用中」
210 BSD 系、Solaris や他の多くのシステムに存在する。
211 これらの関数は 4.2BSD で登場した。
214 は glibc のヘッダでは宣言されていない。
215 .\" Bug filed 25 Nov 2007:
216 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=5399