diff options
author | Ryo Nakamura <upa@haeena.net> | 2023-08-30 19:09:29 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2023-08-30 19:09:29 +0900 |
commit | 13ec6521957ab0faadff36353d1ff3c8e0ac03ce (patch) | |
tree | e832e996d198a37531983d1d41629580141401ed /src | |
parent | 6b45cf7c9ccbdcb75f150d060652ef9e9d5f2dd4 (diff) |
fix mscp_opendir, do not use `tls_sftp`, use `sftp` isntead.
The fixed issue causes mscp_opendir wrongly calls opendir() for
local when tls_sftp is NULL although sftp is not NULL.
Diffstat (limited to 'src')
-rw-r--r-- | src/fileops.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/fileops.c b/src/fileops.c index d9587ef..39d0801 100644 --- a/src/fileops.c +++ b/src/fileops.c @@ -72,8 +72,8 @@ MDIR *mscp_opendir(const char *path, sftp_session sftp) return NULL; memset(md, 0, sizeof(*md)); - if (tls_sftp) { - md->remote = sftp_opendir(tls_sftp, path); + if (sftp) { + md->remote = sftp_opendir(sftp, path); sftp_err_to_errno(sftp); if (!md->remote) { goto free_out; @@ -146,8 +146,6 @@ int mscp_mkdir(const char *path, mode_t mode, sftp_session sftp) if (sftp) { ret = sftp_mkdir(sftp, path, mode); - fprintf(stderr, "after sftp_mkdir(%s), sftp_get_error is %d\n", - path, sftp_get_error(sftp)); sftp_err_to_errno(sftp); } else ret = mkdir(path, mode); |