From ca6ffb3f7b6481b68d95518523465d9dd5585c73 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 13 Oct 2007 13:27:07 +0000 Subject: [PATCH] Change setEnv arg --- lib/mod_env.dtl | 2 +- src/domain.sml | 6 ++++-- src/plugins/apache.sml | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/mod_env.dtl b/lib/mod_env.dtl index 21f2021..305ef1f 100644 --- a/lib/mod_env.dtl +++ b/lib/mod_env.dtl @@ -1,5 +1,5 @@ {{Support for Apache's mod_env, which deals with UNIX environment variables}} -extern val setEnv : no_spaces -> no_spaces -> [^Vhost]; +extern val setEnv : no_spaces -> no_newlines -> [^Vhost]; {{See the Apache documentation.}} diff --git a/src/domain.sml b/src/domain.sml index c097128..01f7902 100644 --- a/src/domain.sml +++ b/src/domain.sml @@ -114,10 +114,12 @@ val validGroup = validUser val _ = Env.type_one "no_spaces" Env.string - (CharVector.all (fn ch => not (Char.isSpace ch) andalso ch <> #"\"" andalso 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 - (CharVector.all (fn ch => ch <> #"\n" andalso ch <> #"\r" andalso ch <> #"\"" andalso ch <> #"'")) + (CharVector.all (fn ch => Char.isPrint ch andalso ch <> #"\n" andalso ch <> #"\r" + andalso ch <> #"\"" andalso ch <> #"'")) val _ = Env.type_one "ip" Env.string diff --git a/src/plugins/apache.sml b/src/plugins/apache.sml index 167759f..29dc447 100644 --- a/src/plugins/apache.sml +++ b/src/plugins/apache.sml @@ -887,7 +887,8 @@ val () = Env.action_two "setEnv" (fn (key, value) => (write "\tSetEnv \""; write key; write "\" \""; - write value; + write (String.translate (fn #"\"" => "\\\"" + | ch => str ch) value); write "\"\n")) val () = Domain.registerResetLocal (fn () => -- 2.20.1