.\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)rexec.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD: src/lib/libcompat/4.3/rexec.3,v 1.12 2004/07/02 23:52:14 ru Exp $ .\" .\" Taken from FreeBSD 5.4; not checked against Linux reality (mtk) .\" .\" 2007-12-08, mtk, Converted from mdoc to man macros .\" .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved. .\" Translated 2005-11-20, Akihiro MOTOKI .\" .TH REXEC 3 2010-09-10 "Linux" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O rexec \- return stream to a remote command rexec \- リモートコマンドへのストリームを返す .\"O .SH SYNOPSIS .SH 書式 .nf .\"O .BR "#define _BSD_SOURCE" " /* See feature_test_macros(7) */" .BR "#define _BSD_SOURCE" " /* feature_test_macros(7) 参照 */" .B #include .sp .BI "int rexec(char **" ahost ", int " inport ", char *" user ", " .BI " char *" passwd ", char *" cmd ", int *" fd2p ); .fi .\"O .SH DESCRIPTION .SH 説明 .\"O This interface is obsoleted by .\"O .BR rcmd (3). このインタフェースは .BR rcmd (3) によって置き換えられた。 .\"O The .\"O .BR rexec () .\"O function .\"O looks up the host .\"O .IR *ahost .\"O using .\"O .BR gethostbyname (3), .\"O returning \-1 if the host does not exist. .\"O Otherwise .\"O .IR *ahost .\"O is set to the standard name of the host. .\"O If a username and password are both specified, then these .\"O are used to authenticate to the foreign host; otherwise .\"O the environment and then the user's .\"O .I .netrc .\"O file in his .\"O home directory are searched for appropriate information. .\"O If all this fails, the user is prompted for the information. .BR rexec () 関数は .BR gethostbyname (3) を使ってホスト .I *ahost を探す。ホストが存在しない場合は \-1 を返し、それ以外の場合には .I *ahost にそのホストの標準的な名前を設定する。 ユーザ名とパスワードの両方が指定された場合には、これらは 接続先のホストへの認証に利用される。そうでない場合には、 適切な情報を入手するために、環境変数と、そのユーザの ホームディレクトリの .I .netrc ファイルが検索される。情報が見つからなかった時には、 ユーザに対して情報を入力するプロンプトが表示される。 .PP .\"O The port .\"O .I inport .\"O specifies which well-known DARPA Internet port to use for .\"O the connection; the call .\"O .I "getservbyname(""exec"", ""tcp"")" .\"O (see .\"O .BR getservent (3)) .\"O will return a pointer to a structure, which contains the necessary port. .\"O The protocol for connection is described in detail in .\"O .BR rexecd (8). ポート .I inport には、接続に使用する DARPA Internet の well-known ポートを指定する。 .I "getservbyname(""exec"", ""tcp"")" を呼び出すと構造体へのポインタが返され .RB ( getservent (3) 参照)、この構造体には必要なポートが入っている。 接続に使用されるプロトコルについての詳細は .BR rexecd (8) に書かれている (訳注: 現在のところ存在しない)。 .PP .\"O If the connection succeeds, .\"O a socket in the Internet domain of type .\"O .BR SOCK_STREAM .\"O is returned to .\"O the caller, and given to the remote command as .\"O .IR stdin .\"O and .\"O .IR stdout . .\"O If .\"O .I fd2p .\"O is nonzero, then an auxiliary channel to a control .\"O process will be setup, and a descriptor for it will be placed .\"O in .\"O .IR *fd2p . 接続に成功すると、インターネットドメインの .B SOCK_STREAM 型のソケットが返され、そのソケットはリモートコマンドの 標準入力および標準出力となる。 .I fd2p が 0 以外の場合、制御プロセスへの補助チャンネルがセットアップされ、 補助チャンネルのディスクリプタが .I *fd2p に書かれる。 .\"O The control process will return diagnostic .\"O output from the command (unit 2) on this channel, and will also .\"O accept bytes on this channel as being UNIX signal numbers, to be .\"O forwarded to the process group of the command. .\"O The diagnostic .\"O information returned does not include remote authorization failure, .\"O as the secondary connection is set up after authorization has been .\"O verified. 制御プロセスはコマンドからの診断メッセージ出力 (ファイルディスクリプタ 2) をこのチャンネルで返す。また、このチャンネル経由で UNIX のシグナル番号を示すバイトを受信する。受信したシグナルは コマンドが属すプロセスグループに転送される。 診断情報にはリモートの認証失敗は含まれない。なぜなら、認証の確認が行われた 後で補助チャンネルの接続はセットアップされるからである。 .\"O If .\"O .I fd2p .\"O is 0, then the .\"O .IR stderr .\"O (unit 2 of the remote .\"O command) will be made the same as the .\"O .IR stdout .\"O and no .\"O provision is made for sending arbitrary signals to the remote process, .\"O although you may be able to get its attention by using out-of-band data. .I fd2p が 0 の場合、標準エラー (リモートコマンドのファイルディスクリプタ 2) は 標準出力と同様に扱われ、リモートプロセスに任意のシグナルを送るための 手段は提供されない。但し、リモートプロセスに対してトリガをかけるために、 帯域外データ (out-of-band data) を使うことはできる。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O Not in POSIX.1-2001. .\"O Present on the BSDs, Solaris, and many other systems. POSIX.1-2001 にはない。 BSD 系、Solaris や他の多くのシステムに存在する。 .\"O The .\"O .BR rexec () .\"O function appeared in .\"O 4.2BSD. .BR rexec () 関数は 4.2BSD で始めて登場した。 .\"O .SH BUGS .SH バグ .\"O The .\"O .BR rexec () .\"O function sends the unencrypted password across the network. .BR rexec () 関数はネットワークに暗号化されていないパスワードを送信する。 .PP .\"O The underlying service is considered a big security hole and therefore .\"O not enabled on many sites, see .\"O .BR rexecd (8) .\"O for explanations. 基礎的なサービスにおいては大きなセキュリティホールと考えられるため、 多くのサイトで無効になっている。詳細は .BR rexecd (8) を参照。 .\"O .SH SEE ALSO .SH 関連項目 .BR rcmd (3), .BR rexecd (8)