* 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
* 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"
{
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;
}
}
int
-handle_from_string(char *handle, int hlen)
+handle_from_string(char *handle, u_int hlen)
{
/* XXX OVERFLOW ? */
char *ep;
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);
{
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;
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();
{
fd_set rset, wset;
int in, out, max;
- size_t len, olen;
+ ssize_t len, olen;
handle_init();