summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-02-23 00:05:31 +0000
committerDamien Miller <djm@mindrot.org>2021-02-23 11:09:07 +1100
commitc3b1636770785cc2830dedd0f22ef7d3d3491d6d (patch)
tree0b297e77566fcc089112785121c77b7c790e5cd8
parent5fcb0514949d61aadaf4a89cf16eb78fb47491ec (diff)
upstream: warn when the user specifies a ForwardAgent path that does
not exist and exit if ExitOnForwardFailure is set; bz3264 OpenBSD-Commit-ID: 72f7875865e723e464c71bf8692e83110699bf26
-rw-r--r--ssh.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ssh.c b/ssh.c
index 220d2080..53330da5 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.551 2021/02/15 20:43:15 markus Exp $ */
+/* $OpenBSD: ssh.c,v 1.552 2021/02/23 00:05:31 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1419,6 +1419,12 @@ main(int ac, char **av)
free(p);
free(options.forward_agent_sock_path);
options.forward_agent_sock_path = cp;
+ if (stat(options.forward_agent_sock_path, &st) != 0) {
+ error("Cannot forward agent socket path \"%s\": %s",
+ options.forward_agent_sock_path, strerror(errno));
+ if (options.exit_on_forward_failure)
+ cleanup_exit(255);
+ }
}
if (options.num_system_hostfiles > 0 &&