fix to allow running during apache init
[freeside.git] / FS / FS / InitHandler.pm
index 7369730..31aacc7 100644 (file)
@@ -64,11 +64,15 @@ sub handler {
 
   warn "[FS::InitHandler] handler called\n" if $DEBUG;
 
+  #this is sure to be broken on freebsd
+  $> = $FS::UID::freeside_uid;
+
   open(MAPSECRETS,"<$FS::UID::conf_dir/mapsecrets")
     or die "can't read $FS::UID::conf_dir/mapsecrets: $!";
 
   my %seen;
   while (<MAPSECRETS>) {
+    next if /^\s*(#|$)/;
     /^([\w\-\.]+)\s(.*)$/
       or do { warn "strange line in mapsecrets: $_"; next; };
     my($user, $datasrc) = ($1, $2);
@@ -79,6 +83,10 @@ sub handler {
 
   close MAPSECRETS;
 
+  #lalala probably broken on freebsd
+  ($<, $>) = ($>, $<);
+  $< = 0;
+
 }
 
 1;