summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/scp.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2023-10-11 05:42:09 +0000
committerDamien Miller <djm@cvs.openbsd.org>2023-10-11 05:42:09 +0000
commit93db488718e2b9021179c56052d2159de65a274c (patch)
tree4d9a449d506f0e2999fb01286355f83486678e17 /usr.bin/ssh/scp.c
parent30401740b8da4ee082ec17d67cb03af4014593f0 (diff)
in olde rcp/scp protocol mode, when rejecting a path from the server
as not matching the glob that the client sent, log (at debug level) the received pathname as well as the list of possible expected paths expanded from the glob. bz2966
Diffstat (limited to 'usr.bin/ssh/scp.c')
-rw-r--r--usr.bin/ssh/scp.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c
index 2c2342edf91..e7c4da1ad3b 100644
--- a/usr.bin/ssh/scp.c
+++ b/usr.bin/ssh/scp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scp.c,v 1.259 2023/09/10 23:12:32 djm Exp $ */
+/* $OpenBSD: scp.c,v 1.260 2023/10/11 05:42:08 djm Exp $ */
/*
* scp - secure remote copy. This is basically patched BSD rcp which
* uses ssh to do the data transfer (instead of using rcmd).
@@ -1752,8 +1752,16 @@ sink(int argc, char **argv, const char *src)
fnmatch(patterns[n], cp, 0) == 0)
break;
}
- if (n >= npatterns)
+ if (n >= npatterns) {
+ debug2_f("incoming filename \"%s\" does not "
+ "match any of %zu expected patterns", cp,
+ npatterns);
+ for (n = 0; n < npatterns; n++) {
+ debug3_f("expected pattern %zu: \"%s\"",
+ n, patterns[n]);
+ }
SCREWUP("filename does not match request");
+ }
}
if (targisdir) {
static char *namebuf;