summaryrefslogtreecommitdiff
path: root/sftp-server.c
diff options
context:
space:
mode:
Diffstat (limited to 'sftp-server.c')
-rw-r--r--sftp-server.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/sftp-server.c b/sftp-server.c
index 39cecac59..c5cd47b7d 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -9,11 +9,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Markus Friedl.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -27,7 +22,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
-RCSID("$OpenBSD: sftp-server.c,v 1.4 2000/09/04 19:10:08 markus Exp $");
+RCSID("$OpenBSD: sftp-server.c,v 1.6 2000/09/07 20:27:53 deraadt Exp $");
#include "ssh.h"
#include "buffer.h"
@@ -194,22 +189,22 @@ decode_attrib(Buffer *b)
{
static Attrib a;
attrib_clear(&a);
- a.flags = get_int();
+ a.flags = buffer_get_int(b);
if (a.flags & SSH_FXA_HAVE_SIZE) {
- a.size_high = get_int();
- a.size_low = get_int();
+ a.size_high = buffer_get_int(b);
+ a.size_low = buffer_get_int(b);
a.size = (((u_int64_t) a.size_high) << 32) + a.size_low;
}
if (a.flags & SSH_FXA_HAVE_UGID) {
- a.uid = get_int();
- a.gid = get_int();
+ a.uid = buffer_get_int(b);
+ a.gid = buffer_get_int(b);
}
if (a.flags & SSH_FXA_HAVE_PERM) {
- a.perm = get_int();
+ a.perm = buffer_get_int(b);
}
if (a.flags & SSH_FXA_HAVE_TIME) {
- a.atime = get_int();
- a.mtime = get_int();
+ a.atime = buffer_get_int(b);
+ a.mtime = buffer_get_int(b);
}
return &a;
}
@@ -321,7 +316,7 @@ handle_to_string(int handle, char **stringp, int *hlenp)
}
int
-handle_from_string(char *handle, int hlen)
+handle_from_string(char *handle, u_int hlen)
{
/* XXX OVERFLOW ? */
char *ep;
@@ -380,7 +375,8 @@ int
get_handle(void)
{
char *handle;
- int hlen, val;
+ int val;
+ u_int hlen;
handle = get_string(&hlen);
val = handle_from_string(handle, hlen);
xfree(handle);
@@ -580,7 +576,7 @@ process_write(void)
{
u_int32_t id, off_high, off_low;
u_int64_t off;
- int len;
+ u_int len;
int handle, fd, ret, status = SSH_FX_FAILURE;
char *data;
@@ -722,8 +718,8 @@ process_fsetstat(void)
u_int32_t id;
int handle, fd, ret;
int status = SSH_FX_OK;
- char *name = NULL;
-
+ char *name;
+
id = get_int();
handle = get_handle();
a = get_attrib();
@@ -1017,7 +1013,7 @@ main(int ac, char **av)
{
fd_set rset, wset;
int in, out, max;
- size_t len, olen;
+ ssize_t len, olen;
handle_init();