summaryrefslogtreecommitdiffstats
path: root/auth2-pubkey.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2021-06-08 06:54:40 +0000
committerDamien Miller <djm@mindrot.org>2021-06-08 17:12:51 +1000
commitaae4b4d3585b9f944d7dbd3c9e5ba0006c55e457 (patch)
treebfc547a420b24ea48a15030057fd6a1662fd2de0 /auth2-pubkey.c
parentda9f9acaac5bab95dca642b48e0c8182b246ab69 (diff)
upstream: Allow argv_split() to optionally terminate tokenisation
when it encounters an unquoted comment. Add some additional utility function for working with argument vectors, since we'll be switching to using them to parse ssh/sshd_config shortly. ok markus@ as part of a larger diff; tested in snaps OpenBSD-Commit-ID: fd9c108cef2f713f24e3bc5848861d221bb3a1ac
Diffstat (limited to 'auth2-pubkey.c')
-rw-r--r--auth2-pubkey.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/auth2-pubkey.c b/auth2-pubkey.c
index 721c1d9b..d288d110 100644
--- a/auth2-pubkey.c
+++ b/auth2-pubkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth2-pubkey.c,v 1.107 2021/04/03 06:18:40 djm Exp $ */
+/* $OpenBSD: auth2-pubkey.c,v 1.108 2021/06/08 06:54:40 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -475,7 +475,8 @@ match_principals_command(struct ssh *ssh, struct passwd *user_pw,
}
/* Turn the command into an argument vector */
- if (argv_split(options.authorized_principals_command, &ac, &av) != 0) {
+ if (argv_split(options.authorized_principals_command,
+ &ac, &av, 0) != 0) {
error("AuthorizedPrincipalsCommand \"%s\" contains "
"invalid quotes", options.authorized_principals_command);
goto out;
@@ -926,7 +927,7 @@ user_key_command_allowed2(struct ssh *ssh, struct passwd *user_pw,
}
/* Turn the command into an argument vector */
- if (argv_split(options.authorized_keys_command, &ac, &av) != 0) {
+ if (argv_split(options.authorized_keys_command, &ac, &av, 0) != 0) {
error("AuthorizedKeysCommand \"%s\" contains invalid quotes",
options.authorized_keys_command);
goto out;