Deleted Added
full compact
sftp-client.c (98675) sftp-client.c (98937)
1/*
2 * Copyright (c) 2001,2002 Damien Miller. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 16 unchanged lines hidden (view full) ---

25/* XXX: memleaks */
26/* XXX: signed vs unsigned */
27/* XXX: remove all logging, only return status codes */
28/* XXX: copy between two remote sites */
29
30#include "includes.h"
31RCSID("$OpenBSD: sftp-client.c,v 1.32 2002/06/09 13:32:01 markus Exp $");
32
1/*
2 * Copyright (c) 2001,2002 Damien Miller. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 16 unchanged lines hidden (view full) ---

25/* XXX: memleaks */
26/* XXX: signed vs unsigned */
27/* XXX: remove all logging, only return status codes */
28/* XXX: copy between two remote sites */
29
30#include "includes.h"
31RCSID("$OpenBSD: sftp-client.c,v 1.32 2002/06/09 13:32:01 markus Exp $");
32
33#include <sys/queue.h>
33#include "openbsd-compat/fake-queue.h"
34
35#include "buffer.h"
36#include "bufaux.h"
37#include "getput.h"
38#include "xmalloc.h"
39#include "log.h"
40#include "atomicio.h"
41

--- 882 unchanged lines hidden (view full) ---

924 error("Couldn't write to \"%s\": %s", local_path,
925 strerror(write_errno));
926 status = -1;
927 do_close(conn, handle, handle_len);
928 } else {
929 status = do_close(conn, handle, handle_len);
930
931 /* Override umask and utimes if asked */
34
35#include "buffer.h"
36#include "bufaux.h"
37#include "getput.h"
38#include "xmalloc.h"
39#include "log.h"
40#include "atomicio.h"
41

--- 882 unchanged lines hidden (view full) ---

924 error("Couldn't write to \"%s\": %s", local_path,
925 strerror(write_errno));
926 status = -1;
927 do_close(conn, handle, handle_len);
928 } else {
929 status = do_close(conn, handle, handle_len);
930
931 /* Override umask and utimes if asked */
932#ifdef HAVE_FCHMOD
932 if (pflag && fchmod(local_fd, mode) == -1)
933 if (pflag && fchmod(local_fd, mode) == -1)
934#else
935 if (pflag && chmod(local_path, mode) == -1)
936#endif /* HAVE_FCHMOD */
933 error("Couldn't set mode on \"%s\": %s", local_path,
934 strerror(errno));
935 if (pflag && (a->flags & SSH2_FILEXFER_ATTR_ACMODTIME)) {
936 struct timeval tv[2];
937 tv[0].tv_sec = a->atime;
938 tv[1].tv_sec = a->mtime;
939 tv[0].tv_usec = tv[1].tv_usec = 0;
940 if (utimes(local_path, tv) == -1)

--- 177 unchanged lines hidden ---
937 error("Couldn't set mode on \"%s\": %s", local_path,
938 strerror(errno));
939 if (pflag && (a->flags & SSH2_FILEXFER_ATTR_ACMODTIME)) {
940 struct timeval tv[2];
941 tv[0].tv_sec = a->atime;
942 tv[1].tv_sec = a->mtime;
943 tv[0].tv_usec = tv[1].tv_usec = 0;
944 if (utimes(local_path, tv) == -1)

--- 177 unchanged lines hidden ---