[openssh-commits] [openssh] 10/10: upstream: check access(ssh-sk-helper, X_OK) to provide friendly
git+noreply at mindrot.org
git+noreply at mindrot.org
Tue Jan 21 18:09:48 AEDT 2020
This is an automated email from the git hooks/post-receive script.
djm pushed a commit to branch master
in repository openssh.
commit b5fcb0ac1cc0ef01aeec1c089146298654ab3ae0
Author: djm at openbsd.org <djm at openbsd.org>
Date: Tue Jan 21 07:07:31 2020 +0000
upstream: check access(ssh-sk-helper, X_OK) to provide friendly
error message for misconfigured helper paths
OpenBSD-Commit-ID: 061bcc262155d12e726305c91394ac0aaf1f8341
---
ssh-sk-client.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/ssh-sk-client.c b/ssh-sk-client.c
index 9121570d..359327b6 100644
--- a/ssh-sk-client.c
+++ b/ssh-sk-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-sk-client.c,v 1.5 2020/01/10 23:43:26 djm Exp $ */
+/* $OpenBSD: ssh-sk-client.c,v 1.6 2020/01/21 07:07:31 djm Exp $ */
/*
* Copyright (c) 2019 Google LLC
*
@@ -21,6 +21,7 @@
#include <sys/socket.h>
#include <sys/wait.h>
+#include <fcntl.h>
#include <limits.h>
#include <errno.h>
#include <signal.h>
@@ -56,6 +57,13 @@ start_helper(int *fdp, pid_t *pidp, void (**osigchldp)(int))
helper = getenv("SSH_SK_HELPER");
if (helper == NULL || strlen(helper) == 0)
helper = _PATH_SSH_SK_HELPER;
+ if (access(helper, X_OK) != 0) {
+ oerrno = errno;
+ error("%s: helper \"%s\" unusable: %s", __func__, helper,
+ strerror(errno));
+ errno = oerrno;
+ return SSH_ERR_SYSTEM_ERROR;
+ }
#ifdef DEBUG_SK
verbosity = "-vvv";
#endif
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list