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

Diff for /src/usr.bin/ssh/sftp.c between version 1.229 and 1.230

version 1.229, 2023/03/12 09:41:18 version 1.230, 2023/03/28 07:44:32
Line 595 
Line 595 
         return ret;          return ret;
 }  }
   
   /*
    * Arg p must be dynamically allocated.  make_absolute will either return it
    * or free it and and allocate a new one.  Caller must free returned string.
    */
 static char *  static char *
 make_absolute_pwd_glob(const char *p, const char *pwd)  make_absolute_pwd_glob(char *p, const char *pwd)
 {  {
         char *ret, *escpwd;          char *ret, *escpwd;
   
         escpwd = escape_glob(pwd);          escpwd = escape_glob(pwd);
         if (p == NULL)          if (p == NULL)
                 return escpwd;                  return escpwd;
         ret = make_absolute(xstrdup(p), escpwd);          ret = make_absolute(p, escpwd);
         free(escpwd);          free(escpwd);
         return ret;          return ret;
 }  }
Line 616 
Line 620 
         glob_t g;          glob_t g;
         int i, r, err = 0;          int i, r, err = 0;
   
         abs_src = make_absolute_pwd_glob(src, pwd);          abs_src = make_absolute_pwd_glob(xstrdup(src), pwd);
         memset(&g, 0, sizeof(g));          memset(&g, 0, sizeof(g));
   
         debug3("Looking up %s", abs_src);          debug3("Looking up %s", abs_src);
Line 1969 
Line 1973 
   
         memset(&g, 0, sizeof(g));          memset(&g, 0, sizeof(g));
         if (remote != LOCAL) {          if (remote != LOCAL) {
                 tmp2 = make_absolute_pwd_glob(tmp, remote_path);                  tmp = make_absolute_pwd_glob(tmp, remote_path);
                 free(tmp);  
                 tmp = tmp2;  
                 remote_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);                  remote_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);
         } else          } else
                 glob(tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);                  glob(tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);

Legend:
Removed from v.1.229  
changed lines
  Added in v.1.230