[BACK]Return to rpcinfo.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rpcinfo

Diff for /src/usr.bin/rpcinfo/rpcinfo.c between version 1.2 and 1.3

version 1.2, 1996/06/26 05:38:45 version 1.3, 1996/06/29 01:07:33
Line 204 
Line 204 
         prognum = getprognum(argv[1]);          prognum = getprognum(argv[1]);
         get_inet_address(&addr, argv[0]);          get_inet_address(&addr, argv[0]);
         /* Open the socket here so it will survive calls to clnt_destroy */          /* Open the socket here so it will survive calls to clnt_destroy */
         sock = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP);          sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
         if (sock < 0) {          if (sock < 0) {
                 perror("rpcinfo: socket");                  perror("rpcinfo: socket");
                 exit(1);                  exit(1);
         }          }
           if (getuid() == 0)
                   bindresvport(sock, NULL);
         failure = 0;          failure = 0;
         if (argc == 2) {          if (argc == 2) {
                 /*                  /*
Line 590 
Line 592 
   
         if (argc != 2) {          if (argc != 2) {
                 usage() ;                  usage() ;
                 exit(1) ;  
         }  
         if (getuid()) { /* This command allowed only to root */  
                 fprintf(stderr, "Sorry. You are not root\n") ;  
                 exit(1) ;                  exit(1) ;
         }          }
         prog_num = getprognum(argv[0]);          prog_num = getprognum(argv[0]);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3