aboutsummaryrefslogtreecommitdiff
path: root/src/scp.c
AgeCommit message (Collapse)AuthorFilesLines
2023-06-28scp: Make sure arguments are saneJakub Jelen1-1/+1
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Norbert Pocs <npocs@redhat.com>
2022-10-12Fix various spelling issues reported by codespellJakub Jelen1-1/+1
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2022-10-07SSH_LOG_DEBUG: Recategorize loglevelsNorbert Pocs1-4/+4
Loglevel INFO is the default openssh configuration setting which does not print redundant information. On a system using openssh with loglevels set by the terms of openssh will cause unwanted log lines in the output. recategorized based on - SSH_LOG_DEBUG are informational debug logs (no error) Signed-off-by: Norbert Pocs <npocs@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-06-09Deprecate duplicate/ unused functionsSahana Prasad1-1/+0
and fix obvious naming mistakes, mostly in documentation Signed-off-by: Sahana Prasad <sahana@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-05-02Fix multiple spelling and grammar mistakesJunda Ai1-9/+9
Signed-off-by: Junda Ai <aijunda29@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2022-01-03libssh: Deprecate the SCP APIAndreas Schneider1-3/+53
See also https://lists.mindrot.org/pipermail/openssh-unix-dev/2021-September/039616.html Fixes #91 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2021-06-01scp: Avoid allocate 8KB stack buffer in ssh_scp_deny_requestXiang Xiao1-3/+11
since ssh_scp_deny_request is seldom called, let's utilize malloc to reserve the precise size memory. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Change-Id: I8e7a6d3153cff7691329b9487cd534a7f2887a35
2021-05-27Replace the hardcode max path length with PATH_MAXXiang Xiao1-4/+4
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Change-Id: Icb1d36b48a759ec11dbaa4c09a39037a80ab0f85
2019-12-09scp: Do not allow newlines in pushed files namesAnderson Toshiyuki Sasaki1-9/+74
When pushing files or directories, encode the newlines contained in the names as the string "\\n". This way the user cannot inject protocol messages through the file name. Fixes T189 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-12-09SSH-01-006: Add missing NULL check in ssh_scp_push_directory()Andreas Schneider1-0/+11
Fixes T193 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-12-09SSH-01-006: Add missing NULL checks in ssh_scp_push_file64()Andreas Schneider1-0/+9
Fixes T193 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-12-09CVE-2019-14889: scp: Quote location to be used on shellAnderson Toshiyuki Sasaki1-6/+56
Single quote file paths to be used on commands to be executed on remote shell. Fixes T181 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-09CVE-2019-14889: scp: Don't allow file path longer than 32kbAndreas Schneider1-0/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-12-09CVE-2019-14889: scp: Log SCP warnings received from the serverAnderson Toshiyuki Sasaki1-64/+11
Fixes T181 Previously, warnings received from the server were ignored. With this change the warning message sent by the server will be logged. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-09CVE-2019-14889: scp: Reformat scp.cAnderson Toshiyuki Sasaki1-502/+698
Fixes T181 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-28Remove vim modelines from all filesAndreas Schneider1-2/+0
If you want modelines use my vim plugin: https://github.com/cryptomilk/git-modeline.vim git config --add vim.modeline "ts=4 sw=4 et" Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-05Revert f2c2687ca6c6c7e25c9a547227027ab28eb4fc16Aris Adamantiadis1-1/+1
Fix bug #142 The mode does need to be an octal numeric string. Mode 0600 now gets sent on the wire as 0384, triggering a "scp: protocol error: bad mode" response, and an "scp status code 1d not valid" message from libssh.
2014-02-02src: Define MAX_BUF_SIZE globally and use it.Joseph Southwell1-2/+2
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-10-18scp: Fixed result of ssh_scp_string_mode() to get SCP working.Oliver Stöneberg1-1/+1
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-08-12scp: Document more scp functionts.Andreas Schneider1-3/+31
2013-07-22scp: Cast return value from uint64_t to size_t.Andreas Schneider1-1/+1
2013-07-14src: Migrate to SSH_LOG.Andreas Schneider1-4/+4
2012-10-12scp: Make sure buffer is initialzed.Andreas Schneider1-1/+1
Found by Coverity.
2012-10-09scp: Check return value of ssh_channel_poll.Andreas Schneider1-1/+5
Found by Coverity.
2011-09-18priv: Remove crypto.h and add correct includes to src files.Andreas Schneider1-0/+3
2011-09-18scp: introduce a 64bits getter to respect ABIAris Adamantiadis1-1/+14
2011-09-02scp: Fixed documentation bug #9Aris Adamantiadis1-2/+6
2011-08-08Fixed ssh_scp_write so it works when doing recursive copyEinar Floystad Dorum1-11/+19
There where two issues with ssh_scp_write: 1) It did not write a status message after the last write and OpenSSH would then give up after the write finished. 2) OpenSSH would sometimes write a status message, after near ends write. If scp_write didn't handle it, and subsequent status message. The remote window would shrink to zero and ssh_channel_write would start returning 0. Signed-off-by: Einar Floystad Dorum <einarfd@mailthief.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2011-05-20scp: Fixed documentation bugs. bug #8Aris Adamantiadis1-0/+4
2011-04-15scp: More correct fix for snprintf 64-bit format.Andreas Schneider1-2/+2
2011-04-15scp: Fix snprintf format for 64-bit size on SCP push.Mark Riordan1-2/+2
Signed-off-by: Mark Riordan <mriordan@ipswitch.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2011-04-15scp: Support huge files by changing size to 64-bit type.Mark Riordan1-7/+28
Signed-off-by: Mark Riordan <mriordan@ipswitch.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2011-04-14scp: Fix potential infinite loop in ssh_scp_closeMark Riordan1-1/+1
Signed-off-by: Mark Riordan <mriordan@ipswitch.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2011-01-02scp: Fixed a build warning on Windows.Andreas Schneider1-1/+1
2010-09-06misc: Rename libssh/ to src/Andreas Schneider1-0/+752