Server gets client's CN
[hcoop/domtool2.git] / src / plugins / bind.sml
index 4b09b45..faa8e4e 100644 (file)
@@ -39,7 +39,8 @@ val _ = Domain.registerBefore
                                       (Domain.dnsMaster ()))
        
 val _ = Domain.registerAfter
                                       (Domain.dnsMaster ()))
        
 val _ = Domain.registerAfter
-           (fn _ => Option.app TextIO.closeOut (!dns))
+           (fn _ => (Option.app TextIO.closeOut (!dns);
+                     dns := NONE))
 
 val dl = ErrorMsg.dummyLoc
 
 
 val dl = ErrorMsg.dummyLoc
 
@@ -129,7 +130,8 @@ val () = Slave.registerFileHandler (fn fs =>
                                                       val fname = OS.Path.joinDirFile {dir = Config.Bind.zonePath,
                                                                                        file = fname}
                                                   in
                                                       val fname = OS.Path.joinDirFile {dir = Config.Bind.zonePath,
                                                                                        file = fname}
                                                   in
-                                                      OS.FileSys.remove fname
+                                                      Slave.shellF ([Config.rm, " -f ", fname],
+                                                                 fn cl => "Error deleting file: " ^ cl)
                                                   end
                                               else
                                                   let
                                                   end
                                               else
                                                   let
@@ -176,8 +178,11 @@ val () = Slave.registerFileHandler (fn fs =>
                                                       TextIO.output (outf, Int.toString min);
                                                       TextIO.output (outf, " )\n\n");
                                                       TextIO.closeOut outf;
                                                       TextIO.output (outf, Int.toString min);
                                                       TextIO.output (outf, " )\n\n");
                                                       TextIO.closeOut outf;
-                                                      Slave.shellF ([Config.cat, " ", dns, " >>", fname],
-                                                                 fn cl => "Error concatenating file: " ^ cl);
+                                                      if Posix.FileSys.access (dns, []) then
+                                                          Slave.shellF ([Config.cat, " ", dns, " >>", fname],
+                                                                     fn cl => "Error concatenating file: " ^ cl)
+                                                      else
+                                                          ();
                                                       didDomain := #domain fs
                                                   end
                                       in
                                                       didDomain := #domain fs
                                                   end
                                       in