mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-28 08:14:24 +02:00
- markus@cvs.openbsd.org 2002/02/13 00:28:13
[sftp-server.c] handle SSH2_FILEXFER_ATTR_SIZE in SSH2_FXP_(F)SETSTAT; ok djm@
This commit is contained in:
parent
5873dfd829
commit
00c9217558
@ -24,6 +24,9 @@
|
|||||||
[sftp-client.c]
|
[sftp-client.c]
|
||||||
Let overlapped upload path handle servers which reorder ACKs. This may be
|
Let overlapped upload path handle servers which reorder ACKs. This may be
|
||||||
permitted by the protocol spec; ok markus@
|
permitted by the protocol spec; ok markus@
|
||||||
|
- markus@cvs.openbsd.org 2002/02/13 00:28:13
|
||||||
|
[sftp-server.c]
|
||||||
|
handle SSH2_FILEXFER_ATTR_SIZE in SSH2_FXP_(F)SETSTAT; ok djm@
|
||||||
|
|
||||||
20020210
|
20020210
|
||||||
- (djm) OpenBSD CVS Sync
|
- (djm) OpenBSD CVS Sync
|
||||||
@ -7571,4 +7574,4 @@
|
|||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1845 2002/02/13 03:04:37 djm Exp $
|
$Id: ChangeLog,v 1.1846 2002/02/13 03:05:00 djm Exp $
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
|
* Copyright (c) 2000, 2001, 2002 Markus Friedl. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@ -22,7 +22,7 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: sftp-server.c,v 1.32 2001/12/29 21:56:01 stevesk Exp $");
|
RCSID("$OpenBSD: sftp-server.c,v 1.33 2002/02/13 00:28:13 markus Exp $");
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "bufaux.h"
|
#include "bufaux.h"
|
||||||
@ -589,6 +589,11 @@ process_setstat(void)
|
|||||||
name = get_string(NULL);
|
name = get_string(NULL);
|
||||||
a = get_attrib();
|
a = get_attrib();
|
||||||
TRACE("setstat id %d name %s", id, name);
|
TRACE("setstat id %d name %s", id, name);
|
||||||
|
if (a->flags & SSH2_FILEXFER_ATTR_SIZE) {
|
||||||
|
ret = truncate(name, a->size);
|
||||||
|
if (ret == -1)
|
||||||
|
status = errno_to_portable(errno);
|
||||||
|
}
|
||||||
if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) {
|
if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) {
|
||||||
ret = chmod(name, a->perm & 0777);
|
ret = chmod(name, a->perm & 0777);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
@ -626,6 +631,11 @@ process_fsetstat(void)
|
|||||||
if (fd < 0 || name == NULL) {
|
if (fd < 0 || name == NULL) {
|
||||||
status = SSH2_FX_FAILURE;
|
status = SSH2_FX_FAILURE;
|
||||||
} else {
|
} else {
|
||||||
|
if (a->flags & SSH2_FILEXFER_ATTR_SIZE) {
|
||||||
|
ret = ftruncate(fd, a->size);
|
||||||
|
if (ret == -1)
|
||||||
|
status = errno_to_portable(errno);
|
||||||
|
}
|
||||||
if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) {
|
if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) {
|
||||||
#ifdef HAVE_FCHMOD
|
#ifdef HAVE_FCHMOD
|
||||||
ret = fchmod(fd, a->perm & 0777);
|
ret = fchmod(fd, a->perm & 0777);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user