Mark more characters shell-safe.
authorLinus Torvalds <torvalds@g5.osdl.org>
Fri, 8 Jul 2005 00:59:23 +0000 (17:59 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 8 Jul 2005 00:59:23 +0000 (17:59 -0700)
I still worry about just quoting things when passing it off to "ssh" or
"sh -c", so I'm being anal.  But _, ^ and , are certainly ok and while
both ~ and @ can have speacial meaning to shell/ssh they are benign.

connect.c

index 075683e..3d4b31d 100644 (file)
--- a/connect.c
+++ b/connect.c
@@ -57,7 +57,9 @@ static char *shell_safe(char *url)
                ['A'...'Z'] = 1,
                ['.'] = 1, ['/'] = 1,
                ['-'] = 1, ['+'] = 1,
-               [':'] = 1
+               [':'] = 1, ['_'] = 1,
+               ['@'] = 1, [','] = 1,
+               ['~'] = 1, ['^'] = 1,
        };
 
        while ((c = *n++) != 0) {