diff options
author | 2021-02-23 00:05:31 +0000 | |
---|---|---|
committer | 2021-02-23 00:05:31 +0000 | |
commit | 61219e89177fe7da7d8d80b3ec33de6a98e79c89 (patch) | |
tree | c4ea8eb042feedf783f16113fd5b7eb9fc76a773 /usr.bin/ssh/ssh.c | |
parent | remove unused acpiec_lock() acpiec_unlock() functions (diff) | |
download | wireguard-openbsd-61219e89177fe7da7d8d80b3ec33de6a98e79c89.tar.xz wireguard-openbsd-61219e89177fe7da7d8d80b3ec33de6a98e79c89.zip |
warn when the user specifies a ForwardAgent path that does not exist
and exit if ExitOnForwardFailure is set; bz3264
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r-- | usr.bin/ssh/ssh.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 448934dc143..4533204fd4b 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/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 @@ -1398,6 +1398,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 && |