diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | misc.c | 17 | ||||
-rw-r--r-- | ssh_config.5 | 5 | ||||
-rw-r--r-- | sshd_config.5 | 5 |
4 files changed, 28 insertions, 5 deletions
@@ -220,6 +220,10 @@ | |||
220 | Make ssh-keygen handle CR and CRLF line termination when converting IETF | 220 | Make ssh-keygen handle CR and CRLF line termination when converting IETF |
221 | format keys, in adition to vanilla LF. mindrot #1157, tested by Chris | 221 | format keys, in adition to vanilla LF. mindrot #1157, tested by Chris |
222 | Pepper, ok djm@ | 222 | Pepper, ok djm@ |
223 | - dtucker@cvs.openbsd.org 2006/03/13 10:14:29 | ||
224 | [misc.c ssh_config.5 sshd_config.5] | ||
225 | Allow config directives to contain whitespace by surrounding them by double | ||
226 | quotes. mindrot #482, man page help from jmc@, ok djm@ | ||
223 | 227 | ||
224 | 20060313 | 228 | 20060313 |
225 | - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) | 229 | - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong) |
@@ -4121,4 +4125,4 @@ | |||
4121 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 4125 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
4122 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 4126 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
4123 | 4127 | ||
4124 | $Id: ChangeLog,v 1.4202 2006/03/15 01:05:40 djm Exp $ | 4128 | $Id: ChangeLog,v 1.4203 2006/03/15 01:05:59 djm Exp $ |
@@ -24,7 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "includes.h" | 26 | #include "includes.h" |
27 | RCSID("$OpenBSD: misc.c,v 1.45 2006/02/10 00:27:13 stevesk Exp $"); | 27 | RCSID("$OpenBSD: misc.c,v 1.46 2006/03/13 10:14:29 dtucker Exp $"); |
28 | 28 | ||
29 | #include <sys/ioctl.h> | 29 | #include <sys/ioctl.h> |
30 | #include <netinet/tcp.h> | 30 | #include <netinet/tcp.h> |
@@ -128,6 +128,7 @@ set_nodelay(int fd) | |||
128 | 128 | ||
129 | /* Characters considered whitespace in strsep calls. */ | 129 | /* Characters considered whitespace in strsep calls. */ |
130 | #define WHITESPACE " \t\r\n" | 130 | #define WHITESPACE " \t\r\n" |
131 | #define QUOTE "\"" | ||
131 | 132 | ||
132 | /* return next token in configuration line */ | 133 | /* return next token in configuration line */ |
133 | char * | 134 | char * |
@@ -141,15 +142,27 @@ strdelim(char **s) | |||
141 | 142 | ||
142 | old = *s; | 143 | old = *s; |
143 | 144 | ||
144 | *s = strpbrk(*s, WHITESPACE "="); | 145 | *s = strpbrk(*s, WHITESPACE QUOTE "="); |
145 | if (*s == NULL) | 146 | if (*s == NULL) |
146 | return (old); | 147 | return (old); |
147 | 148 | ||
149 | if (*s[0] == '\"') { | ||
150 | memmove(*s, *s + 1, strlen(*s)); /* move nul too */ | ||
151 | /* Find matching quote */ | ||
152 | if ((*s = strpbrk(*s, QUOTE)) == NULL) { | ||
153 | return (NULL); /* no matching quote */ | ||
154 | } else { | ||
155 | *s[0] = '\0'; | ||
156 | return (old); | ||
157 | } | ||
158 | } | ||
159 | |||
148 | /* Allow only one '=' to be skipped */ | 160 | /* Allow only one '=' to be skipped */ |
149 | if (*s[0] == '=') | 161 | if (*s[0] == '=') |
150 | wspace = 1; | 162 | wspace = 1; |
151 | *s[0] = '\0'; | 163 | *s[0] = '\0'; |
152 | 164 | ||
165 | /* Skip any extra whitespace after first token */ | ||
153 | *s += strspn(*s + 1, WHITESPACE) + 1; | 166 | *s += strspn(*s + 1, WHITESPACE) + 1; |
154 | if (*s[0] == '=' && !wspace) | 167 | if (*s[0] == '=' && !wspace) |
155 | *s += strspn(*s + 1, WHITESPACE) + 1; | 168 | *s += strspn(*s + 1, WHITESPACE) + 1; |
diff --git a/ssh_config.5 b/ssh_config.5 index ba8926e8e..f7c9f7145 100644 --- a/ssh_config.5 +++ b/ssh_config.5 | |||
@@ -34,7 +34,7 @@ | |||
34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
36 | .\" | 36 | .\" |
37 | .\" $OpenBSD: ssh_config.5,v 1.87 2006/02/26 18:03:10 jmc Exp $ | 37 | .\" $OpenBSD: ssh_config.5,v 1.88 2006/03/13 10:14:29 dtucker Exp $ |
38 | .Dd September 25, 1999 | 38 | .Dd September 25, 1999 |
39 | .Dt SSH_CONFIG 5 | 39 | .Dt SSH_CONFIG 5 |
40 | .Os | 40 | .Os |
@@ -92,6 +92,9 @@ and | |||
92 | .Nm sftp | 92 | .Nm sftp |
93 | .Fl o | 93 | .Fl o |
94 | option. | 94 | option. |
95 | Arguments may optionally be enclosed in double quotes | ||
96 | .Pq \&" | ||
97 | in order to represent arguments containing spaces. | ||
95 | .Pp | 98 | .Pp |
96 | The possible | 99 | The possible |
97 | keywords and their meanings are as follows (note that | 100 | keywords and their meanings are as follows (note that |
diff --git a/sshd_config.5 b/sshd_config.5 index 446e59afd..1bd3a624f 100644 --- a/sshd_config.5 +++ b/sshd_config.5 | |||
@@ -34,7 +34,7 @@ | |||
34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
36 | .\" | 36 | .\" |
37 | .\" $OpenBSD: sshd_config.5,v 1.55 2006/02/26 18:01:13 jmc Exp $ | 37 | .\" $OpenBSD: sshd_config.5,v 1.56 2006/03/13 10:14:29 dtucker Exp $ |
38 | .Dd September 25, 1999 | 38 | .Dd September 25, 1999 |
39 | .Dt SSHD_CONFIG 5 | 39 | .Dt SSHD_CONFIG 5 |
40 | .Os | 40 | .Os |
@@ -56,6 +56,9 @@ The file contains keyword-argument pairs, one per line. | |||
56 | Lines starting with | 56 | Lines starting with |
57 | .Ql # | 57 | .Ql # |
58 | and empty lines are interpreted as comments. | 58 | and empty lines are interpreted as comments. |
59 | Arguments may optionally be enclosed in double quotes | ||
60 | .Pq \&" | ||
61 | in order to represent arguments containing spaces. | ||
59 | .Pp | 62 | .Pp |
60 | The possible | 63 | The possible |
61 | keywords and their meanings are as follows (note that | 64 | keywords and their meanings are as follows (note that |