⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rcmd.3x

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 3X
字号:
.\" SCCSID: @(#)rcmd.3x	8.1	9/11/90.TH rcmd 3x.SH Namercmd, rresvport, ruserok \- routines for returning a stream to a remote command.SH Syntax.nf.B "rem = rcmd(\fIahost, inport, locuser, remuser, cmd, fd2p\fP);".B char \fI**ahost\fP;.B u_short \fIinport\fP;.B "char \fI*locuser, *remuser, *cmd\fP;".B int \fI*fd2p\fP;.PP.B s = rresvport(\fIport)\fP;.B int \fI*port\fP;.PP.B "ruserok(\fIrhost, superuser, ruser, luser\fP)".B char \fI*rhost\fP;.B int \fIsuperuser\fP;.B char \fI*ruser, *luser\fP;.fi.SH Description.NXR "rcmd subroutine".NXR "rresvport subroutine".NXR "ruserok subroutine".NXAM "rmt program" "rcmd subroutine".NXR "stream" "returning to remote command"The.PN rcmdsubroutineis used by the superuser to execute a command ona remote machine using an authentication scheme basedon reserved port numbers.  The.PN rresvportsubroutineis a routine that returns a descriptor to a socketwith an address in the privileged port space.The.PN ruseroksubroutineis a routine used by serversto authenticate clients requesting service with.PN rcmd .All three functions are present in the same file and are usedby the.MS rshd 8c server (among others)..PPThe.PN rcmdsubroutine looks up the host.I *ahostusing.MS gethostbyname 3n ,returning \-1 if the host does not exist.For further information, see .MS gethostent 3n .Otherwise.I *ahostis set to the standard name of the hostand a connection is established to a serverresiding at the well-known Internet port.IR inport ..PPIf the call succeeds, a socket of type SOCK_STREAMis returned to the caller and given to the remotecommand as .B stdinand.B stdout.If.I fd2pis nonzero, then an auxiliary channel to a controlprocess will be set up, and a descriptor for it will be placedin.IR *fd2p .The control process will return diagnosticoutput from the command (unit 2) on this channel, and will alsoaccept bytes on this channel as being UNIX signal numbers, to beforwarded to the process group of the command.If.I fd2pis 0, then the .B stderr(unit 2 of the remotecommand) will be made the same as the .B stdoutand noprovision is made for sending arbitrary signals to the remote process,although you may be able to get its attention by using out-of-band data..PPThe protocol is described in detail in .MS rshd 8c ..PPThe.PN rresvportsubroutine is used to obtain a socket with a privilegedaddress bound to it.  This socket is suitable for useby .PN rcmdand several other routines.  Privileged addresses consistof a port in the range 0 to 1023.  Only the superuseris allowed to bind an address of this sort to a socket..PPThe.PN ruseroksubroutine takes a remote host's name, as returned by a.MS gethostent 3n routine, two user names and a flag indicating ifthe local user's name is the superuser.  It thenchecks the files .PN /etc/hosts.equivand .PN \&.rhostsin the user's home directory to see if the request forservice is allowed.  A 0 is returned if the machinename is listed in the .PN hosts.equiv file, or thehost and remote user name are found in the .PN \&.rhostsfile.  Otherwise .PN ruserokreturns \-1.  If the superuserflag is 1, the checking of the .PN hosts.equiv file isbypassed..SH See Alsorlogin(1c), rsh(1c), gethostent(3n), rexec(3x), rexecd(8c), rlogind(8c), rshd(8c)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -