home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.questions:13537 comp.sys.sun.misc:5306
- Path: sparky!uunet!ukma!wupost!usc!elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!news
- From: svkakkad@cs.utexas.edu (Sheetal V. Kakkad)
- Newsgroups: comp.unix.questions,comp.sys.sun.misc
- Subject: rexec does not search for ~/.netrc file
- Date: 17 Nov 1992 16:29:42 -0600
- Organization: CS Dept, University of Texas at Austin
- Lines: 57
- Message-ID: <lgisimINNnog@boogie.cs.utexas.edu>
- NNTP-Posting-Host: boogie.cs.utexas.edu
- Keywords: rexec, netrc
-
- I am trying to use rexec(3N) on a Sun SparcStation to start a server
- on a remote host (also a Sun SparcStation). The synopsis of the call
- (as given in the man page) is:
-
- SYNOPSIS
- rem = rexec(ahost, inport, user, passwd, cmd, fd2p);
- char **ahost;
- u_short inport;
- char *user, *passwd, *cmd;
- int *fd2p;
-
- Here's the relevant portion of the description from the man page:
-
- DESCRIPTION
- ...
- If a username and password are both specified, then these
- are used to authenticate to the foreign host; otherwise the
- environment and then the user's .netrc file in his home
- directory are searched for appropriate information. If all
- this fails, the user is prompted for the information.
- ...
-
- Now, I have a .netrc file in my home directory which has lines of the
- following form, one line for each foreign host:
-
- machine machinename login mylogin password mypassword
-
- Here's how I call rexec in my program (I have also shown some other
- relevant variables used in the call):
-
- int port; /* set using getservent ("exec", "tcp") call */
- char *rhost; /* set to the foreign host name */
- char *srvr; /* set to full path name of my server */
-
- s = rexec (&rhost, port, (char *) NULL, (char *) NULL,
- srvr, (char *) NULL);
-
- Even though I have the .netrc file set up in my home directory, the
- call still prompts me for the username and password.
-
- My question is: Am I doing something wrong here, or is this a commonly
- known bug? Any pointers will be appreciated.
-
- My machine is a SparcStation ELC running SunOS 4.1.2. All the remote
- hosts (where I am trying to start up my server) are SparcStation 1's
- also running SunOS 4.1.2.
-
- Thanks in advance,
-
- - Sheetal
-
- Note: Follow-up set to comp.sys.sun.misc.
-
- ----------------------------------------------------------------------
- Sheetal V. Kakkad svkakkad@cs.utexas.edu Office: (512) 471-9586
- Dept of Computer Sciences, UT-Austin Home: (512) 450-1756
- ======================================================================
-