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

Diff for /src/usr.bin/ssh/auth.c between version 1.64 and 1.65

version 1.64, 2006/03/20 17:10:19 version 1.65, 2006/03/25 00:05:41
Line 222 
Line 222 
 static char *  static char *
 expand_authorized_keys(const char *filename, struct passwd *pw)  expand_authorized_keys(const char *filename, struct passwd *pw)
 {  {
         char *file, *ret;          char *file, ret[MAXPATHLEN];
           int i;
   
         file = percent_expand(filename, "h", pw->pw_dir,          file = percent_expand(filename, "h", pw->pw_dir,
             "u", pw->pw_name, (char *)NULL);              "u", pw->pw_name, (char *)NULL);
Line 234 
Line 235 
         if (*file == '/')          if (*file == '/')
                 return (file);                  return (file);
   
         ret = xmalloc(MAXPATHLEN);          i = snprintf(ret, sizeof(ret), "%s/%s", pw->pw_dir, file);
         if (strlcpy(ret, pw->pw_dir, MAXPATHLEN) >= MAXPATHLEN ||          if (i < 0 || (size_t)i >= sizeof(ret))
             strlcat(ret, "/", MAXPATHLEN) >= MAXPATHLEN ||  
             strlcat(ret, file, MAXPATHLEN) >= MAXPATHLEN)  
                 fatal("expand_authorized_keys: path too long");                  fatal("expand_authorized_keys: path too long");
   
         xfree(file);          xfree(file);
         return (ret);          return (xstrdup(ret));
 }  }
   
 char *  char *

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65