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

Diff for /src/usr.bin/ssh/hostfile.c between version 1.81 and 1.82

version 1.81, 2020/06/26 05:02:03 version 1.82, 2020/06/26 05:42:16
Line 463 
Line 463 
                 return;                  return;
         len = p - filename;          len = p - filename;
         dotsshdir = tilde_expand_filename("~/" _PATH_SSH_USER_DIR, getuid());          dotsshdir = tilde_expand_filename("~/" _PATH_SSH_USER_DIR, getuid());
         if ((strlen(dotsshdir) > len || strncmp(filename, dotsshdir, len) != 0          if (strlen(dotsshdir) > len || strncmp(filename, dotsshdir, len) != 0)
             || stat(dotsshdir, &st)) == 0)                  goto out; /* not ~/.ssh prefixed */
                 ; /* do nothing, path not in ~/.ssh or dir already exists */          if (stat(dotsshdir, &st) == 0)
                   goto out; /* dir already exists */
         else if (errno != ENOENT)          else if (errno != ENOENT)
                 error("Could not stat %s: %s", dotsshdir, strerror(errno));                  error("Could not stat %s: %s", dotsshdir, strerror(errno));
         else if (mkdir(dotsshdir, 0700) == -1)          else {
                 error("Could not create directory '%.200s' (%s).",                  if (mkdir(dotsshdir, 0700) == -1)
                     dotsshdir, strerror(errno));                          error("Could not create directory '%.200s' (%s).",
         else if (notify)                              dotsshdir, strerror(errno));
                 logit("Created directory '%s'.", dotsshdir);                  else if (notify)
                           logit("Created directory '%s'.", dotsshdir);
           }
    out:
         free(dotsshdir);          free(dotsshdir);
 }  }
   
   
 /*  /*
  * Appends an entry to the host file.  Returns false if the entry could not   * Appends an entry to the host file.  Returns false if the entry could not

Legend:
Removed from v.1.81  
changed lines
  Added in v.1.82