projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
preload modules
[freeside.git]
/
FS
/
FS
/
InitHandler.pm
diff --git
a/FS/FS/InitHandler.pm
b/FS/FS/InitHandler.pm
index
9a2154a
..
45bf1ac
100644
(file)
--- a/
FS/FS/InitHandler.pm
+++ b/
FS/FS/InitHandler.pm
@@
-1,12
+1,15
@@
package FS::InitHandler;
use strict;
package FS::InitHandler;
use strict;
+use vars qw($DEBUG);
use FS::UID qw(adminsuidsetup);
use FS::Record;
use FS::UID qw(adminsuidsetup);
use FS::Record;
+$DEBUG = 1;
+
sub handler {
sub handler {
-=pod
+
#
=pod
use Date::Format;
use Date::Parse;
use Date::Format;
use Date::Parse;
@@
-59,17
+62,31
@@
sub handler {
=cut
=cut
+ 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: $!";
open(MAPSECRETS,"<$FS::UID::conf_dir/mapsecrets")
or die "can't read $FS::UID::conf_dir/mapsecrets: $!";
+ my %seen;
while (<MAPSECRETS>) {
while (<MAPSECRETS>) {
- /^([\w\-\.]+)\s/ or do { warn "strange line in mapsecrets: $_"; next; };
- my $user = $1;
+ next if /^\s*(#|$)/;
+ /^([\w\-\.]+)\s(.*)$/
+ or do { warn "strange line in mapsecrets: $_"; next; };
+ my($user, $datasrc) = ($1, $2);
+ next if $seen{$datasrc}++;
+ warn "[FS::InitHandler] preloading $datasrc for $user\n" if $DEBUG;
adminsuidsetup($user);
}
close MAPSECRETS;
adminsuidsetup($user);
}
close MAPSECRETS;
+ #lalala probably broken on freebsd
+ ($<, $>) = ($>, $<);
+ $< = 0;
+
}
1;
}
1;