home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / question / 13537 < prev    next >
Encoding:
Text File  |  1992-11-17  |  2.4 KB  |  70 lines

  1. Xref: sparky comp.unix.questions:13537 comp.sys.sun.misc:5306
  2. Path: sparky!uunet!ukma!wupost!usc!elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!news
  3. From: svkakkad@cs.utexas.edu (Sheetal V. Kakkad)
  4. Newsgroups: comp.unix.questions,comp.sys.sun.misc
  5. Subject: rexec does not search for ~/.netrc file
  6. Date: 17 Nov 1992 16:29:42 -0600
  7. Organization: CS Dept, University of Texas at Austin
  8. Lines: 57
  9. Message-ID: <lgisimINNnog@boogie.cs.utexas.edu>
  10. NNTP-Posting-Host: boogie.cs.utexas.edu
  11. Keywords: rexec, netrc
  12.  
  13. I am trying to use rexec(3N) on a Sun SparcStation to start a server
  14. on a remote host (also a Sun SparcStation). The synopsis of the call
  15. (as given in the man page) is:
  16.  
  17. SYNOPSIS
  18.      rem = rexec(ahost, inport, user, passwd, cmd, fd2p);
  19.      char **ahost;
  20.      u_short inport;
  21.      char *user, *passwd, *cmd;
  22.      int *fd2p;
  23.  
  24. Here's the relevant portion of the description from the man page:
  25.  
  26. DESCRIPTION
  27.     ...
  28.      If  a  username  and password are both specified, then these
  29.      are used to authenticate to the foreign host; otherwise  the
  30.      environment  and  then  the  user's  .netrc file in his home
  31.      directory are searched for appropriate information.  If  all
  32.      this fails, the user is prompted for the information.
  33.     ...
  34.  
  35. Now, I have a .netrc file in my home directory which has lines of the
  36. following form, one line for each foreign host:
  37.  
  38. machine machinename login mylogin password mypassword
  39.  
  40. Here's how I call rexec in my program (I have also shown some other
  41. relevant variables used in the call):
  42.  
  43. int port;    /* set using getservent ("exec", "tcp") call */
  44. char *rhost;    /* set to the foreign host name */
  45. char *srvr;    /* set to full path name of my server */
  46.  
  47. s = rexec (&rhost, port, (char *) NULL, (char *) NULL, 
  48.        srvr, (char *) NULL);
  49.  
  50. Even though I have the .netrc file set up in my home directory, the
  51. call still prompts me for the username and password.
  52.  
  53. My question is: Am I doing something wrong here, or is this a commonly
  54. known bug? Any pointers will be appreciated.
  55.  
  56. My machine is a SparcStation ELC running SunOS 4.1.2. All the remote
  57. hosts (where I am trying to start up my server) are SparcStation 1's
  58. also running SunOS 4.1.2.
  59.  
  60. Thanks in advance,
  61.  
  62. - Sheetal
  63.  
  64. Note: Follow-up set to comp.sys.sun.misc.
  65.  
  66. ----------------------------------------------------------------------
  67. Sheetal V. Kakkad    svkakkad@cs.utexas.edu    Office: (512) 471-9586
  68. Dept of Computer Sciences, UT-Austin        Home:   (512) 450-1756
  69. ======================================================================
  70.