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

Diff for /src/usr.bin/ssh/sftp-client.c between version 1.3 and 1.4

version 1.3, 2001/02/04 15:32:25 version 1.4, 2001/02/06 23:30:28
Line 48 
Line 48 
 /* XXX: what should this be? */  /* XXX: what should this be? */
 #define COPY_SIZE       8192  #define COPY_SIZE       8192
   
   /* Message ID */
   static u_int msg_id = 1;
   
 void  void
 send_msg(int fd, Buffer *m)  send_msg(int fd, Buffer *m)
 {  {
Line 255 
Line 258 
   
         buffer_init(&msg);          buffer_init(&msg);
   
         id = arc4random();          id = msg_id++;
         buffer_put_char(&msg, SSH2_FXP_CLOSE);          buffer_put_char(&msg, SSH2_FXP_CLOSE);
         buffer_put_int(&msg, id);          buffer_put_int(&msg, id);
         buffer_put_string(&msg, handle, handle_len);          buffer_put_string(&msg, handle, handle_len);
Line 278 
Line 281 
         u_int type, id, handle_len, i, expected_id;          u_int type, id, handle_len, i, expected_id;
         char *handle;          char *handle;
   
         id = arc4random();          id = msg_id++;
   
         buffer_init(&msg);          buffer_init(&msg);
         buffer_put_char(&msg, SSH2_FXP_OPENDIR);          buffer_put_char(&msg, SSH2_FXP_OPENDIR);
Line 295 
Line 298 
         for(;;) {          for(;;) {
                 int count;                  int count;
   
                 expected_id = ++id;                  id = expected_id = msg_id++;
   
                 debug3("Sending SSH2_FXP_READDIR I:%d", id);                  debug3("Sending SSH2_FXP_READDIR I:%d", id);
   
Line 365 
Line 368 
   
         debug2("Sending SSH2_FXP_REMOVE \"%s\"", path);          debug2("Sending SSH2_FXP_REMOVE \"%s\"", path);
   
         id = arc4random();          id = msg_id++;
         send_string_request(fd_out, id, SSH2_FXP_REMOVE, path, strlen(path));          send_string_request(fd_out, id, SSH2_FXP_REMOVE, path, strlen(path));
         status = get_status(fd_in, id);          status = get_status(fd_in, id);
         if (status != SSH2_FX_OK)          if (status != SSH2_FX_OK)
Line 378 
Line 381 
 {  {
         u_int status, id;          u_int status, id;
   
         id = arc4random();          id = msg_id++;
         send_string_attrs_request(fd_out, id, SSH2_FXP_MKDIR, path,          send_string_attrs_request(fd_out, id, SSH2_FXP_MKDIR, path,
             strlen(path), a);              strlen(path), a);
   
Line 394 
Line 397 
 {  {
         u_int status, id;          u_int status, id;
   
         id = arc4random();          id = msg_id++;
         send_string_request(fd_out, id, SSH2_FXP_RMDIR, path, strlen(path));          send_string_request(fd_out, id, SSH2_FXP_RMDIR, path, strlen(path));
   
         status = get_status(fd_in, id);          status = get_status(fd_in, id);
Line 409 
Line 412 
 {  {
         u_int id;          u_int id;
   
         id = arc4random();          id = msg_id++;
         send_string_request(fd_out, id, SSH2_FXP_STAT, path, strlen(path));          send_string_request(fd_out, id, SSH2_FXP_STAT, path, strlen(path));
         return(get_decode_stat(fd_in, id));          return(get_decode_stat(fd_in, id));
 }  }
Line 419 
Line 422 
 {  {
         u_int id;          u_int id;
   
         id = arc4random();          id = msg_id++;
         send_string_request(fd_out, id, SSH2_FXP_LSTAT, path, strlen(path));          send_string_request(fd_out, id, SSH2_FXP_LSTAT, path, strlen(path));
         return(get_decode_stat(fd_in, id));          return(get_decode_stat(fd_in, id));
 }  }
Line 430 
Line 433 
 {  {
         u_int id;          u_int id;
   
         id = arc4random();          id = msg_id++;
         send_string_request(fd_out, id, SSH2_FXP_FSTAT, handle, handle_len);          send_string_request(fd_out, id, SSH2_FXP_FSTAT, handle, handle_len);
         return(get_decode_stat(fd_in, id));          return(get_decode_stat(fd_in, id));
 }  }
Line 440 
Line 443 
 {  {
         u_int status, id;          u_int status, id;
   
         id = arc4random();          id = msg_id++;
         send_string_attrs_request(fd_out, id, SSH2_FXP_SETSTAT, path,          send_string_attrs_request(fd_out, id, SSH2_FXP_SETSTAT, path,
             strlen(path), a);              strlen(path), a);
   
Line 458 
Line 461 
 {  {
         u_int status, id;          u_int status, id;
   
         id = arc4random();          id = msg_id++;
         send_string_attrs_request(fd_out, id, SSH2_FXP_FSETSTAT, handle,          send_string_attrs_request(fd_out, id, SSH2_FXP_FSETSTAT, handle,
             handle_len, a);              handle_len, a);
   
Line 477 
Line 480 
         char *filename, *longname;          char *filename, *longname;
         Attrib *a;          Attrib *a;
   
         expected_id = id = arc4random();          expected_id = id = msg_id++;
         send_string_request(fd_out, id, SSH2_FXP_REALPATH, path,          send_string_request(fd_out, id, SSH2_FXP_REALPATH, path,
             strlen(path));              strlen(path));
   
Line 525 
Line 528 
         buffer_init(&msg);          buffer_init(&msg);
   
         /* Send rename request */          /* Send rename request */
         id = arc4random();          id = msg_id++;
         buffer_put_char(&msg, SSH2_FXP_RENAME);          buffer_put_char(&msg, SSH2_FXP_RENAME);
         buffer_put_int(&msg, id);          buffer_put_int(&msg, id);
         buffer_put_cstring(&msg, oldpath);          buffer_put_cstring(&msg, oldpath);
Line 588 
Line 591 
         buffer_init(&msg);          buffer_init(&msg);
   
         /* Send open request */          /* Send open request */
         id = arc4random();          id = msg_id++;
         buffer_put_char(&msg, SSH2_FXP_OPEN);          buffer_put_char(&msg, SSH2_FXP_OPEN);
         buffer_put_int(&msg, id);          buffer_put_int(&msg, id);
         buffer_put_cstring(&msg, remote_path);          buffer_put_cstring(&msg, remote_path);
Line 611 
Line 614 
                 u_int len;                  u_int len;
                 char *data;                  char *data;
   
                 expected_id = ++id;                  id = expected_id = msg_id++;
   
                 buffer_clear(&msg);                  buffer_clear(&msg);
                 buffer_put_char(&msg, SSH2_FXP_READ);                  buffer_put_char(&msg, SSH2_FXP_READ);
Line 713 
Line 716 
         buffer_init(&msg);          buffer_init(&msg);
   
         /* Send open request */          /* Send open request */
         id = arc4random();          id = msg_id++;
         buffer_put_char(&msg, SSH2_FXP_OPEN);          buffer_put_char(&msg, SSH2_FXP_OPEN);
         buffer_put_int(&msg, id);          buffer_put_int(&msg, id);
         buffer_put_cstring(&msg, remote_path);          buffer_put_cstring(&msg, remote_path);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4