[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.18 and 1.19

version 1.18, 1999/11/24 00:26:02 version 1.19, 1999/11/24 19:53:49
Line 158 
Line 158 
 #define WHITESPACE " \t\r\n"  #define WHITESPACE " \t\r\n"
   
   
 /* Adds a local TCP/IP port forward to options.  Never returns if there  /*
    is an error. */   * Adds a local TCP/IP port forward to options.  Never returns if there is an
    * error.
    */
   
 void  void
 add_local_forward(Options *options, int port, const char *host,  add_local_forward(Options *options, int port, const char *host,
Line 179 
Line 181 
         fwd->host_port = host_port;          fwd->host_port = host_port;
 }  }
   
 /* Adds a remote TCP/IP port forward to options.  Never returns if there  /*
    is an error. */   * Adds a remote TCP/IP port forward to options.  Never returns if there is
    * an error.
    */
   
 void  void
 add_remote_forward(Options *options, int port, const char *host,  add_remote_forward(Options *options, int port, const char *host,
Line 196 
Line 200 
         fwd->host_port = host_port;          fwd->host_port = host_port;
 }  }
   
 /* Returns the number of the token pointed to by cp of length len.  /*
    Never returns if the token is not known. */   * Returns the number of the token pointed to by cp of length len. Never
    * returns if the token is not known.
    */
   
 static OpCodes  static OpCodes
 parse_token(const char *cp, const char *filename, int linenum)  parse_token(const char *cp, const char *filename, int linenum)
Line 213 
Line 219 
         return oBadOption;          return oBadOption;
 }  }
   
 /* Processes a single option line as used in the configuration files.  /*
    This only sets those values that have not already been set. */   * Processes a single option line as used in the configuration files. This
    * only sets those values that have not already been set.
    */
   
 int  int
 process_config_line(Options *options, const char *host,  process_config_line(Options *options, const char *host,
Line 229 
Line 237 
         if (!*cp || *cp == '\n' || *cp == '#')          if (!*cp || *cp == '\n' || *cp == '#')
                 return 0;                  return 0;
   
         /* Get the keyword. (Each line is supposed to begin with a          /* Get the keyword. (Each line is supposed to begin with a keyword). */
            keyword). */  
         cp = strtok(cp, WHITESPACE);          cp = strtok(cp, WHITESPACE);
         {          {
                 char *t = cp;                  char *t = cp;
Line 243 
Line 250 
   
         switch (opcode) {          switch (opcode) {
         case oBadOption:          case oBadOption:
                 return -1;      /* don't panic, but count bad options */                  /* don't panic, but count bad options */
                   return -1;
                 /* NOTREACHED */                  /* NOTREACHED */
         case oForwardAgent:          case oForwardAgent:
                 intptr = &options->forward_agent;                  intptr = &options->forward_agent;
Line 424 
Line 432 
 #else  #else
                 {                  {
                         char *ptr;                          char *ptr;
                         value = strtol(cp, &ptr, 0);    /* Octal, decimal, or                          /* Octal, decimal, or hex format? */
                                                            hex format? */                          value = strtol(cp, &ptr, 0);
                         if (cp == ptr)                          if (cp == ptr)
                                 fatal("%.200s line %d: Bad number.", filename, linenum);                                  fatal("%.200s line %d: Bad number.", filename, linenum);
                 }                  }
Line 506 
Line 514 
                                 *activep = 1;                                  *activep = 1;
                                 break;                                  break;
                         }                          }
                 /* Avoid garbage check below, as strtok already returned                  /* Avoid garbage check below, as strtok already returned NULL. */
                    NULL. */  
                 return 0;                  return 0;
   
         case oEscapeChar:          case oEscapeChar:
Line 544 
Line 551 
 }  }
   
   
 /* Reads the config file and modifies the options accordingly.  Options should  /*
    already be initialized before this call.  This never returns if there   * Reads the config file and modifies the options accordingly.  Options
    is an error.  If the file does not exist, this returns immediately. */   * should already be initialized before this call.  This never returns if
    * there is an error.  If the file does not exist, this returns immediately.
    */
   
 void  void
 read_config_file(const char *filename, const char *host, Options *options)  read_config_file(const char *filename, const char *host, Options *options)
Line 563 
Line 572 
   
         debug("Reading configuration data %.200s", filename);          debug("Reading configuration data %.200s", filename);
   
         /* Mark that we are now processing the options.  This flag is          /*
            turned on/off by Host specifications. */           * Mark that we are now processing the options.  This flag is turned
            * on/off by Host specifications.
            */
         active = 1;          active = 1;
         linenum = 0;          linenum = 0;
         while (fgets(line, sizeof(line), f)) {          while (fgets(line, sizeof(line), f)) {
Line 579 
Line 590 
                       filename, bad_options);                        filename, bad_options);
 }  }
   
 /* Initializes options to special values that indicate that they have not  /*
    yet been set.  Read_config_file will only set options with this value.   * Initializes options to special values that indicate that they have not yet
    Options are processed in the following order: command line, user config   * been set.  Read_config_file will only set options with this value. Options
    file, system config file.  Last, fill_default_options is called. */   * are processed in the following order: command line, user config file,
    * system config file.  Last, fill_default_options is called.
    */
   
 void  void
 initialize_options(Options * options)  initialize_options(Options * options)
Line 628 
Line 641 
         options->log_level = (LogLevel) - 1;          options->log_level = (LogLevel) - 1;
 }  }
   
 /* Called after processing other sources of option data, this fills those  /*
    options for which no value has been specified with their default values. */   * Called after processing other sources of option data, this fills those
    * options for which no value has been specified with their default values.
    */
   
 void  void
 fill_default_options(Options * options)  fill_default_options(Options * options)

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19