History log of /openbsd/usr.bin/ssh/sftp.c (Results 1 – 25 of 238)
Revision Date Author Comments
# f7fc6678 30-Apr-2024 djm <djm@openbsd.org>

flush stdout after writing "sftp>" prompt when not using editline.

From Alpine Linux via GHPR480


# 51c7ecbc 01-Feb-2024 djm <djm@openbsd.org>

whitespace


# 6f876756 10-Sep-2023 djm <djm@openbsd.org>

rename remote_glob() -> sftp_glob() to match other API


# 19766334 08-Sep-2023 djm <djm@openbsd.org>

the sftp code was one of my first contributions to OpenSSH and it
shows - the function names are terrible.

Rename do_blah() to sftp_blah() to make them less so.

Completely mechanical except for sft

the sftp code was one of my first contributions to OpenSSH and it
shows - the function names are terrible.

Rename do_blah() to sftp_blah() to make them less so.

Completely mechanical except for sftp_stat() and sftp_lstat() which
change from returning a pointer to a static variable (error-prone) to
taking a pointer to a caller-provided receiver.

show more ...


# de20c680 12-Apr-2023 jsg <jsg@openbsd.org>

fix double words
ok dtucker@


# 1407ce59 06-Apr-2023 djm <djm@openbsd.org>

don't care about glob() return value here.


# 2e8fc46f 31-Mar-2023 dtucker <dtucker@openbsd.org>

Explictly ignore return codes where we don't check them. From Dmitry
Belyavskiy via github PR#238, ok djm@


# 70c668cf 29-Mar-2023 dtucker <dtucker@openbsd.org>

Plug another potential mem leak in process_put. It allocates abs_dst
inside a loop but only frees it on exit, so free inside the loop if
necessary. Coverity CID 291837, ok djm@


# 03eaa8d0 28-Mar-2023 dtucker <dtucker@openbsd.org>

Plug more mem leaks in sftp by making make_absolute_pwd_glob work in
the same way as make_absolute: you pass it a dynamically allocated string
and it either returns it, or frees it and allocates a ne

Plug more mem leaks in sftp by making make_absolute_pwd_glob work in
the same way as make_absolute: you pass it a dynamically allocated string
and it either returns it, or frees it and allocates a new one.
Patch from emaste at freebsd.org and https://reviews.freebsd.org/D37253
ok djm@

show more ...


# e3b8965f 12-Mar-2023 dtucker <dtucker@openbsd.org>

calloc can return NULL but xcalloc cannot. From Coverity CID 291881,
ok djm@


# 8eb132fc 08-Mar-2023 dtucker <dtucker@openbsd.org>

Plug mem leak. Coverity CID 405196, ok djm@


# 5b133f3f 08-Mar-2023 guenther <guenther@openbsd.org>

Delete obsolete /* ARGSUSED */ lint comments.

ok miod@ millert@


# deb51e2e 27-Feb-2023 dtucker <dtucker@openbsd.org>

Plug mem leak on globbed ls error path. Spotted by Coverity, ok deraadt@


# f2e3f6b6 05-Jan-2023 djm <djm@openbsd.org>

suppress "Connection closed" message when in quiet mode


# ac54cadc 16-Dec-2022 jmc <jmc@openbsd.org>

add -X to usage();


# 50276ae1 16-Dec-2022 djm <djm@openbsd.org>

add a -X option to both scp(1) and sftp(1) to allow control over
some SFTP protocol knobs: the copy buffer length and the number of
inflight requests, both of which are used during upload/download.

add a -X option to both scp(1) and sftp(1) to allow control over
some SFTP protocol knobs: the copy buffer length and the number of
inflight requests, both of which are used during upload/download.

Previously these could be controlled in sftp(1) using the -b/-R options.
This makes them available in both SFTP protocol clients using the same
option character sequence.

ok dtucker@

show more ...


# 38e6e118 19-Sep-2022 djm <djm@openbsd.org>

use users-groups-by-id@openssh.com sftp-server extension (when
available) to fill in user/group names for directory listings.
Implement a client-side cache of see uid/gid=>user/group names.
ok markus@


# 19945a1b 19-Sep-2022 djm <djm@openbsd.org>

extend sftp-common.c:extend ls_file() to support supplied user/group
names; ok markus@


# 7dafd2ae 16-Sep-2022 djm <djm@openbsd.org>

sftp: Be a bit more clever about completions

There are commands (e.g. "get" or "put") that accept two
arguments, a local path and a remote path. However, the way
current completion is written doesn'

sftp: Be a bit more clever about completions

There are commands (e.g. "get" or "put") that accept two
arguments, a local path and a remote path. However, the way
current completion is written doesn't take this distinction into
account and always completes remote or local paths.

By expanding CMD struct and "cmds" array this distinction can be
reflected and with small adjustment to completer code the correct
path can be completed.

By Michal Privoznik, ok dtucker@

show more ...


# fbd6bc21 16-Sep-2022 djm <djm@openbsd.org>

sftp: Don't attempt to complete arguments for non-existent commands

If user entered a non-existent command (e.g. because they made a
typo) there is no point in trying to complete its arguments. Skip

sftp: Don't attempt to complete arguments for non-existent commands

If user entered a non-existent command (e.g. because they made a
typo) there is no point in trying to complete its arguments. Skip
calling complete_match() if that's the case.

From Michal Privoznik

show more ...


# e33679eb 28-Jun-2022 jmc <jmc@openbsd.org>

reflect the update to -D arg name in usage();


# 0505fcb8 27-Jun-2022 djm <djm@openbsd.org>

allow arguments to sftp -D option, e.g.
sftp -D "/usr/libexec/sftp-server -el debug3"

ok markus@


# 457a03da 13-May-2022 djm <djm@openbsd.org>

arrange for scp, when in sftp mode, to not ftruncate(3) files early

previous behavious of unconditionally truncating the destination file
would cause "scp ~/foo localhost:" and "scp localhost:foo ~/

arrange for scp, when in sftp mode, to not ftruncate(3) files early

previous behavious of unconditionally truncating the destination file
would cause "scp ~/foo localhost:" and "scp localhost:foo ~/" to
delete all the contents of their destination.

spotted by solene@ sthen@, also bz3431; ok dtucker@

show more ...


# e3531857 08-May-2022 djm <djm@openbsd.org>

When performing operations that glob(3) a remote path, ensure that the
implicit working directory used to construct that path escapes glob(3)
characters.

This prevents glob characters from being pro

When performing operations that glob(3) a remote path, ensure that the
implicit working directory used to construct that path escapes glob(3)
characters.

This prevents glob characters from being processed in places they
shouldn't, e.g. "cd /tmp/a*/", "get *.txt" should have the get operation
treat the path "/tmp/a*" literally and not attempt to expand it.

Reported by Lusia Kundel; ok markus@

show more ...


# cad94307 31-Mar-2022 djm <djm@openbsd.org>

add a sftp client "cp" command that supports server-side copying
of files. Useful for this task and for testing the copy-data
extension. Patch from Mike Frysinger; ok dtucker@


12345678910