diff options
author | djm@openbsd.org <djm@openbsd.org> | 2023-09-08 07:56:13 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2023-09-08 07:59:08 +0200 |
commit | 2de990142a83bf60ef694378b8598706bc654b08 (patch) | |
tree | f1fcdc8f2df9dc285e22456fb82188d4019ea7b5 /sftp-glob.c | |
parent | upstream: fix scp in SFTP mode recursive upload and download of (diff) | |
download | openssh-2de990142a83bf60ef694378b8598706bc654b08.tar.xz openssh-2de990142a83bf60ef694378b8598706bc654b08.zip |
upstream: 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.
OpenBSD-Commit-ID: eb54d6a72d0bbba4d623e2175cf5cc4c75dc2ba4
Diffstat (limited to 'sftp-glob.c')
-rw-r--r-- | sftp-glob.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sftp-glob.c b/sftp-glob.c index afeb15f9e..616168581 100644 --- a/sftp-glob.c +++ b/sftp-glob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-glob.c,v 1.31 2022/10/24 21:51:55 djm Exp $ */ +/* $OpenBSD: sftp-glob.c,v 1.32 2023/09/08 05:56:13 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> * @@ -51,7 +51,7 @@ fudge_opendir(const char *path) r = xcalloc(1, sizeof(*r)); - if (do_readdir(cur.conn, path, &r->dir)) { + if (sftp_readdir(cur.conn, path, &r->dir)) { free(r); return(NULL); } @@ -103,32 +103,32 @@ fudge_readdir(struct SFTP_OPENDIR *od) static void fudge_closedir(struct SFTP_OPENDIR *od) { - free_sftp_dirents(od->dir); + sftp_free_dirents(od->dir); free(od); } static int fudge_lstat(const char *path, struct stat *st) { - Attrib *a; + Attrib a; - if (!(a = do_lstat(cur.conn, path, 1))) - return(-1); + if (sftp_lstat(cur.conn, path, 1, &a) != 0) + return -1; - attrib_to_stat(a, st); + attrib_to_stat(&a, st); - return(0); + return 0; } static int fudge_stat(const char *path, struct stat *st) { - Attrib *a; + Attrib a; - if (!(a = do_stat(cur.conn, path, 1))) - return(-1); + if (sftp_stat(cur.conn, path, 1, &a) != 0) + return -1; - attrib_to_stat(a, st); + attrib_to_stat(&a, st); return(0); } |