search for: do_upload

Displaying 20 results from an estimated 20 matches for "do_upload".

2002 Feb 06
2
SFTP Status Bar..
...,6 +795,7 @@ offset += len; xfree(data); + statbytes = offset; } status = do_close(fd_in, fd_out, handle, handle_len); @@ -807,15 +818,18 @@ } done: + if (progressbar) + (progressbar)(1); close(local_fd); buffer_free(&msg); xfree(handle); + return status; } int do_upload(int fd_in, int fd_out, char *local_path, char *remote_path, - int pflag) + int pflag, void (*progressbar)(int)) { int local_fd; u_int handle_len, id; @@ -865,6 +879,10 @@ buffer_free(&msg); return(-1); } + totalbytes = a.size; + curfile = local_path; + if (progressbar) + (p...
2002 Feb 02
0
Version two of progressbar for scp/sftp
...tatbytes = offset; } status = do_close(fd_in, fd_out, handle, handle_len); @@ -802,15 +813,21 @@ } done: + if (progressbar) + (progressbar)(1); close(local_fd); buffer_free(&msg); xfree(handle); + statbytes = 0; + totalbytes = 0; + curfile = NULL; + return status; } int do_upload(int fd_in, int fd_out, char *local_path, char *remote_path, - int pflag) + int pflag, void (*progressbar)(int)) { int local_fd; u_int handle_len, id; @@ -860,6 +877,10 @@ buffer_free(&msg); return(-1); } + totalbytes = a.size; + curfile = local_path; + if (progressbar) + (p...
2003 Oct 30
2
sftp client reget reput
...offset = 0; + +#ifdef REGET + if (rflag) { + long posn; + posn = lseek(local_fd, 0L, SEEK_END); + debug3("reget: restarting at file position %ld\n", posn); + offset = (u_int64_t)posn; + } +#endif + max_req = 1; progress_counter = 0; @@ -969,8 +990,13 @@ } int +#ifdef REGET +do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, + int pflag, int rflag) +#else do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, int pflag) +#endif { int local_fd, status; u_int handle_len, id, type; @@ -1023,6 +1049,13 @@ buffer_put_char(&msg,...
2007 May 14
0
[PATCH] Adds support for Append command (SSH_FXF_APPEND) to sftp_client
...t; command in a sftp session, as describe in "draft-ietf-secsh-filexfer-01" and further releases. It is for and had been tested on the current version of OpenSSH (the Portable CVS) and it works, also against non patched versions. The patch is "simple" it it just like the "do_upload" function in "sftp-client.c". Pseudo Instruction of the new "do_append" function: 1) stat_remote_file This will return an Attrib struct to know the remote file size. 2) open_remote_file Open the remote file without the "SSH2_FXF_TRUNC" flag...
2019 Jun 21
2
sftp client: upload from pipe
...stdin /directory/filename') -i ~/.ssh/key user at remote.host sftp> put /dev/stdin /directory/filename /dev/stdin is not a regular file What is a purpose for such a behaviour and limitation? As experiment, I removed following piece of code which is responsible for this check (sftp-client.c, do_upload() function): if (!S_ISREG(sb.st_mode)) { error("%s is not a regular file", local_path); close(local_fd); return(-1); } and nothing bad happened. It was still possible to upload regular files, but additionaly there was an op...
2002 Nov 05
0
[PATCH] Add getlink command to sftp
...******** *** 90,97 **** /* Rename 'oldpath' to 'newpath' */ int do_symlink(struct sftp_conn *, char *, char *); /* Return target of symlink 'path' - caller must free result */ ! char *do_readlink(struct sftp_conn *, char *); /* XXX: add callbacks to do_download/do_upload so we can do progress meter */ --- 90,100 ---- /* Rename 'oldpath' to 'newpath' */ int do_symlink(struct sftp_conn *, char *, char *); + /* Download symlink 'path' */ + int do_getlink(struct sftp_conn *, char *); + /* Return target of symlink 'path' - ca...
2003 Oct 01
1
3.7.1p2 sftp recurse patch
...+ local_tmp = path_append(local_path, f->d_name); + remote_tmp = path_append(remote_path, f->d_name); + err = do_recursive_upload(conn, local_tmp, remote_tmp, + pflag); + xfree(remote_tmp); + xfree(local_tmp); + if (err == -1) + break; + } + closedir(d); + } else + err = do_upload(conn, local_path, remote_path, pflag); +END: + return err; +} + +static int process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd, int pflag) { char *abs_src = NULL; @@ -482,7 +588,7 @@ abs_dst = tmp; printf("Fetching %s to %s\n", g.gl_pathv[i], abs_dst); - if...
2007 Jan 22
3
[Bug 1252] sftp returns 0 when upload is unsuccessful due to a full device
...| ------- Comment #1 from djm at mindrot.org 2007-01-22 18:03 ------- Created an attachment (id=1232) --> (http://bugzilla.mindrot.org/attachment.cgi?id=1232&action=view) propogate error status on upload falure Thanks for the report. This is a bug in sftp-client.c:do_upload(). The error status on a write failure was not being returned to the caller. BTW in interactive mode (the default when sftp is started for a tty), the return value will be zero anyway because the sftp client exits normally. A better demonstration is batch mode, where the sftp client's exit sta...
2002 Apr 01
0
[Bug 196] New: wront sent message id on upload
...le OpenSSH Version: -current Platform: All OS/Version: other Status: NEW Severity: major Priority: P2 Component: sftp AssignedTo: openssh-unix-dev at mindrot.org ReportedBy: chombier at mac.com In sftp_client.c, do_upload() function, the 'id' variable is used for both the sent and the received message ids, this corrupts the id of the messages to send and randomly generates upload failures. The fix is to use another variable to extract the received message id, status_id, as done in do_download() ------...
2002 Jan 30
1
Quick sftp status indicator.
...- printf("Fetching %s to %s\n", g.gl_pathv[0], abs_dst); err = do_download(in, out, g.gl_pathv[0], abs_dst, pflag); goto out; } @@ -464,7 +463,6 @@ } abs_dst = make_absolute(abs_dst, pwd); } - printf("Uploading %s to %s\n", g.gl_pathv[0], abs_dst); err = do_upload(in, out, g.gl_pathv[0], abs_dst, pflag); goto out; }
2017 Jan 26
2
[PATCH v2 0/2] Fix srandom issues.
A better way to solve this I think. Rich.
2002 Feb 05
3
COPY_SIZE #define
...rite at at time during copies */ /* XXX: what should this be? */ -#define COPY_SIZE 8192 +/* MTB: get around the issue by using a dynamic value with the same default. */ +/* #define COPY_SIZE 8129 */ +extern unsigned int COPY_SIZE; /* Message ID */ static u_int msg_id = 1; @@ -870,7 +872,11 @@ do_upload(int fd_in, int fd_out, char *l offset = 0; for(;;) { int len; - char data[COPY_SIZE]; + char *data; + + if ((data = malloc(COPY_SIZE)) == NULL) + fatal("Couldn't allocate %ld bytes for data buffer; %s", + (long)COPY_SIZE, strerror(errno)); /* * Can't use...
2008 Jul 21
2
sftp needs a long time for sending a filelist
Hello all Im using sftp 1:4.7p1-8ubuntu1.2 in a batchjob Ive noticed that sftp needs a long time for sending a filelist. The timespan increases exponential if many files are on the remoteserver. for example "ls -la *.txt" needs 10 seconds for 2000 files but needs 50 seconds for 4000 files. For 150.000 Files i have to wait 15 minutes for example but the
2009 Feb 12
2
[patch 1/3] add protocol extension to ATTR message
...us messages */ #define SSH2_FX_OK 0 #define SSH2_FX_EOF 1 Index: ssh/sftp-client.c =================================================================== --- ssh.orig/sftp-client.c 2009-02-12 14:11:30.000000000 +0100 +++ ssh/sftp-client.c 2009-02-12 14:11:37.000000000 +0100 @@ -1201,6 +1201,7 @@ do_upload(struct sftp_conn *conn, char * } stat_to_attrib(&sb, &a); + a.ext_flags = 0; a.flags &= ~SSH2_FILEXFER_ATTR_SIZE; a.flags &= ~SSH2_FILEXFER_ATTR_UIDGID; a.perm &= 0777;
2001 Apr 24
10
Call for testing for coming 2.9 release.
If we can get people to test their platforms against the last snapshot/cvs tree I'd be greatful. (http://www.openssh.com/portable.html) I know NeXT platform has problems. I'm going to spend tonight looking at it. Also, take a moment to see what manpage type ./configure decided for your system and if it's 'cat' please let us know. Thanks. - Ben
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...ev = STREQLEN (pathordevice, "/dev/", 5); buf = is_dev ? strdup (pathordevice) : sysroot_path (pathordevice); if (buf == NULL) { diff --git a/daemon/upload.c b/daemon/upload.c index da86bd6..7b2ccea 100644 --- a/daemon/upload.c +++ b/daemon/upload.c @@ -40,7 +40,7 @@ do_upload (const char *filename) { int err, fd, r, is_dev; - is_dev = strncmp (filename, "/dev/", 5) == 0; + is_dev = STREQLEN (filename, "/dev/", 5); if (!is_dev) { if (!root_mounted || filename[0] != '/') { cancel_receive (); @@ -93,7 +93,7 @@ do_download (...
2009 Aug 12
23
[PATCH 0/23] factor and const-correctness
This started as a simple warning-elimination change. I'll get back to that series shortly ;-) It turned into a factorization and constification exercise during which I got a taste of ocaml. Thanks to Rich Jones for help with a few snippets in generator.ml. The overall result is that many previously-manually-maintained bits from daemon/*.c functions are now hoisted into the automatically-
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...rs); \ - } \ - } while (0) + } while (0) /* Is it a device? */ if (len < 5 || STREQLEN (text, "/dev/", 5)) { diff --git a/fish/file-edit.c b/fish/file-edit.c index a703021..3978c1b 100644 --- a/fish/file-edit.c +++ b/fish/file-edit.c @@ -252,7 +252,7 @@ do_upload (guestfs_h *g, const char *fn, const char *tempfile, * file to match the old file (RHBZ#788641). */ if (guestfs_copy_attributes (g, filename, newname, - GUESTFS_COPY_ATTRIBUTES_ALL, 1, -1) == -1) + GUESTFS_COPY_ATTRIBUTES_ALL, 1, -1) == -1) return -1; /* Backup or...
2015 Oct 05
3
[PATCH 1/2] Change 'fprintf (stdout,...)' -> printf.
Result of earlier copy and paste. --- align/scan.c | 35 ++++++++++--------- cat/cat.c | 39 +++++++++++---------- cat/filesystems.c | 69 +++++++++++++++++++------------------- cat/log.c | 35 ++++++++++--------- cat/ls.c | 61 +++++++++++++++++---------------- df/main.c | 43 ++++++++++++------------ diff/diff.c | 67
2017 Jan 25
10
[PATCH v2 0/7] Rename src/ to lib/ and move common code to common/
Previous patch series was posted here: https://www.redhat.com/archives/libguestfs/2017-January/msg00059.html v2 simply extends this patch series to cover the extra directories common/edit, common/progress, common/windows and common/parallel. The only remaining item is to consider whether we should rename mllib to something else, mlcommon was my suggestion. Rich.