]> andersk Git - openssh.git/commitdiff
- dtucker@cvs.openbsd.org 2006/03/13 10:14:29
authordjm <djm>
Wed, 15 Mar 2006 01:05:59 +0000 (01:05 +0000)
committerdjm <djm>
Wed, 15 Mar 2006 01:05:59 +0000 (01:05 +0000)
     [misc.c ssh_config.5 sshd_config.5]
     Allow config directives to contain whitespace by surrounding them by double
     quotes.  mindrot #482, man page help from jmc@, ok djm@

ChangeLog
misc.c
ssh_config.5
sshd_config.5

index dd966fe18d582928f65f9fa0262693b931c03844..cbf2cc716a1deacfb1955df5a033908b576d4f77 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      Make ssh-keygen handle CR and CRLF line termination when converting IETF
      format keys, in adition to vanilla LF.  mindrot #1157, tested by Chris
      Pepper, ok djm@
      Make ssh-keygen handle CR and CRLF line termination when converting IETF
      format keys, in adition to vanilla LF.  mindrot #1157, tested by Chris
      Pepper, ok djm@
+   - dtucker@cvs.openbsd.org 2006/03/13 10:14:29
+     [misc.c ssh_config.5 sshd_config.5]
+     Allow config directives to contain whitespace by surrounding them by double
+     quotes.  mindrot #482, man page help from jmc@, ok djm@
 
 20060313
  - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong)
 
 20060313
  - (dtucker) [configure.ac] Bug #1171: Don't use printf("%lld", longlong)
diff --git a/misc.c b/misc.c
index e1da651efe03472023342358e13246a207a2eb38..662480e9e1fa3e560066d8fe1396e7b4c8a26b24 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -24,7 +24,7 @@
  */
 
 #include "includes.h"
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: misc.c,v 1.45 2006/02/10 00:27:13 stevesk Exp $");
+RCSID("$OpenBSD: misc.c,v 1.46 2006/03/13 10:14:29 dtucker Exp $");
 
 #include <sys/ioctl.h>
 #include <netinet/tcp.h>
 
 #include <sys/ioctl.h>
 #include <netinet/tcp.h>
@@ -128,6 +128,7 @@ set_nodelay(int fd)
 
 /* Characters considered whitespace in strsep calls. */
 #define WHITESPACE " \t\r\n"
 
 /* Characters considered whitespace in strsep calls. */
 #define WHITESPACE " \t\r\n"
+#define QUOTE  "\""
 
 /* return next token in configuration line */
 char *
 
 /* return next token in configuration line */
 char *
@@ -141,15 +142,27 @@ strdelim(char **s)
 
        old = *s;
 
 
        old = *s;
 
-       *s = strpbrk(*s, WHITESPACE "=");
+       *s = strpbrk(*s, WHITESPACE QUOTE "=");
        if (*s == NULL)
                return (old);
 
        if (*s == NULL)
                return (old);
 
+       if (*s[0] == '\"') {
+               memmove(*s, *s + 1, strlen(*s)); /* move nul too */
+               /* Find matching quote */
+               if ((*s = strpbrk(*s, QUOTE)) == NULL) {
+                       return (NULL);          /* no matching quote */
+               } else {
+                       *s[0] = '\0';
+                       return (old);
+               }
+       }
+
        /* Allow only one '=' to be skipped */
        if (*s[0] == '=')
                wspace = 1;
        *s[0] = '\0';
 
        /* Allow only one '=' to be skipped */
        if (*s[0] == '=')
                wspace = 1;
        *s[0] = '\0';
 
+       /* Skip any extra whitespace after first token */
        *s += strspn(*s + 1, WHITESPACE) + 1;
        if (*s[0] == '=' && !wspace)
                *s += strspn(*s + 1, WHITESPACE) + 1;
        *s += strspn(*s + 1, WHITESPACE) + 1;
        if (*s[0] == '=' && !wspace)
                *s += strspn(*s + 1, WHITESPACE) + 1;
index ba8926e8ee8cc009602ebabf1f481a70afd28fb6..f7c9f7145552837c7e61468687a19b8404774b24 100644 (file)
@@ -34,7 +34,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $OpenBSD: ssh_config.5,v 1.87 2006/02/26 18:03:10 jmc Exp $
+.\" $OpenBSD: ssh_config.5,v 1.88 2006/03/13 10:14:29 dtucker Exp $
 .Dd September 25, 1999
 .Dt SSH_CONFIG 5
 .Os
 .Dd September 25, 1999
 .Dt SSH_CONFIG 5
 .Os
@@ -92,6 +92,9 @@ and
 .Nm sftp
 .Fl o
 option.
 .Nm sftp
 .Fl o
 option.
+Arguments may optionally be enclosed in double quotes
+.Pq \&"
+in order to represent arguments containing spaces.
 .Pp
 The possible
 keywords and their meanings are as follows (note that
 .Pp
 The possible
 keywords and their meanings are as follows (note that
index 446e59afdff88d451cc7bba16916aca18ad857cd..1bd3a624fdae497b024eecb46f36d03022c821e0 100644 (file)
@@ -34,7 +34,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $OpenBSD: sshd_config.5,v 1.55 2006/02/26 18:01:13 jmc Exp $
+.\" $OpenBSD: sshd_config.5,v 1.56 2006/03/13 10:14:29 dtucker Exp $
 .Dd September 25, 1999
 .Dt SSHD_CONFIG 5
 .Os
 .Dd September 25, 1999
 .Dt SSHD_CONFIG 5
 .Os
@@ -56,6 +56,9 @@ The file contains keyword-argument pairs, one per line.
 Lines starting with
 .Ql #
 and empty lines are interpreted as comments.
 Lines starting with
 .Ql #
 and empty lines are interpreted as comments.
+Arguments may optionally be enclosed in double quotes
+.Pq \&"
+in order to represent arguments containing spaces.
 .Pp
 The possible
 keywords and their meanings are as follows (note that
 .Pp
 The possible
 keywords and their meanings are as follows (note that
This page took 0.050236 seconds and 5 git commands to generate.