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

Diff for /src/usr.bin/ssh/sftp-server.c between version 1.27 and 1.28

version 1.27, 2001/06/22 22:21:20 version 1.28, 2001/06/23 15:12:20
Line 56 
Line 56 
         Attrib attrib;          Attrib attrib;
 };  };
   
 int  static int
 errno_to_portable(int unixerrno)  errno_to_portable(int unixerrno)
 {  {
         int ret = 0;          int ret = 0;
Line 87 
Line 87 
         return ret;          return ret;
 }  }
   
 int  static int
 flags_from_portable(int pflags)  flags_from_portable(int pflags)
 {  {
         int flags = 0;          int flags = 0;
Line 109 
Line 109 
         return flags;          return flags;
 }  }
   
 Attrib *  static Attrib *
 get_attrib(void)  get_attrib(void)
 {  {
         return decode_attrib(&iqueue);          return decode_attrib(&iqueue);
Line 133 
Line 133 
   
 Handle  handles[100];  Handle  handles[100];
   
 void  static void
 handle_init(void)  handle_init(void)
 {  {
         int i;          int i;
Line 142 
Line 142 
                 handles[i].use = HANDLE_UNUSED;                  handles[i].use = HANDLE_UNUSED;
 }  }
   
 int  static int
 handle_new(int use, char *name, int fd, DIR *dirp)  handle_new(int use, char *name, int fd, DIR *dirp)
 {  {
         int i;          int i;
Line 159 
Line 159 
         return -1;          return -1;
 }  }
   
 int  static int
 handle_is_ok(int i, int type)  handle_is_ok(int i, int type)
 {  {
         return i >= 0 && i < sizeof(handles)/sizeof(Handle) &&          return i >= 0 && i < sizeof(handles)/sizeof(Handle) &&
             handles[i].use == type;              handles[i].use == type;
 }  }
   
 int  static int
 handle_to_string(int handle, char **stringp, int *hlenp)  handle_to_string(int handle, char **stringp, int *hlenp)
 {  {
         if (stringp == NULL || hlenp == NULL)          if (stringp == NULL || hlenp == NULL)
Line 177 
Line 177 
         return 0;          return 0;
 }  }
   
 int  static int
 handle_from_string(char *handle, u_int hlen)  handle_from_string(char *handle, u_int hlen)
 {  {
         int val;          int val;
Line 191 
Line 191 
         return -1;          return -1;
 }  }
   
 char *  static char *
 handle_to_name(int handle)  handle_to_name(int handle)
 {  {
         if (handle_is_ok(handle, HANDLE_DIR)||          if (handle_is_ok(handle, HANDLE_DIR)||
Line 200 
Line 200 
         return NULL;          return NULL;
 }  }
   
 DIR *  static DIR *
 handle_to_dir(int handle)  handle_to_dir(int handle)
 {  {
         if (handle_is_ok(handle, HANDLE_DIR))          if (handle_is_ok(handle, HANDLE_DIR))
Line 208 
Line 208 
         return NULL;          return NULL;
 }  }
   
 int  static int
 handle_to_fd(int handle)  handle_to_fd(int handle)
 {  {
         if (handle_is_ok(handle, HANDLE_FILE))          if (handle_is_ok(handle, HANDLE_FILE))
Line 216 
Line 216 
         return -1;          return -1;
 }  }
   
 int  static int
 handle_close(int handle)  handle_close(int handle)
 {  {
         int ret = -1;          int ret = -1;
Line 233 
Line 233 
         return ret;          return ret;
 }  }
   
 int  static int
 get_handle(void)  get_handle(void)
 {  {
         char *handle;          char *handle;
Line 249 
Line 249 
   
 /* send replies */  /* send replies */
   
 void  static void
 send_msg(Buffer *m)  send_msg(Buffer *m)
 {  {
         int mlen = buffer_len(m);          int mlen = buffer_len(m);
Line 259 
Line 259 
         buffer_consume(m, mlen);          buffer_consume(m, mlen);
 }  }
   
 void  static void
 send_status(u_int32_t id, u_int32_t error)  send_status(u_int32_t id, u_int32_t error)
 {  {
         Buffer msg;          Buffer msg;
Line 289 
Line 289 
         send_msg(&msg);          send_msg(&msg);
         buffer_free(&msg);          buffer_free(&msg);
 }  }
 void  static void
 send_data_or_handle(char type, u_int32_t id, char *data, int dlen)  send_data_or_handle(char type, u_int32_t id, char *data, int dlen)
 {  {
         Buffer msg;          Buffer msg;
Line 302 
Line 302 
         buffer_free(&msg);          buffer_free(&msg);
 }  }
   
 void  static void
 send_data(u_int32_t id, char *data, int dlen)  send_data(u_int32_t id, char *data, int dlen)
 {  {
         TRACE("sent data id %d len %d", id, dlen);          TRACE("sent data id %d len %d", id, dlen);
         send_data_or_handle(SSH2_FXP_DATA, id, data, dlen);          send_data_or_handle(SSH2_FXP_DATA, id, data, dlen);
 }  }
   
 void  static void
 send_handle(u_int32_t id, int handle)  send_handle(u_int32_t id, int handle)
 {  {
         char *string;          char *string;
Line 321 
Line 321 
         xfree(string);          xfree(string);
 }  }
   
 void  static void
 send_names(u_int32_t id, int count, Stat *stats)  send_names(u_int32_t id, int count, Stat *stats)
 {  {
         Buffer msg;          Buffer msg;
Line 341 
Line 341 
         buffer_free(&msg);          buffer_free(&msg);
 }  }
   
 void  static void
 send_attrib(u_int32_t id, Attrib *a)  send_attrib(u_int32_t id, Attrib *a)
 {  {
         Buffer msg;          Buffer msg;
Line 357 
Line 357 
   
 /* parse incoming */  /* parse incoming */
   
 void  static void
 process_init(void)  process_init(void)
 {  {
         Buffer msg;          Buffer msg;
Line 371 
Line 371 
         buffer_free(&msg);          buffer_free(&msg);
 }  }
   
 void  static void
 process_open(void)  process_open(void)
 {  {
         u_int32_t id, pflags;          u_int32_t id, pflags;
Line 403 
Line 403 
         xfree(name);          xfree(name);
 }  }
   
 void  static void
 process_close(void)  process_close(void)
 {  {
         u_int32_t id;          u_int32_t id;
Line 417 
Line 417 
         send_status(id, status);          send_status(id, status);
 }  }
   
 void  static void
 process_read(void)  process_read(void)
 {  {
         char buf[64*1024];          char buf[64*1024];
Line 457 
Line 457 
                 send_status(id, status);                  send_status(id, status);
 }  }
   
 void  static void
 process_write(void)  process_write(void)
 {  {
         u_int32_t id;          u_int32_t id;
Line 495 
Line 495 
         xfree(data);          xfree(data);
 }  }
   
 void  static void
 process_do_stat(int do_lstat)  process_do_stat(int do_lstat)
 {  {
         Attrib a;          Attrib a;
Line 520 
Line 520 
         xfree(name);          xfree(name);
 }  }
   
 void  static void
 process_stat(void)  process_stat(void)
 {  {
         process_do_stat(0);          process_do_stat(0);
 }  }
   
 void  static void
 process_lstat(void)  process_lstat(void)
 {  {
         process_do_stat(1);          process_do_stat(1);
 }  }
   
 void  static void
 process_fstat(void)  process_fstat(void)
 {  {
         Attrib a;          Attrib a;
Line 558 
Line 558 
                 send_status(id, status);                  send_status(id, status);
 }  }
   
 struct timeval *  static struct timeval *
 attrib_to_tv(Attrib *a)  attrib_to_tv(Attrib *a)
 {  {
         static struct timeval tv[2];          static struct timeval tv[2];
Line 570 
Line 570 
         return tv;          return tv;
 }  }
   
 void  static void
 process_setstat(void)  process_setstat(void)
 {  {
         Attrib *a;          Attrib *a;
Line 602 
Line 602 
         xfree(name);          xfree(name);
 }  }
   
 void  static void
 process_fsetstat(void)  process_fsetstat(void)
 {  {
         Attrib *a;          Attrib *a;
Line 637 
Line 637 
         send_status(id, status);          send_status(id, status);
 }  }
   
 void  static void
 process_opendir(void)  process_opendir(void)
 {  {
         DIR *dirp = NULL;          DIR *dirp = NULL;
Line 669 
Line 669 
 /*  /*
  * drwxr-xr-x    5 markus   markus       1024 Jan 13 18:39 .ssh   * drwxr-xr-x    5 markus   markus       1024 Jan 13 18:39 .ssh
  */   */
 char *  static char *
 ls_file(char *name, struct stat *st)  ls_file(char *name, struct stat *st)
 {  {
         int ulen, glen, sz = 0;          int ulen, glen, sz = 0;
Line 708 
Line 708 
         return xstrdup(buf);          return xstrdup(buf);
 }  }
   
 void  static void
 process_readdir(void)  process_readdir(void)
 {  {
         DIR *dirp;          DIR *dirp;
Line 762 
Line 762 
         }          }
 }  }
   
 void  static void
 process_remove(void)  process_remove(void)
 {  {
         char *name;          char *name;
Line 779 
Line 779 
         xfree(name);          xfree(name);
 }  }
   
 void  static void
 process_mkdir(void)  process_mkdir(void)
 {  {
         Attrib *a;          Attrib *a;
Line 799 
Line 799 
         xfree(name);          xfree(name);
 }  }
   
 void  static void
 process_rmdir(void)  process_rmdir(void)
 {  {
         u_int32_t id;          u_int32_t id;
Line 815 
Line 815 
         xfree(name);          xfree(name);
 }  }
   
 void  static void
 process_realpath(void)  process_realpath(void)
 {  {
         char resolvedname[MAXPATHLEN];          char resolvedname[MAXPATHLEN];
Line 840 
Line 840 
         xfree(path);          xfree(path);
 }  }
   
 void  static void
 process_rename(void)  process_rename(void)
 {  {
         u_int32_t id;          u_int32_t id;
Line 862 
Line 862 
         xfree(newpath);          xfree(newpath);
 }  }
   
 void  static void
 process_readlink(void)  process_readlink(void)
 {  {
         u_int32_t id;          u_int32_t id;
Line 886 
Line 886 
         xfree(path);          xfree(path);
 }  }
   
 void  static void
 process_symlink(void)  process_symlink(void)
 {  {
         u_int32_t id;          u_int32_t id;
Line 908 
Line 908 
         xfree(newpath);          xfree(newpath);
 }  }
   
 void  static void
 process_extended(void)  process_extended(void)
 {  {
         u_int32_t id;          u_int32_t id;
Line 922 
Line 922 
   
 /* stolen from ssh-agent */  /* stolen from ssh-agent */
   
 void  static void
 process(void)  process(void)
 {  {
         u_int msg_len;          u_int msg_len;

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28