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

Diff for /src/usr.bin/ssh/readconf.c between version 1.21 and 1.22

version 1.21, 1999/11/24 20:24:09 version 1.22, 1999/12/01 13:59:15
Line 164 
Line 164 
  */   */
   
 void  void
 add_local_forward(Options *options, int port, const char *host,  add_local_forward(Options *options, u_short port, const char *host,
                   int host_port)                    u_short host_port)
 {  {
         Forward *fwd;          Forward *fwd;
         extern uid_t original_real_uid;          extern uid_t original_real_uid;
         if ((port & 0xffff) != port)  
                 fatal("Requested forwarding of nonexistent port %d.", port);  
         if (port < IPPORT_RESERVED && original_real_uid != 0)          if (port < IPPORT_RESERVED && original_real_uid != 0)
                 fatal("Privileged ports can only be forwarded by root.\n");                  fatal("Privileged ports can only be forwarded by root.\n");
         if (options->num_local_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION)          if (options->num_local_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION)
Line 187 
Line 185 
  */   */
   
 void  void
 add_remote_forward(Options *options, int port, const char *host,  add_remote_forward(Options *options, u_short port, const char *host,
                    int host_port)                     u_short host_port)
 {  {
         Forward *fwd;          Forward *fwd;
         if (options->num_remote_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION)          if (options->num_remote_forwards >= SSH_MAX_FORWARDS_PER_DIRECTION)
Line 230 
Line 228 
                     int *activep)                      int *activep)
 {  {
         char buf[256], *cp, *string, **charptr, *cp2;          char buf[256], *cp, *string, **charptr, *cp2;
         int opcode, *intptr, value, fwd_port, fwd_host_port;          int opcode, *intptr, value;
           u_short fwd_port, fwd_host_port;
   
         /* Skip leading whitespace. */          /* Skip leading whitespace. */
         cp = line + strspn(line, WHITESPACE);          cp = line + strspn(line, WHITESPACE);
Line 467 
Line 466 
                 if (!cp)                  if (!cp)
                         fatal("%.200s line %d: Missing second argument.",                          fatal("%.200s line %d: Missing second argument.",
                               filename, linenum);                                filename, linenum);
                 if (sscanf(cp, "%255[^:]:%d", buf, &fwd_host_port) != 2)                  if (sscanf(cp, "%255[^:]:%hu", buf, &fwd_host_port) != 2)
                         fatal("%.200s line %d: Badly formatted host:port.",                          fatal("%.200s line %d: Badly formatted host:port.",
                               filename, linenum);                                filename, linenum);
                 if (*activep)                  if (*activep)
Line 486 
Line 485 
                 if (!cp)                  if (!cp)
                         fatal("%.200s line %d: Missing second argument.",                          fatal("%.200s line %d: Missing second argument.",
                               filename, linenum);                                filename, linenum);
                 if (sscanf(cp, "%255[^:]:%d", buf, &fwd_host_port) != 2)                  if (sscanf(cp, "%255[^:]:%hu", buf, &fwd_host_port) != 2)
                         fatal("%.200s line %d: Badly formatted host:port.",                          fatal("%.200s line %d: Badly formatted host:port.",
                               filename, linenum);                                filename, linenum);
                 if (*activep)                  if (*activep)

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22