[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.128 and 1.129

version 1.128, 2004/03/05 10:53:58 version 1.129, 2004/04/18 23:10:26
Line 777 
Line 777 
  */   */
   
 int  int
 read_config_file(const char *filename, const char *host, Options *options)  read_config_file(const char *filename, const char *host, Options *options,
       int checkperm)
 {  {
         FILE *f;          FILE *f;
         char line[1024];          char line[1024];
Line 785 
Line 786 
         int bad_options = 0;          int bad_options = 0;
   
         /* Open the file. */          /* Open the file. */
         f = fopen(filename, "r");          if ((f = fopen(filename, "r")) == NULL)
         if (!f)  
                 return 0;                  return 0;
   
           if (checkperm) {
                   struct stat sb;
   
                   if (fstat(fileno(f), &sb) == -1) {
                           fatal("fstat %s: %s", filename, strerror(errno));
                           fclose(f);
                           return (0);
                   }
                   if (((sb.st_uid != 0 && sb.st_uid != getuid()) ||
                       (sb.st_mode & 022) != 0)) {
                           fatal("Bad owner or permissions on %s", filename);
                           return 0;
                   }
           }
   
         debug("Reading configuration data %.200s", filename);          debug("Reading configuration data %.200s", filename);
   

Legend:
Removed from v.1.128  
changed lines
  Added in v.1.129