Changeset 1361

Show
Ignore:
Timestamp:
09/27/08 23:18:17 (2 months ago)
Author:
scitech
Message:

database backup fails afer critical revision 1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/engine/backup/ispcp-backup-all

    r1270 r1361  
    144144sub err_exit { 
    145145 
    146     my $el_data = pop_el(\@main::el); 
     146       my $el_data = pop_el(\@main::el); 
    147147 
    148148        $main::el_sep = "\t#\t"; 
     
    152152        print STDERR "$msg\n"; 
    153153 
    154     exit 1; 
     154       exit 1; 
    155155 
    156156} 
     
    319319                # 
    320320 
    321         $sql="SELECT sqld_id, sqld_name FROM sql_database WHERE domain_id=$dmn_id"; 
     321               $sql="SELECT sqld_id, sqld_name FROM sql_database WHERE domain_id=$dmn_id"; 
    322322                ($rs,my $rdata3) = doSQL($sql); 
    323323 
     
    333333                                foreach(@$rdata2) { 
    334334                                        $dbuser = @$_[0]; 
    335                                         $dbpass = @$_[1]; 
     335                                        if($main::use_crypted_pwd){ 
     336                                                $dbpass = decrypt_db_password(@$_[1]); 
     337                                        } else { 
     338                                                $dbpass = @$_[1]; 
     339                                        } 
    336340                                } 
    337341                                if ($dbuser && $dbpass) { 
     
    420424} 
    421425 
     426sub use_crypted_pwd { 
     427 
     428        my ($rs, $rdata, $sql) = (undef, undef, undef); 
     429 
     430        push_el(\@main::el, 'database_revision()', 'Starting...'); 
     431 
     432        $sql="SELECT `value` FROM `config` WHERE `name`='CRITICAL_UPDATE_REVISION'"; 
     433        ($rs, $rdata) = doSQL($sql); 
     434        return $rs if ($rs != 0); 
     435 
     436        if (defined(@$rdata[0]) && defined(@{@$rdata[0]}[0])){  
     437                $main::use_crypted_pwd = 1; 
     438        } else { 
     439                $main::use_crypted_pwd = 0; 
     440        } 
     441 
     442        push_el(\@main::el, 'database_revision()', 'Ending...'); 
     443        return 0; 
     444 
     445} 
    422446 
    423447my $rs = undef; 
     
    450474exit 0 if ($rs == 2); # $rs == 2 when backups are disabled 
    451475 
     476$rs = use_crypted_pwd(); 
     477err_exit() if ($rs != 0); 
     478 
    452479$rs = backup_all_engine(); 
    453480 
  • trunk/engine/ispcp_common_methods.pl

    r1319 r1361  
    132132$main::db = undef; 
    133133 
     134$main::use_crypted_pwd = undef; 
     135 
    134136$main::master_name = 'ispcp-rqst-mngr'; 
    135137