Sponsored Content
Full Discussion: rexec() function problem
Top Forums Programming rexec() function problem Post 12861 by shaik786 on Tuesday 8th of January 2002 09:19:23 AM
Old 01-08-2002
Quote:
WARNINGS
There is no way to specify options to the socket() call that rexec()
makes.

A program using rexec() should not be put in the background when
rexec() is expected to prompt for a password or user name. Putting
rexec() in the background will cause it to compete with the current
shell process for input.

Since rexec() replaces the pointer to the host name (*ahost) with a
pointer to the standard name of the host in a static data area, this
value must be copied into the user's data area if it is to be used
later.


The password is sent unencrypted through the socket connection.

Last edited by shaik786; 01-08-2002 at 10:25 AM..
shaik786
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

expect (re: rexec)

In http://forums.unix.com/showthread.php?threadid=391 there is one statement called expect. but when I issue command whereis expect, respond from o/s only EXPECT: (only one world). I try to find it at /usr/bin, no expect statement there ? is it default unix o/s command ? I am using AIX on... (1 Reply)
Discussion started by: yatno
1 Replies

2. UNIX for Dummies Questions & Answers

Enabling Rexec ????

Can someone tell me how I would enable Rexec on a UNIX machine? And is the procedure different on the different systems - Solaris, HP-UX -etc. Thanks~!! mike (1 Reply)
Discussion started by: raichuu
1 Replies

3. Solaris

Rexec

How is rexec enabled on a Solaris 8? How can I check if rexec is installed? (1 Reply)
Discussion started by: pmj1970
1 Replies

4. UNIX for Advanced & Expert Users

reagrding REXEC command

Hi UNIX gurus..... have a doubt..can i run a script in a remote machine by using something like rexec add.corp.afg.com /aa/ss/remtescript I dont want to use the rsh command due to some security issues. thanx, rahul26 :) (2 Replies)
Discussion started by: rahul26
2 Replies

5. Shell Programming and Scripting

How can I do a rexec to execute un C exe ?

Hello, I would like to do a rexec to execute a C exe (prog.e) : rexec -l user -p password host prog.e When I execute this command, I have this error : prog.e : can not find lib.o But, When I execute prog.e directly in the remote machine : well done ! No error output. Thks for your... (4 Replies)
Discussion started by: Lika
4 Replies

6. UNIX for Advanced & Expert Users

Remote commands problem using RSH & Rexec

I have enabled the RSH and Rexec command in my HP-UX server but when i try to send any command to the server it returns Execute Permission Denied except commands like ls-l C:\rsh xxx.xxx.xxx.xxx -l mpac mxpkill 12 the mxpkill command work when I log to the server using telnet with the same... (0 Replies)
Discussion started by: fhuwaidy
0 Replies

7. UNIX for Dummies Questions & Answers

exit codes from rexec?

how do i/is there a way to return the exit code from the remote host? echo $? from the local host only gives 0, if the rexec command itself executes successfully. But what if in the case of the remote command failiing? echo $? on the localhost still gives 0, but I'm interested in the exit code... (4 Replies)
Discussion started by: diego_sapphire
4 Replies

8. AIX

rexec - other options?

Rexec executes commands one at a time on a remote host. The rexec command provides an automatic login feature by checking for a $HOME/.netrc file. User and password are stored in $HOME/.netrc. I would like to log on to another host and execute a script/command but not using $HOME/.netrc file,... (4 Replies)
Discussion started by: ioniCoder
4 Replies

9. UNIX for Advanced & Expert Users

Rexec Issue

Hi Team, I am executing some ksh scripts which inturn calls java files in AIX Environment. We have installed java6_64 which is in .profile. But when we execute from rexec its taking path from some different place that does not have java in $PATH variable. Can you please help me find out which... (2 Replies)
Discussion started by: balasubramani04
2 Replies

10. Red Hat

Slow login with rexec.

Hi all, I´m replacing an old linux enterprise redhat 4.5 by a new one linux enterprise redhat 6. In both I use rexec as a communication between the front end and the user. In the old one, when the user connects, the communication establishes quickly (less than 3 sec). But in the new one, the... (1 Reply)
Discussion started by: mig28mx
1 Replies
rexec(3SOCKET)						     Sockets Library Functions						    rexec(3SOCKET)

NAME
rexec, rexec_af - return stream to a remote command SYNOPSIS
cc [ flag ... ] file... -lsocket -lnsl [ library... ] #include <netdb.h> #include <unistd.h> int rexec(char **ahost, unsigned short inport, const char *user, const char *passwd, const char *cmd, int *fd2p); int rexec_af(char **ahost, unsigned short inport, const char *user, const char *passwd, const char *cmd, int *fd2p, int af); DESCRIPTION
The rexec() and rexec_af() functions look up the host ahost using getaddrinfo(3SOCKET) and return -1 if the host does not exist. Otherwise ahost is set to the standard name of the host. The username and password are used in remote host authentication. When a username and pass- word are not specified, the .netrc file in the user's home directory is searched for the appropriate information. If the search fails, the user is prompted for the information. The rexec() function always returns a socket of the AF_INET address family. The rexec_af() function supports AF_INET, AF_INET6, or AF_UNSPEC for the address family. An application can choose which type of socket is returned by passing AF_INET or AF_INET6 as the address family. The use of AF_UNSPEC means that the caller will accept any address family. Choosing AF_UNSPEC provides a socket that best suits the connectivity to the remote host. The port inport specifies which DARPA Internet port to use for the connection. The port number used must be in network byte order, as sup- plied by a call to htons(3XNET). The protocol for connection is described in detail in in.rexecd(1M). If the call succeeds, a socket of type SOCK_STREAM is returned to the caller, and given to the remote command as its standard input and standard output. If fd2p is non-zero, an auxiliary channel to a control process is set up and a file descriptor for it is placed in *fd2p. The control process returns diagnostic output (file descriptor 2), from the command on the auxiliary channel. The control process also accepts bytes on this channel as signal numbers to be forwarded to the process group of the command. If fd2p is 0, the standard error (file descriptor 2) of the remote command is made the same as its standard output. No provision is made for sending arbitrary signals to the remote process, other than possibly sending out-of-band data. There is no way to specify options to the socket() call made by the rexec() or rexec_af()functions. RETURN VALUES
If rexec() succeeds, a file descriptor number is returned of the socket type SOCK_STREAM and the address family AF_INET. The parameter *ahost is set to the standard name of the host. If the value of fd2p is other than NULL, a file descriptor number is placed in *fd2p which represents the standard error stream of the command. If rexec_af() succeeds, the routine returns a file descriptor number of the socket type SOCK_STREAM in the address family AF_INET or AF_INET6, as determined by the value of the af parameter. If either rexec() or rexec_af() fails, -1 is returned. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ This interface is Unsafe in multithreaded applications. Unsafe interfaces should be called only from the main thread. SEE ALSO
in.rexecd(1M), getaddrinfo(3SOCKET), gethostbyname(3NSL), getservbyname(3SOCKET), htonl(3XNET), socket(3SOCKET), attributes(5) SunOS 5.11 10 Feb 2004 rexec(3SOCKET)
All times are GMT -4. The time now is 10:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy