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

Diff for /src/usr.bin/ssh/misc.c between version 1.31 and 1.32

version 1.31, 2005/06/06 11:20:36 version 1.32, 2005/06/17 02:44:32
Line 380 
Line 380 
         const char *path;          const char *path;
         char user[128], ret[MAXPATHLEN];          char user[128], ret[MAXPATHLEN];
         struct passwd *pw;          struct passwd *pw;
         int len;          u_int len, slash;
   
         if (*filename != '~')          if (*filename != '~')
                 return (xstrdup(filename));                  return (xstrdup(filename));
Line 388 
Line 388 
   
         path = strchr(filename, '/');          path = strchr(filename, '/');
         if (path != NULL && path > filename) {          /* ~user/path */          if (path != NULL && path > filename) {          /* ~user/path */
                 if (path - filename > sizeof(user) - 1)                  slash = path - filename;
                   if (slash > sizeof(user) - 1)
                         fatal("tilde_expand_filename: ~username too long");                          fatal("tilde_expand_filename: ~username too long");
                 memcpy(user, filename, path - filename);                  memcpy(user, filename, slash);
                 user[path - filename] = '\0';                  user[slash] = '\0';
                 if ((pw = getpwnam(user)) == NULL)                  if ((pw = getpwnam(user)) == NULL)
                         fatal("tilde_expand_filename: No such user %s", user);                          fatal("tilde_expand_filename: No such user %s", user);
         } else if ((pw = getpwuid(uid)) == NULL)        /* ~/path */          } else if ((pw = getpwuid(uid)) == NULL)        /* ~/path */
Line 429 
Line 430 
                 const char *key;                  const char *key;
                 const char *repl;                  const char *repl;
         } keys[EXPAND_MAX_KEYS];          } keys[EXPAND_MAX_KEYS];
         int num_keys, i, j;          u_int num_keys, i, j;
         char buf[4096];          char buf[4096];
         va_list ap;          va_list ap;
   

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32