From: djm Date: Sun, 10 Sep 2023 23:12:32 +0000 (+0000) Subject: rename remote_glob() -> sftp_glob() to match other API X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6f876756a4f438f1acc2285ccef32119cbd18a0e;p=openbsd rename remote_glob() -> sftp_glob() to match other API --- diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index 6ad841c8341..2c2342edf91 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scp.c,v 1.258 2023/09/08 05:56:13 djm Exp $ */ +/* $OpenBSD: scp.c,v 1.259 2023/09/10 23:12:32 djm Exp $ */ /* * scp - secure remote copy. This is basically patched BSD rcp which * uses ssh to do the data transfer (instead of using rcmd). @@ -158,7 +158,7 @@ size_t sftp_nrequests; /* Needed for sftp */ volatile sig_atomic_t interrupted = 0; -int remote_glob(struct sftp_conn *, const char *, int, +int sftp_glob(struct sftp_conn *, const char *, int, int (*)(const char *, int), glob_t *); /* proto for sftp-glob.c */ static void @@ -1507,7 +1507,7 @@ sink_sftp(int argc, char *dst, const char *src, struct sftp_conn *conn) } debug3_f("copying remote %s to local %s", abs_src, dst); - if ((r = remote_glob(conn, abs_src, GLOB_NOCHECK|GLOB_MARK, + if ((r = sftp_glob(conn, abs_src, GLOB_NOCHECK|GLOB_MARK, NULL, &g)) != 0) { if (r == GLOB_NOSPACE) error("%s: too many glob matches", src); @@ -1932,7 +1932,7 @@ throughlocal_sftp(struct sftp_conn *from, struct sftp_conn *to, } debug3_f("copying remote %s to remote %s", abs_src, target); - if ((r = remote_glob(from, abs_src, GLOB_NOCHECK|GLOB_MARK, + if ((r = sftp_glob(from, abs_src, GLOB_NOCHECK|GLOB_MARK, NULL, &g)) != 0) { if (r == GLOB_NOSPACE) error("%s: too many glob matches", src); diff --git a/usr.bin/ssh/sftp-glob.c b/usr.bin/ssh/sftp-glob.c index 435acb9046e..a54a05c2e01 100644 --- a/usr.bin/ssh/sftp-glob.c +++ b/usr.bin/ssh/sftp-glob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-glob.c,v 1.32 2023/09/08 05:56:13 djm Exp $ */ +/* $OpenBSD: sftp-glob.c,v 1.33 2023/09/10 23:12:32 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -29,7 +29,7 @@ #include "sftp-common.h" #include "sftp-client.h" -int remote_glob(struct sftp_conn *, const char *, int, +int sftp_glob(struct sftp_conn *, const char *, int, int (*)(const char *, int), glob_t *); struct SFTP_OPENDIR { @@ -107,7 +107,7 @@ fudge_stat(const char *path, struct stat *st) } int -remote_glob(struct sftp_conn *conn, const char *pattern, int flags, +sftp_glob(struct sftp_conn *conn, const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob) { int r; diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c index baa309db63d..5a9921cda6c 100644 --- a/usr.bin/ssh/sftp.c +++ b/usr.bin/ssh/sftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.235 2023/09/08 05:56:13 djm Exp $ */ +/* $OpenBSD: sftp.c,v 1.236 2023/09/10 23:12:32 djm Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller * @@ -91,7 +91,7 @@ struct complete_ctx { char **remote_pathp; }; -int remote_glob(struct sftp_conn *, const char *, int, +int sftp_glob(struct sftp_conn *, const char *, int, int (*)(const char *, int), glob_t *); /* proto for sftp-glob.c */ /* Separators for interactive commands */ @@ -634,7 +634,7 @@ process_get(struct sftp_conn *conn, const char *src, const char *dst, memset(&g, 0, sizeof(g)); debug3("Looking up %s", abs_src); - if ((r = remote_glob(conn, abs_src, GLOB_MARK, NULL, &g)) != 0) { + if ((r = sftp_glob(conn, abs_src, GLOB_MARK, NULL, &g)) != 0) { if (r == GLOB_NOSPACE) { error("Too many matches for \"%s\".", abs_src); } else { @@ -950,7 +950,7 @@ do_globbed_ls(struct sftp_conn *conn, const char *path, memset(&g, 0, sizeof(g)); - if ((r = remote_glob(conn, path, + if ((r = sftp_glob(conn, path, GLOB_MARK|GLOB_NOCHECK|GLOB_BRACE|GLOB_KEEPSTAT|GLOB_NOSORT, NULL, &g)) != 0 || (g.gl_pathc && !g.gl_matchc)) { @@ -1591,7 +1591,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd, break; case I_RM: path1 = make_absolute_pwd_glob(path1, *pwd); - remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g); + sftp_glob(conn, path1, GLOB_NOCHECK, NULL, &g); for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if (!quiet) mprintf("Removing %s\n", g.gl_pathv[i]); @@ -1695,7 +1695,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd, attrib_clear(&a); a.flags |= SSH2_FILEXFER_ATTR_PERMISSIONS; a.perm = n_arg; - remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g); + sftp_glob(conn, path1, GLOB_NOCHECK, NULL, &g); for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if (!quiet) mprintf("Changing mode on %s\n", @@ -1709,7 +1709,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd, case I_CHOWN: case I_CHGRP: path1 = make_absolute_pwd_glob(path1, *pwd); - remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g); + sftp_glob(conn, path1, GLOB_NOCHECK, NULL, &g); for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if ((hflag ? sftp_lstat : sftp_stat)(conn, g.gl_pathv[i], 0, &aa) != 0) { @@ -1989,7 +1989,7 @@ complete_match(EditLine *el, struct sftp_conn *conn, char *remote_path, memset(&g, 0, sizeof(g)); if (remote != LOCAL) { tmp = make_absolute_pwd_glob(tmp, remote_path); - remote_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g); + sftp_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g); } else (void)glob(tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);