Index: branches/fc15-dev/server/common/oursrc/execsys/ldapize.pl
===================================================================
--- branches/fc15-dev/server/common/oursrc/execsys/ldapize.pl	(revision 1803)
+++ branches/fc15-dev/server/common/oursrc/execsys/ldapize.pl	(revision 1878)
@@ -7,23 +7,11 @@
 use Net::LDAP::Filter;
 
-sub report_error
-{
-    my $proto = shift;
-    my $mesg = shift;
-
-    if ($proto eq 'git') {
-        $mesg = "ERR \n  " . $mesg . "\n";
-        my $len = length($mesg)+4;
-        printf "%04x%s", $len, $mesg;
-    } else {
-        print $mesg;
-    }
-    exit 0;
-}
-
 my $url = $ARGV[0];
 my ($proto, $hostname, $path) = $url =~ m|^(.*?)://([^/]*)(.*)| or die "Could not match URL";
 my $mesg;
 
+my $vhostName = $hostname;
+
+vhost:
 # oh my gosh Net::LDAP::Filter SUCKS
 my $filter = bless({and =>
@@ -32,10 +20,10 @@
      {or =>
          [{equalityMatch => {attributeDesc  => 'scriptsVhostName',
-                             assertionValue => $hostname}},
+                             assertionValue => $vhostName}},
           {equalityMatch => {attributeDesc  => 'scriptsVhostAlias',
-                             assertionValue => $hostname}}]}]},
+                             assertionValue => $vhostName}}]}]},
     'Net::LDAP::Filter');
 
-my $ldap = Net::LDAP->new("ldapi://%2fvar%2frun%2fdirsrv%2fslapd-scripts.socket/");
+my $ldap = Net::LDAP->new("ldapi://%2fvar%2frun%2fslapd-scripts.socket/");
 $mesg = $ldap->bind();
 $mesg->code && die $mesg->error;
@@ -46,8 +34,10 @@
 
 my $vhostEntry = $mesg->pop_entry;
-if (!$vhostEntry)
-{
-    report_error($proto, "Could not find Host $hostname");
+if (!defined $vhostEntry) {
+  $vhostName ne '*' or die 'No vhost for *';
+  $vhostName =~ s/^(?:\*\.)?[^.]*/*/;  # Try next wildcard
+  goto vhost;
 }
+
 my $vhostDirectory = $vhostEntry->get_value('scriptsVhostDirectory');
 
@@ -59,13 +49,20 @@
 my ($homeDirectory, $uidNumber, $gidNumber) =
     map { $userEntry->get_value($_) } qw(homeDirectory uidNumber gidNumber);
+(my $scriptsdir = $homeDirectory) =~ s{(?:/Scripts)?$}{/Scripts};
 
 if ($proto eq 'svn') {
   chdir '/usr/libexec/scripts-trusted';
-  exec('/usr/sbin/suexec', $uidNumber, $gidNumber, '/usr/libexec/scripts-trusted/svn', "$homeDirectory/Scripts/svn/$vhostDirectory");
+  exec('/usr/sbin/suexec', $uidNumber, $gidNumber, '/usr/libexec/scripts-trusted/svn', "$scriptsdir/svn/$vhostDirectory");
 } elsif ($proto eq 'git') {
+  if ($vhostEntry->get_value('scriptsVhostName') eq 'notfound.example.com') {
+    # git-daemon doesn’t report useful errors yet
+    my $msg = "ERR No such host $hostname\n";
+    printf '%04x%s', length($msg) + 4, $msg;
+    exit;
+  }
   chdir '/usr/libexec/scripts-trusted';
-  exec('/usr/sbin/suexec', $uidNumber, $gidNumber, '/usr/libexec/scripts-trusted/git', "$homeDirectory/Scripts/git/$vhostDirectory");
+  exec('/usr/sbin/suexec', $uidNumber, $gidNumber, '/usr/libexec/scripts-trusted/git', "$scriptsdir/git/$vhostDirectory");
 } elsif ($proto eq 'http') {
-  print "suexec $uidNumber $gidNumber $homeDirectory/Scripts/web/$vhostDirectory/$path\n";
+  print "suexec $uidNumber $gidNumber $scriptsdir/web/$vhostDirectory/$path\n";
 } else {
   die "Unknown protocol\n";
Index: branches/fc15-dev/server/common/oursrc/execsys/mime.types
===================================================================
--- branches/fc15-dev/server/common/oursrc/execsys/mime.types	(revision 1803)
+++ branches/fc15-dev/server/common/oursrc/execsys/mime.types	(revision 1878)
@@ -509,2 +509,30 @@
 application/xaml+xml		xaml
 application/x-silverlight-app	xap
+# The following MS Office MIME types are from this source:
+# http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/05/08/office-2007-open-xml-mime-types.aspx
+# There's a typo in .potm that's corrected in this alternate source:
+# http://therightstuff.de/2006/12/16/Office+2007+File+Icons+For+Windows+SharePoint+Services+20+And+SharePoint+Portal+Server+2003.aspx
+application/msword	dot
+application/vnd.openxmlformats-officedocument.wordprocessingml.document	docx
+application/vnd.openxmlformats-officedocument.wordprocessingml.template	dotx
+application/vnd.ms-word.document.macroEnabled.12	docm
+application/vnd.ms-word.template.macroEnabled.12	dotm
+application/vnd.ms-excel	xlt
+application/vnd.ms-excel	xla
+application/vnd.openxmlformats-officedocument.spreadsheetml.sheet	xlsx
+application/vnd.openxmlformats-officedocument.spreadsheetml.template	xltx
+application/vnd.ms-excel.sheet.macroEnabled.12	xlsm
+application/vnd.ms-excel.template.macroEnabled.12	xltm
+application/vnd.ms-excel.addin.macroEnabled.12	xlam
+application/vnd.ms-excel.sheet.binary.macroEnabled.12	xlsb
+application/vnd.ms-powerpoint	pot
+application/vnd.ms-powerpoint	pps
+application/vnd.ms-powerpoint	ppa
+application/vnd.openxmlformats-officedocument.presentationml.presentation	pptx
+application/vnd.openxmlformats-officedocument.presentationml.template	potx
+application/vnd.openxmlformats-officedocument.presentationml.slideshow	ppsx
+application/vnd.ms-powerpoint.addin.macroEnabled.12	ppam
+application/vnd.ms-powerpoint.presentation.macroEnabled.12	pptm
+application/vnd.ms-powerpoint.template.macroEnabled.12	potm
+application/vnd.ms-powerpoint.slideshow.macroEnabled.12	ppsm
+# End MS Office MIME types.
Index: branches/fc15-dev/server/common/oursrc/execsys/upd-execsys
===================================================================
--- branches/fc15-dev/server/common/oursrc/execsys/upd-execsys	(revision 1803)
+++ branches/fc15-dev/server/common/oursrc/execsys/upd-execsys	(revision 1878)
@@ -53,4 +53,27 @@
  xls
  ppt
+ dot
+ docx
+ dotx
+ docm
+ dotm
+ xlt
+ xla
+ xlsx
+ xltx
+ xlsm
+ xltm
+ xlam
+ xlsb
+ pot
+ pps
+ ppa
+ pptx
+ potx
+ ppsx
+ ppam
+ pptm
+ potm
+ ppsm
  swf
  mp3
@@ -70,4 +93,18 @@
  ttf
  otf
+ odc
+ odb
+ odf
+ odg
+ otg
+ odi
+ odp
+ otp
+ ods
+ ots
+ odt
+ odm
+ ott
+ oth
 );
 
