summaryrefslogtreecommitdiffstats
path: root/scp.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2023-10-11 07:42:08 +0200
committerDamien Miller <djm@mindrot.org>2023-10-11 07:44:40 +0200
commitc97520d23d1fe53d30725a2af25d2dddd6f2faff (patch)
tree3ce95fab231e0131912b7f27bdeae1a318822866 /scp.c
parentupstream: s/%.100s/%s/ in SSH- banner construction as there's no (diff)
downloadopenssh-c97520d23d1fe53d30725a2af25d2dddd6f2faff.tar.xz
openssh-c97520d23d1fe53d30725a2af25d2dddd6f2faff.zip
upstream: 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 OpenBSD-Commit-ID: 0bd8db8a595334ca86bca8f36e23fc0395315765
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/scp.c b/scp.c
index eaa407cb1..492dace12 100644
--- a/scp.c
+++ b/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).
@@ -1813,8 +1813,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;