Blob Blame History Raw
From 8fb02d5decac12c9b06b5e420e36e9d46c538c54 Mon Sep 17 00:00:00 2001
From: Dominic Cleal <dcleal@redhat.com>
Date: Sat, 5 Oct 2013 17:04:15 +0100
Subject: [PATCH] Exports: permit colons for IPv6 client addresses

Fixes ticket #366

(cherry picked from commit 68955992ae548f9a65a4fb4cdbf2ffbe5520a50e)
---
 lenses/exports.aug            | 2 +-
 lenses/tests/test_exports.aug | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lenses/exports.aug b/lenses/exports.aug
index 4e134c8..3de0de1 100644
--- a/lenses/exports.aug
+++ b/lenses/exports.aug
@@ -76,7 +76,7 @@ About: Limitations
 module Exports =
   autoload xfm
 
-  let client_re = /[a-zA-Z0-9.@*?\/-]+/
+  let client_re = /[a-zA-Z0-9.@*?\/:-]+/
 
   let eol = Util.eol
   let lbracket  = Util.del_str "("
diff --git a/lenses/tests/test_exports.aug b/lenses/tests/test_exports.aug
index 14a51e8..3d0e9c2 100644
--- a/lenses/tests/test_exports.aug
+++ b/lenses/tests/test_exports.aug
@@ -8,6 +8,7 @@ let s = "/local 172.31.0.0/16(rw,sync) \t
 /local2 somehost(rw,sync)
 /local3 some-host(rw,sync)
 /local3 an-other-host(rw,sync)
+/local4 2000:123:456::/64(rw)
 "
 
 test Exports.lns get s =
@@ -43,3 +44,6 @@ test Exports.lns get s =
       { "client" = "an-other-host"
           { "option" = "rw" }
           { "option" = "sync" } } }
+  { "dir" = "/local4"
+      { "client" = "2000:123:456::/64"
+          { "option" = "rw" } } }