HCoop
/
hcoop
/
domtool2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vmail interprets relative paths relatively to caller's home directory
[hcoop/domtool2.git]
/
src
/
domain.sml
diff --git
a/src/domain.sml
b/src/domain.sml
index
ea3d70a
..
b2c0c5c
100644
(file)
--- a/
src/domain.sml
+++ b/
src/domain.sml
@@
-1,5
+1,5
@@
(* HCoop Domtool (http://hcoop.sourceforge.net/)
(* HCoop Domtool (http://hcoop.sourceforge.net/)
- * Copyright (c) 2006, Adam Chlipala
+ * Copyright (c) 2006
-2007
, Adam Chlipala
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@
-114,10
+114,12
@@
val validGroup = validUser
val _ = Env.type_one "no_spaces"
Env.string
val _ = Env.type_one "no_spaces"
Env.string
- (CharVector.all (fn ch => not (Char.isSpace ch)))
+ (CharVector.all (fn ch => Char.isPrint ch andalso not (Char.isSpace ch)
+ andalso ch <> #"\"" andalso ch <> #"'"))
val _ = Env.type_one "no_newlines"
Env.string
val _ = Env.type_one "no_newlines"
Env.string
- (CharVector.all (fn ch => ch <> #"\n" andalso ch <> #"\r"))
+ (CharVector.all (fn ch => Char.isPrint ch andalso ch <> #"\n" andalso ch <> #"\r"
+ andalso ch <> #"\"" andalso ch <> #"'"))
val _ = Env.type_one "ip"
Env.string
val _ = Env.type_one "ip"
Env.string
@@
-538,7
+540,7
@@
val _ = Env.containerV_one "domain"
close ()
end
close ()
end
- fun saveNamed (kind, soa : soa, masterIp) node =
+ fun saveNamed (kind, soa : soa, masterIp
, slaveIps
) node =
if dom = "localhost" then
()
else let
if dom = "localhost" then
()
else let
@@
-546,7
+548,7
@@
val _ = Env.containerV_one "domain"
in
write "\nzone \"";
writeDom ();
in
write "\nzone \"";
writeDom ();
- write "\"
IN
{\n\ttype ";
+ write "\" {\n\ttype ";
write kind;
write ";\n\tfile \"";
write Config.Bind.zonePath_real;
write kind;
write ";\n\tfile \"";
write Config.Bind.zonePath_real;
@@
-554,7
+556,11
@@
val _ = Env.containerV_one "domain"
writeDom ();
write ".zone\";\n";
case kind of
writeDom ();
write ".zone\";\n";
case kind of
- "master" => write "\tallow-update { none; };\n"
+ "master" => (write "\tallow-transfer {\n";
+ app (fn ip => (write "\t\t";
+ write ip;
+ write ";\n")) slaveIps;
+ write "\t};\n")
| _ => (write "\tmasters { ";
write masterIp;
write "; };\n");
| _ => (write "\tmasters { ";
write masterIp;
write "; };\n");
@@
-568,19
+574,21
@@
val _ = Env.containerV_one "domain"
let
val masterIp =
case #master dns of
let
val masterIp =
case #master dns of
- InternalMaster node =>
valOf (SM.find (nodeMap, node))
+ InternalMaster node =>
nodeIp node
| ExternalMaster ip => ip
| ExternalMaster ip => ip
+
+ val slaveIps = map nodeIp (#slaves dns)
in
app (saveSoa ("slave", #soa dns)) (#slaves dns);
in
app (saveSoa ("slave", #soa dns)) (#slaves dns);
- app (saveNamed ("slave", #soa dns, masterIp)) (#slaves dns);
+ app (saveNamed ("slave", #soa dns, masterIp
, slaveIps
)) (#slaves dns);
case #master dns of
InternalMaster node =>
(masterNode := SOME node;
saveSoa ("master", #soa dns) node;
case #master dns of
InternalMaster node =>
(masterNode := SOME node;
saveSoa ("master", #soa dns) node;
- saveNamed ("master", #soa dns, masterIp) node)
- | _ => masterNode := NONE
;
- !befores dom
- end
+ saveNamed ("master", #soa dns, masterIp
, slaveIps
) node)
+ | _ => masterNode := NONE
+ end;
+ !befores dom
end,
fn () => !afters (!current))
end,
fn () => !afters (!current))