summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sftp-server.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@cvs.openbsd.org>2001-02-04 22:21:20 +0000
committerKevin Steves <stevesk@cvs.openbsd.org>2001-02-04 22:21:20 +0000
commit8cd0e5000d6a95628dd56214b1e80da0dfe44aff (patch)
treec81215f9b67a93b0d0b9ca44fe98458d3f33ca06 /usr.bin/ssh/sftp-server.c
parent165492e73f6ec08f22c908f5ae7fc66ac50abb95 (diff)
SSH2_FILEXFER_ATTR_UIDGID support; ok markus@
Diffstat (limited to 'usr.bin/ssh/sftp-server.c')
-rw-r--r--usr.bin/ssh/sftp-server.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/ssh/sftp-server.c b/usr.bin/ssh/sftp-server.c
index 3428b1c5bec..29d96150c2b 100644
--- a/usr.bin/ssh/sftp-server.c
+++ b/usr.bin/ssh/sftp-server.c
@@ -22,7 +22,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "includes.h"
-RCSID("$OpenBSD: sftp-server.c,v 1.17 2001/02/04 15:32:25 stevesk Exp $");
+RCSID("$OpenBSD: sftp-server.c,v 1.18 2001/02/04 22:21:19 stevesk Exp $");
#include "buffer.h"
#include "bufaux.h"
@@ -557,6 +557,11 @@ process_setstat(void)
if (ret == -1)
status = errno_to_portable(errno);
}
+ if (a->flags & SSH2_FILEXFER_ATTR_UIDGID) {
+ ret = chown(name, a->uid, a->gid);
+ if (ret == -1)
+ status = errno_to_portable(errno);
+ }
send_status(id, status);
xfree(name);
}
@@ -587,6 +592,11 @@ process_fsetstat(void)
if (ret == -1)
status = errno_to_portable(errno);
}
+ if (a->flags & SSH2_FILEXFER_ATTR_UIDGID) {
+ ret = fchown(fd, a->uid, a->gid);
+ if (ret == -1)
+ status = errno_to_portable(errno);
+ }
}
send_status(id, status);
}