rexec() function problem


 
Thread Tools Search this Thread
Top Forums Programming rexec() function problem
# 8  
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question
rexec(3)						     Library Functions Manual							  rexec(3)

NAME
rexec, rexec_r - Allow command execution on a remote host LIBRARY
Standard C Library (libc.a) SYNOPSIS
#include <netdb.h> #include <unistd.h> int rexec( char **host, int port, char *user, char *passwd, char *command, int *err_file_desc); The following function is supported in order to maintain backward compatibility with previous versions of the operating system. int rexec_r( char **host, int port, char *user, char *passwd, char *command, int *err_file_desc, struct hos- tent_data *host_data); PARAMETERS
Contains the name of a remote host that is listed in the /etc/hosts file or /etc/resolv.conf file. If the name of the host is not found in either file, the rexec() fails. Specifies the well-known Internet port to use for the connection. A pointer to the structure that con- tains the necessary port can be obtained by issuing the following library call: getservbyname("exec", "tcp") Points to a user ID that is valid on the host. Points to the password of the specified user ID on the host. Points to the name of the command to be executed at the remote host. Specifies the file to which standard error from the remote command is sent. If the err_file_desc parameter is 0 (zero), the standard error of the remote command is the same as standard output. No provision is made for sending arbitrary signals to the remote process. In this case, however, it may be possible to send out-of-band data to the remote com- mand. If the err_file_desc parameter is nonzero, an auxiliary channel to a control process is set up, and a descriptor for it is placed in the err_file_desc parameter. The control process provides diagnostic output from the remote command on this channel and also accepts bytes as signal numbers to be forwarded to the process group of the command. This diagnostic information does not include remote authorization failure, since this connection is set up after authorization has been verified. Per-thread data for reentrant version. DESCRIPTION
The rexec() (remote execution) function allows the calling process to execute commands on a remote host. If the rexec() connection succeeds, a socket in the Internet domain of type SOCK_STREAM is returned to the calling process and is given to the remote command as standard input and standard output. The user and passwd parameters specify a valid user ID and the associated password for that user on the remote host. If the user and passwd parameters are not supplied, the rexec() function takes the following actions until finding a user ID and password to send to the remote host: It searches the current environment for the user ID and password on the remote host. It searches the user's home directory for a file called $HOME/.netrc that contains a user ID and password. It prompts the user for a user ID and password. Note that action 3 does not apply when using rexec_r(). NOTES
The rexec_r() function is the reentrant version of rexec(). It is supported in order to maintain backward compatibility with previous ver- sions of the operating system. The netdb.h header file defines the hostent_data structures. RETURN VALUES
Upon successful completion, the system returns a socket descriptor to the remote command. Otherwise, a value of -1 is returned, indicating that the specified hostname does not exist. FILES
Contains hostnames and their addresses for hosts in a network. This file is used to resolve a hostname into an Internet address. Contains the name server and domain name. Contains automatic login information. RELATED INFORMATION
Functions: getservbyname(3), rcmd(3), rresvport(3), ruserok(3). Commands: rexecd(8). delim off rexec(3)