[freeside-commits] freeside/FS/FS UID.pm,1.30,1.31
Ivan,,,
ivan at wavetail.420.am
Tue Jul 25 21:18:03 PDT 2006
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv961
Modified Files:
UID.pm
Log Message:
ugh, fixup bootstrapping
Index: UID.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/UID.pm,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- UID.pm 14 Jul 2006 01:42:42 -0000 1.30
+++ UID.pm 26 Jul 2006 04:18:01 -0000 1.31
@@ -10,7 +10,7 @@
getsecrets cgisetotaker
);
use Exporter;
-use Carp qw(carp croak cluck);
+use Carp qw(carp croak cluck confess);
use DBI;
use FS::Conf;
use FS::CurrentUser;
@@ -72,6 +72,7 @@
sub forksuidsetup {
$user = shift;
+ my $olduser = $user;
if ( $FS::CurrentUser::upgrade_hack ) {
$user = 'fs_bootstrap';
@@ -91,7 +92,11 @@
croak "Not running uid freeside!" unless checkeuid();
- $dbh = &myconnect;
+ if ( $FS::CurrentUser::upgrade_hack && $olduser ) {
+ $dbh = &myconnect($olduser);
+ } else {
+ $dbh = &myconnect();
+ }
use FS::Schema qw(reload_dbdef);
reload_dbdef("/usr/local/etc/freeside/dbdef.$datasrc")
@@ -110,10 +115,10 @@
}
sub myconnect {
- DBI->connect( getsecrets, { 'AutoCommit' => 0,
- 'ChopBlanks' => 1,
- 'ShowErrorStatement' => 1,
- }
+ DBI->connect( getsecrets(@_), { 'AutoCommit' => 0,
+ 'ChopBlanks' => 1,
+ 'ShowErrorStatement' => 1,
+ }
)
or die "DBI->connect error: $DBI::errstr\n";
}
@@ -275,7 +280,7 @@
if ( $conf->exists('mapsecrets') ) {
die "No user!" unless $user;
my($line) = grep /^\s*($user|\*)\s/, $conf->config('mapsecrets');
- die "User $user not found in mapsecrets!" unless $line;
+ confess "User $user not found in mapsecrets!" unless $line;
$line =~ /^\s*($user|\*)\s+(.*)$/;
$secrets = $2;
die "Illegal mapsecrets line for user?!" unless $secrets;
More information about the freeside-commits
mailing list