From: Adam Chlipala Date: Thu, 11 Oct 2007 09:45:27 +0000 (+0000) Subject: Disallow authType kerberos in non-SSL vhosts X-Git-Tag: release_2010-11-19~176 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/8a5b34c9e0a4b08068dbc8381f6ebedd74e653af Disallow authType kerberos in non-SSL vhosts --- diff --git a/src/plugins/apache.sml b/src/plugins/apache.sml index e4e96ea..4cd9e82 100644 --- a/src/plugins/apache.sml +++ b/src/plugins/apache.sml @@ -1,5 +1,5 @@ (* 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 @@ -353,6 +353,7 @@ val rewriteEnabled = ref false val localRewriteEnabled = ref false val currentVhost = ref "" val currentVhostId = ref "" +val sslEnabled = ref false val pre = ref (fn _ : {user : string, nodes : string list, id : string, hostname : string} => ()) fun registerPre f = @@ -397,6 +398,7 @@ val () = Env.containerV_one "vhost" in currentVhost := fullHost; currentVhostId := vhostId; + sslEnabled := Option.isSome ssl; rewriteEnabled := false; localRewriteEnabled := false; @@ -687,16 +689,22 @@ val authType = fn (EVar "basic", _) => SOME "basic" | (EVar "kerberos", _) => SOME "kerberos" | _ => NONE +fun allowAuthType "kerberos" = !sslEnabled + | allowAuthType _ = true + val () = Env.action_one "authType" ("type", authType) (fn ty => - (write "\tAuthType "; - write ty; - write "\n"; - case ty of - "kerberos" => - write "\tKrbMethodNegotiate off\n\tKrbMethodK5Passwd on\n\tKrbVerifyKDC off\n\tKrbAuthRealms HCOOP.NET\n\tKrbSaveCredentials on\n" - | _ => ())) + if allowAuthType ty then + (write "\tAuthType "; + write ty; + write "\n"; + case ty of + "kerberos" => + write "\tKrbMethodNegotiate off\n\tKrbMethodK5Passwd on\n\tKrbVerifyKDC off\n\tKrbAuthRealms HCOOP.NET\n\tKrbSaveCredentials on\n" + | _ => ()) + else + print "WARNING: Skipped Kerberos authType because this isn't an SSL vhost.\n") val () = Env.action_one "authName" ("name", Env.string)