Skip to content

Commit b6b4913

Browse files
committed
upstream: rename remote_glob() -> sftp_glob() to match other API
OpenBSD-Commit-ID: d9dfb3708d824ec02970a84d96cf5937e0887229
1 parent 21b79af commit b6b4913

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

scp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: scp.c,v 1.258 2023/09/08 05:56:13 djm Exp $ */
1+
/* $OpenBSD: scp.c,v 1.259 2023/09/10 23:12:32 djm Exp $ */
22
/*
33
* scp - secure remote copy. This is basically patched BSD rcp which
44
* uses ssh to do the data transfer (instead of using rcmd).
@@ -186,7 +186,7 @@ size_t sftp_nrequests;
186186
/* Needed for sftp */
187187
volatile sig_atomic_t interrupted = 0;
188188

189-
int remote_glob(struct sftp_conn *, const char *, int,
189+
int sftp_glob(struct sftp_conn *, const char *, int,
190190
int (*)(const char *, int), glob_t *); /* proto for sftp-glob.c */
191191

192192
static void
@@ -1568,7 +1568,7 @@ sink_sftp(int argc, char *dst, const char *src, struct sftp_conn *conn)
15681568
}
15691569

15701570
debug3_f("copying remote %s to local %s", abs_src, dst);
1571-
if ((r = remote_glob(conn, abs_src, GLOB_NOCHECK|GLOB_MARK,
1571+
if ((r = sftp_glob(conn, abs_src, GLOB_NOCHECK|GLOB_MARK,
15721572
NULL, &g)) != 0) {
15731573
if (r == GLOB_NOSPACE)
15741574
error("%s: too many glob matches", src);
@@ -2001,7 +2001,7 @@ throughlocal_sftp(struct sftp_conn *from, struct sftp_conn *to,
20012001
}
20022002

20032003
debug3_f("copying remote %s to remote %s", abs_src, target);
2004-
if ((r = remote_glob(from, abs_src, GLOB_NOCHECK|GLOB_MARK,
2004+
if ((r = sftp_glob(from, abs_src, GLOB_NOCHECK|GLOB_MARK,
20052005
NULL, &g)) != 0) {
20062006
if (r == GLOB_NOSPACE)
20072007
error("%s: too many glob matches", src);

sftp-glob.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: sftp-glob.c,v 1.32 2023/09/08 05:56:13 djm Exp $ */
1+
/* $OpenBSD: sftp-glob.c,v 1.33 2023/09/10 23:12:32 djm Exp $ */
22
/*
33
* Copyright (c) 2001-2004 Damien Miller <[email protected]>
44
*
@@ -32,7 +32,7 @@
3232
#include "sftp-common.h"
3333
#include "sftp-client.h"
3434

35-
int remote_glob(struct sftp_conn *, const char *, int,
35+
int sftp_glob(struct sftp_conn *, const char *, int,
3636
int (*)(const char *, int), glob_t *);
3737

3838
struct SFTP_OPENDIR {
@@ -134,7 +134,7 @@ fudge_stat(const char *path, struct stat *st)
134134
}
135135

136136
int
137-
remote_glob(struct sftp_conn *conn, const char *pattern, int flags,
137+
sftp_glob(struct sftp_conn *conn, const char *pattern, int flags,
138138
int (*errfunc)(const char *, int), glob_t *pglob)
139139
{
140140
int r;

sftp.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $OpenBSD: sftp.c,v 1.235 2023/09/08 05:56:13 djm Exp $ */
1+
/* $OpenBSD: sftp.c,v 1.236 2023/09/10 23:12:32 djm Exp $ */
22
/*
33
* Copyright (c) 2001-2004 Damien Miller <[email protected]>
44
*
@@ -110,7 +110,7 @@ struct complete_ctx {
110110
char **remote_pathp;
111111
};
112112

113-
int remote_glob(struct sftp_conn *, const char *, int,
113+
int sftp_glob(struct sftp_conn *, const char *, int,
114114
int (*)(const char *, int), glob_t *); /* proto for sftp-glob.c */
115115

116116
extern char *__progname;
@@ -655,7 +655,7 @@ process_get(struct sftp_conn *conn, const char *src, const char *dst,
655655
memset(&g, 0, sizeof(g));
656656

657657
debug3("Looking up %s", abs_src);
658-
if ((r = remote_glob(conn, abs_src, GLOB_MARK, NULL, &g)) != 0) {
658+
if ((r = sftp_glob(conn, abs_src, GLOB_MARK, NULL, &g)) != 0) {
659659
if (r == GLOB_NOSPACE) {
660660
error("Too many matches for \"%s\".", abs_src);
661661
} else {
@@ -977,7 +977,7 @@ do_globbed_ls(struct sftp_conn *conn, const char *path,
977977

978978
memset(&g, 0, sizeof(g));
979979

980-
if ((r = remote_glob(conn, path,
980+
if ((r = sftp_glob(conn, path,
981981
GLOB_MARK|GLOB_NOCHECK|GLOB_BRACE|GLOB_KEEPSTAT|GLOB_NOSORT,
982982
NULL, &g)) != 0 ||
983983
(g.gl_pathc && !g.gl_matchc)) {
@@ -1618,7 +1618,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd,
16181618
break;
16191619
case I_RM:
16201620
path1 = make_absolute_pwd_glob(path1, *pwd);
1621-
remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g);
1621+
sftp_glob(conn, path1, GLOB_NOCHECK, NULL, &g);
16221622
for (i = 0; g.gl_pathv[i] && !interrupted; i++) {
16231623
if (!quiet)
16241624
mprintf("Removing %s\n", g.gl_pathv[i]);
@@ -1722,7 +1722,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd,
17221722
attrib_clear(&a);
17231723
a.flags |= SSH2_FILEXFER_ATTR_PERMISSIONS;
17241724
a.perm = n_arg;
1725-
remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g);
1725+
sftp_glob(conn, path1, GLOB_NOCHECK, NULL, &g);
17261726
for (i = 0; g.gl_pathv[i] && !interrupted; i++) {
17271727
if (!quiet)
17281728
mprintf("Changing mode on %s\n",
@@ -1736,7 +1736,7 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd,
17361736
case I_CHOWN:
17371737
case I_CHGRP:
17381738
path1 = make_absolute_pwd_glob(path1, *pwd);
1739-
remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g);
1739+
sftp_glob(conn, path1, GLOB_NOCHECK, NULL, &g);
17401740
for (i = 0; g.gl_pathv[i] && !interrupted; i++) {
17411741
if ((hflag ? sftp_lstat : sftp_stat)(conn,
17421742
g.gl_pathv[i], 0, &aa) != 0) {
@@ -2017,7 +2017,7 @@ complete_match(EditLine *el, struct sftp_conn *conn, char *remote_path,
20172017
memset(&g, 0, sizeof(g));
20182018
if (remote != LOCAL) {
20192019
tmp = make_absolute_pwd_glob(tmp, remote_path);
2020-
remote_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);
2020+
sftp_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);
20212021
} else
20222022
(void)glob(tmp, GLOB_DOOFFS|GLOB_MARK, NULL, &g);
20232023

0 commit comments

Comments
 (0)