Changeset 1157

Show
Ignore:
Timestamp:
05/16/08 17:51:36 (4 months ago)
Author:
rats
Message:

* Fixed #1250: Please harden the php open_basedir pathes in the apache config files.
* Fixed #1260: Syntaxerror in ispcp-als-mngr
* Fixed #1144: Show all support tickets to adminShow all support tickets to admin
* Fixed #1226: Logging Deamon (Mail)
* Fixed #1258: possible XSS - Cross Site Scripting in some GUI-files
* Fixed #1259: tiny typos in php comments
* Fixed #923: Open basedir errors with filemanager. Anyone else has the same error?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r1156 r1157  
    11ispCP ω 1.0.0 Changelog 
    22~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     3 
     42008-05-16 Benedikt Heintel 
     5        - CONFIGS: 
     6                * Fixed #1250: Please harden the php open_basedir pathes in the apache config files. 
     7        - ENGINE: 
     8                * Fixed #1260: Syntaxerror in ispcp-als-mngr 
     9        - GUI: 
     10                * Fixed #1144: Show all support tickets to adminShow all support tickets to admin 
     11                * Fixed #1226: Logging Deamon (Mail) 
     12                * Fixed #1258: possible XSS - Cross Site Scripting in some GUI-files 
     13                * Fixed #1259: tiny typos in php comments 
     14        - TOOLS: 
     15                * Fixed #923: Open basedir errors with filemanager. Anyone else has the same error? 
    316 
    4172008-05-15 Benedikt Heintel 
  • trunk/configs/centos/apache/parts/als_php2_entry.tpl

    r1156 r1157  
    11    <IfModule mod_php4.c> 
    2         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     2        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    33        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    44        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
     
    66    </IfModule> 
    77    <IfModule mod_php5.c> 
    8         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     8        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    99        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    1010        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
  • trunk/configs/debian/apache/parts/als_php2_entry.tpl

    r1156 r1157  
    11    <IfModule mod_php4.c> 
    2         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     2        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    33        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    44        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
     
    66    </IfModule> 
    77    <IfModule mod_php5.c> 
    8         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     8        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    99        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    1010        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
  • trunk/configs/fedora/apache/parts/als_php2_entry.tpl

    r1156 r1157  
    11    <IfModule mod_php4.c> 
    2         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     2        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    33        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    44        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
     
    66    </IfModule> 
    77    <IfModule mod_php5.c> 
    8         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     8        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    99        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    1010        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
  • trunk/configs/freebsd/apache/parts/als_php2_entry.tpl

    r1156 r1157  
    11    <IfModule mod_php4.c> 
    2         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     2        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    33        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    44        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
     
    66    </IfModule> 
    77    <IfModule mod_php5.c> 
    8         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     8        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    99        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    1010        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
  • trunk/configs/gentoo/apache/parts/als_php2_entry.tpl

    r1156 r1157  
    11    <IfModule mod_php4.c> 
    2         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     2        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    33        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    44        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
     
    66    </IfModule> 
    77    <IfModule mod_php5.c> 
    8         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     8        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    99        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    1010        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
  • trunk/configs/openbsd/apache/parts/als_php2_entry.tpl

    r1156 r1157  
    11    <IfModule mod_php4.c> 
    2         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     2        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    33        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    44        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
     
    66    </IfModule> 
    77    <IfModule mod_php5.c> 
    8         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     8        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    99        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    1010        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
  • trunk/configs/opensuse/apache/parts/als_php2_entry.tpl

    r1156 r1157  
    11    <IfModule mod_php4.c> 
    2         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     2        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    33        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    44        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
     
    66    </IfModule> 
    77    <IfModule mod_php5.c> 
    8         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     8        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    99        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    1010        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
  • trunk/configs/redhat/apache/parts/als_php2_entry.tpl

    r1156 r1157  
    11    <IfModule mod_php4.c> 
    2         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     2        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    33        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    44        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
     
    66    </IfModule> 
    77    <IfModule mod_php5.c> 
    8         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     8        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    99        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    1010        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
  • trunk/configs/ubuntu/apache/parts/als_php2_entry.tpl

    r1156 r1157  
    11    <IfModule mod_php4.c> 
    2         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     2        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    33        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    44        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
     
    66    </IfModule> 
    77    <IfModule mod_php5.c> 
    8         php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp//:{PEAR_DIR}/" 
     8        php_admin_value open_basedir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}:{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/:{PEAR_DIR}/" 
    99        php_admin_value upload_tmp_dir "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
    1010        php_admin_value session.save_path "{WWW_DIR}/{DMN_NAME}{MOUNT_POINT}/phptmp/" 
  • trunk/engine/ispcp-als-mngr

    r1156 r1157  
    4040################################################################################ 
    4141## 
    42 ##  
     42## 
    4343## 
    4444sub als_mngr_start_up { 
    4545        my ($rs, $rdata) = (undef, undef); 
    46          
     46 
    4747        push_el(\@main::el, 'als_mngr_start_up()', 'Starting...'); 
    48          
     48 
    4949        # checking for master process; 
    5050        $rs = check_master(); 
    5151        return $rs if ($rs != 0); 
    52          
     52 
    5353        # Let's clear Execution Logs, if any. 
    5454        if (-e $main::ispcp_als_mngr_el) { 
     
    5656                return $rs if ($rs != 0); 
    5757        } 
    58          
     58 
    5959        # config check; 
    6060        $rs = get_conf(); 
    6161        return $rs if ($rs != 0); 
    62          
     62 
    6363        # sql check; 
    6464        # 
     
    9393        ($rs, $rdata) = doSQL($sql); 
    9494        return $rs if ($rs != 0); 
    95          
     95 
    9696        $rs = get_domain_ids(); 
    9797        return $rs if ($rs != 0); 
    98          
     98 
    9999        $rs = get_subdom_ids(); 
    100100        return $rs if ($rs != 0); 
    101          
     101 
    102102        $rs = get_alias_ids(); 
    103103        return $rs if ($rs != 0); 
    104          
     104 
    105105        $rs = get_ip_nums(); 
    106106        return $rs if ($rs != 0); 
    107          
     107 
    108108        # 
    109109        # getting task id and domain record id; 
    110110        # 
    111111        $main::als_task_id = $ARGV[0]; 
    112          
     112 
    113113        push_el(\@main::el, 'als_mngr_start_up()', 'Ending...'); 
    114114        return 0; 
     
    118118################################################################################ 
    119119## 
    120 ##  
     120## 
    121121## 
    122122sub als_mngr_shut_down { 
    123123        my $rs = undef; 
    124          
     124 
    125125        push_el(\@main::el, 'als_mngr_shut_down()', 'Starting...'); 
    126126        push_el(\@main::el, 'als_mngr_shut_down()', 'Ending...'); 
    127          
     127 
    128128        return 0; 
    129129} 
     
    143143        my ($als_data)   = @_; 
    144144        my ($rs, $rdata) = (undef, undef); 
    145          
     145 
    146146        push_el(\@main::el, 'als_add_named_cfg_data()', 'Starting...'); 
    147147        if (!defined($als_data) || $als_data eq '') { 
     
    149149                return -1; 
    150150        } 
    151          
     151 
    152152        # 
    153153        # Initial data we need; 
     
    163163        my $backup_cfg   = "$backup_dir/named.conf.$timestamp"; 
    164164        my $working_cfg  = "$working_dir/named.conf"; 
    165          
     165 
    166166        # 
    167167        #  BEGIN/END tags, and templates needed for this config; 
     
    184184        ); 
    185185        return $rs if ($rs != 0); 
    186          
     186 
    187187        # 
    188188        # Let's construct nedded tags and entries; 
     
    205205        ); 
    206206        return $rs if ($rs != 0); 
    207          
     207 
    208208        # 
    209209        # Let's get Sytem and Workind config files; 
     
    212212        ($rs, $sys) = get_file($sys_cfg); 
    213213        return $rs  if ($rs != 0); 
    214          
     214 
    215215        ($rs, $working) = get_file($working_cfg); 
    216216        return $rs  if ($rs != 0); 
    217          
     217 
    218218        ($rs, $rdata) = get_tag($dta_b, $dta_e, $working); 
    219219        return $rs if ($rs != 0); 
    220          
     220 
    221221        # 
    222222        # Is the new domain entry exists ? 
     
    230230        ($rs, $rdata) = get_tag($entry_b, $entry_e, $working); 
    231231        return $rs if ($rs != 0); 
    232          
     232 
    233233        # 
    234234        # Let's contruct the replacement and do it; 
     
    237237        ($rs, $working) = repl_tag($entry_b, $entry_e, $working, $entry_repl, "als_add_named_cfg_data"); 
    238238        return $rs if ($rs != 0); 
    239          
     239 
    240240        # 
    241241        # Here we'll backup production config file; 
     
    243243        $rs = sys_command("cp -p $sys_cfg $backup_cfg"); 
    244244        return $rs if ($rs != 0); 
    245          
     245 
    246246        # 
    247247        # Let's save working copy; 
     
    249249        $rs = store_file($working_cfg, $working, $main::cfg{'ROOT_USER'}, $main::cfg{'ROOT_GROUP'}, 0644); 
    250250        return $rs if ($rs != 0); 
    251          
     251 
    252252        # 
    253253        # Here we'll replace data in production config file with data in working 
     
    266266        $rs = store_file($sys_cfg, $sys, $main::cfg{'ROOT_USER'}, $main::cfg{'ROOT_GROUP'}, 0644); 
    267267        return $rs if ($rs != 0); 
    268          
     268 
    269269        push_el(\@main::el, 'als_add_named_cfg_data()', 'Ending...'); 
    270270        return 0; 
     
    275275################################################################################ 
    276276## 
    277 ##  
     277## 
    278278## 
    279279sub als_del_named_cfg_data { 
    280280        my ($als_data)   = @_; 
    281281        my ($rs, $rdata) = (undef, undef); 
    282          
     282 
    283283        push_el(\@main::el, 'als_del_named_cfg_data()', 'Starting...'); 
    284284        if (!defined($als_data) || $als_data eq '') { 
     
    286286                return -1; 
    287287        } 
    288          
     288 
    289289        # 
    290290        # Initial data we need; 
     
    320320        ); 
    321321        return $rs if ($rs != 0); 
    322          
     322 
    323323        # 
    324324        # Let's construct nedded tags and entries; 
     
    341341        ); 
    342342        return $rs if ($rs != 0); 
    343          
     343 
    344344        # 
    345345        # Let's get Sytem and Workind config files; 
     
    348348        ($rs, $sys) = get_file($sys_cfg); 
    349349        return $rs  if ($rs != 0); 
    350          
     350 
    351351        ($rs, $working) = get_file($working_cfg); 
    352352        return $rs  if ($rs != 0); 
    353          
     353 
    354354        ($rs, $rdata) = get_tag($dta_b, $dta_e, $working); 
    355355        return $rs if ($rs != 0); 
    356          
     356 
    357357        # 
    358358        # Is the new domain entry exists ? 
     
    366366        ($rs, $rdata) = get_tag($entry_b, $entry_e, $working); 
    367367        return $rs if ($rs != 0); 
    368          
     368 
    369369        # 
    370370        # Let's contruct the replacement and do it; 
     
    376376        # 
    377377        #return $rs if ($rs != 0); 
    378          
     378 
    379379        # 
    380380        # 
     
    383383        $rs = sys_command("cp -p $sys_cfg $backup_cfg"); 
    384384        return $rs if ($rs != 0); 
    385          
     385 
    386386        # 
    387387        # Let's save working copy; 
     
    389389        $rs = store_file($working_cfg, $working, $main::cfg{'ROOT_USER'}, $main::cfg{'ROOT_GROUP'}, 0644); 
    390390        return $rs if ($rs != 0); 
    391          
     391 
    392392        # 
    393393        # Here we'll replace data in production config file with data in working 
     
    406406        $rs = store_file($sys_cfg, $sys, $main::cfg{'ROOT_USER'}, $main::cfg{'ROOT_GROUP'}, 0644); 
    407407        return $rs if ($rs != 0); 
    408          
     408 
    409409        push_el(\@main::el, 'als_del_named_cfg_data()', 'Ending...'); 
    410410        return 0; 
     
    414414################################################################################ 
    415415## 
    416 ##  
     416## 
    417417## 
    418418 
     
    420420        my ($als_data)   = @_; 
    421421        my ($rs, $rdata) = (undef, undef); 
    422          
     422 
    423423        push_el(\@main::el, 'als_add_named_db_data()', 'Starting...'); 
    424          
     424 
    425425        if (!defined($als_data) || $als_data eq '') { 
    426426                push_el(\@main::el, 'als_add_named_db_data()', 'ERROR: Undefined Input Data...'); 
    427427                return -1; 
    428428        } 
    429          
     429 
    430430        # 
    431431        # Initial data we need; 
     
    438438        my $base_svr_ip  = $main::cfg{'BASE_SERVER_IP'}; 
    439439        my $sec_dns_ip   = $main::cfg{'SECONDARY_DNS'}; 
    440          
     440 
    441441        # 
    442442        # Any secondary DNS defined; 
     
    445445                $sec_dns_ip = $base_svr_ip; 
    446446        } 
    447          
     447 
    448448        my $tpl_dir     = "$conf_dir/bind/parts"; 
    449449        my $backup_dir  = "$conf_dir/bind/backup"; 
     
    452452        my $sys_cfg     = "$named_db_dir/$db_fname"; 
    453453        my $working_cfg = "$working_dir/$db_fname"; 
    454          
     454 
    455455        # 
    456456        # Let's get needed tags and templates; 
     
    464464        ); 
    465465        return $rs if ($rs != 0); 
    466          
     466 
    467467        my $seq = 0; 
    468468        # 
     
    471471        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); 
    472472        my $time2 = sprintf "%4d%02d%02d00",$year+1900,$mon+1,$mday,$seq; 
    473          
     473 
    474474        # 
    475475        # Let's prepare them; 
     
    489489        ); 
    490490        return $rs if ($rs != 0); 
    491          
     491 
    492492        #if ($main::cfg{'SECONDARY_DNS'}) { 
    493493        #   my $dns2 = undef; 
     
    500500        #    return $rs if ($rs != 0); 
    501501        #} 
    502          
     502 
    503503        # 
    504504        # Let's store generated data; 
     
    506506        $rs = store_file($working_cfg, $entry, $main::cfg{'ROOT_USER'}, $main::cfg{'ROOT_GROUP'}, 0644); 
    507507        return $rs if ($rs != 0); 
    508          
     508 
    509509        $rs = store_file($sys_cfg, $entry, $main::cfg{'ROOT_USER'}, $main::cfg{'ROOT_GROUP'}, 0644); 
    510510        return $rs if ($rs != 0); 
    511          
     511 
    512512        push_el(\@main::el, 'als_add_named_db_data()', 'Ending...'); 
    513513        return 0; 
     
    518518################################################################################ 
    519519## 
    520 ##  
     520## 
    521521## 
    522522sub als_del_named_db_data { 
    523523        my ($als_data)   = @_; 
    524524        my ($rs, $rdata) = (undef, undef); 
    525          
     525 
    526526        push_el(\@main::el, 'als_del_named_db_data()', 'Starting...'); 
    527527        if (!defined($als_data) || $als_data eq '') { 
     
    529529                return -1; 
    530530        } 
    531          
     531 
    532532        # 
    533533        # Initial data we need; 
     
    549549        $rs = del_file($working_cfg); 
    550550        return $rs if ($rs != 0); 
    551          
     551 
    552552        $rs = del_file($sys_cfg); 
    553553        return $rs if ($rs != 0); 
    554          
     554 
    555555        push_el(\@main::el, 'als_del_named_db_data()', 'Ending...'); 
    556556        return 0; 
     
    561561################################################################################ 
    562562## 
    563 ##  
     563## 
    564564## 
    565565sub als_add_named_data { 
    566566        my ($als_data) = @_; 
    567567        my $rs         = undef; 
    568          
     568 
    569569        push_el(\@main::el, 'als_add_named_data()', 'Starting...'); 
    570570        if (!defined($als_data) || $als_data eq '') { 
     
    573573        } 
    574574        return 0 if ($main::cfg{'CMD_NAMED'} eq 'no'); 
    575          
     575 
    576576        $rs = als_add_named_cfg_data($als_data); 
    577577        return $rs if ($rs != 0); 
    578          
     578 
    579579        $rs = als_add_named_db_data($als_data); 
    580580        return $rs if ($rs != 0); 
    581          
     581 
    582582        push_el(\@main::el, 'als_add_named_data()', 'Ending...'); 
    583583        return 0; 
     
    588588################################################################################ 
    589589## 
    590 ##  
     590## 
    591591## 
    592592sub als_change_named_data { 
    593593        my ($als_data) = @_; 
    594594        my $rs         = undef; 
    595          
     595 
    596596        push_el(\@main::el, 'als_change_named_data()', 'Starting...'); 
    597597        if (!defined($als_data) || $als_data eq '') { 
     
    600600        } 
    601601        return 0 if ($main::cfg{'CMD_NAMED'} eq 'no'); 
    602          
     602 
    603603        $rs = als_add_named_data($als_data); 
    604604        return $rs if ($rs != 0); 
    605          
     605 
    606606        push_el(\@main::el, 'als_change_named_data()', 'Ending...'); 
    607607        return 0; 
     
    612612################################################################################ 
    613613## 
    614 ##  
     614## 
    615615## 
    616616sub als_del_named_data { 
    617617        my ($als_data) = @_; 
    618618        my $rs         = undef; 
    619          
     619 
    620620        push_el(\@main::el, 'als_del_named_data()', 'Starting...'); 
    621621        if (!defined($als_data) || $als_data eq '') { 
     
    624624        } 
    625625        return 0 if ($main::cfg{'CMD_NAMED'} eq 'no'); 
    626          
     626 
    627627        $rs = als_del_named_cfg_data($als_data); 
    628628        return $rs if ($rs != 0); 
    629          
     629 
    630630        $rs = als_del_named_db_data($als_data); 
    631631        return $rs if ($rs != 0); 
    632          
     632 
    633633        push_el(\@main::el, 'als_del_named_data()', 'Ending...'); 
    634634        return 0; 
     
    644644################################################################################ 
    645645## 
    646 ##  
     646## 
    647647## 
    648648sub gen_httpd_als_entry { 
    649649        my ($als_data) = @_; 
    650          
     650 
    651651        push_el(\@main::el, 'gen_httpd_als_entry()', 'Starting...'); 
    652652        if (!defined($als_data) || $als_data eq '') { 
     
    721721        ); 
    722722        return ($rs, '') if ($rs != 0); 
    723          
     723 
    724724        push_el(\@main::el, 'als_entry:', "$als_e"); 
    725          
     725 
    726726        my ($suexec_uid, $suexec_gid)    = get_dmn_suexec_user($dmn_id); 
    727727        my $suexec_user_pref             = $main::cfg{'APACHE_SUEXEC_USER_PREF'}; 
     
    769769        ); 
    770770        return ($rs, '') if ($rs != 0); 
    771          
     771 
    772772        # 
    773773        # Any CGI entry? 
    774774        # 
    775775        my $cgi_entry = undef; 
    776          
     776 
    777777        if ($als_cgi eq 'yes') { 
    778778                $cgi_entry = "$als_cgi_b$als_cgi_entry$als_cgi_e"; 
     
    788788        ); 
    789789        return ($rs, '') if ($rs != 0); 
    790          
     790 
    791791        # 
    792792        # Any PHP entry? 
     
    815815        ); 
    816816        return ($rs, '') if ($rs != 0); 
    817          
     817 
    818818        # 
    819819        # Any REDIRECT entry? 
     
    831831        } 
    832832        my $als_result_entry = "$als_b$als_entry$als_e"; 
    833          
     833 
    834834        # 
    835835        # Custom domain config file 
     
    837837        if ( ! -e "$main::cfg{'APACHE_CUSTOM_SITES_CONFIG_DIR'}/$als_name.conf" ){ 
    838838                $rs = store_file( 
    839                         "$main::cfg{'APACHE_CUSTOM_SITES_CONFIG_DIR'}/$als_name.conf",  
    840                         $als_custom,  
    841                         $main::cfg{'ROOT_USER'},  
    842                         $main::cfg{'ROOT_GROUP'},  
     839                        "$main::cfg{'APACHE_CUSTOM_SITES_CONFIG_DIR'}/$als_name.conf", 
     840                        $als_custom, 
     841                        $main::cfg{'ROOT_USER'}, 
     842                        $main::cfg{'ROOT_GROUP'}, 
    843843                        0644 
    844844                ); 
     
    853853################################################################################ 
    854854## 
    855 ##  
     855## 
    856856## 
    857857sub als_add_httpd_cfg_data { 
    858858        my ($als_data)   = @_; 
    859859        my ($rs, $rdata) = (undef, undef); 
    860          
     860 
    861861        push_el(\@main::el, 'als_add_httpd_cfg_data()', 'Starting...'); 
    862862        if (!defined($als_data) || $als_data eq '') { 
     
    864864                return -1; 
    865865        } 
    866          
     866 
    867867        my $als_name    = @$als_data[2]; 
    868868        my $als_ip_id   = @$als_data[5]; 
     
    876876        my $timestamp   = time; 
    877877        my $backup_cfg  = "$backup_dir/httpd.conf.$timestamp"; 
    878          
     878 
    879879        # 
    880880        # Getting needed templates; 
     
    909909        ); 
    910910        return $rs if ($rs != 0); 
    911          
     911 
    912912        # 
    913913        # Preparing templates; 
     
    952952        ($rs, $als_entry_contents) = gen_httpd_als_entry($als_data); 
    953953        return $rs if ($rs != 0); 
    954          
     954 
    955955        # 
    956956        # Let's get some configs; 
    957957        # 
    958958        my ($sys, $working) = ('', ''); 
    959          
     959 
    960960        ($rs, $sys) = get_file($sys_cfg); 
    961961        return $rs if ($rs != 0); 
    962          
     962 
    963963        ($rs, $working) = get_file($working_cfg); 
    964964        return $rs if ($rs != 0); 
    965          
     965 
    966966        # 
    967967        # Check for $cfg_b, $cfg_e in working config; 
     
    969969        ($rs, $rdata) = get_tag($cfg_b, $cfg_e, $working); 
    970970        return $rs if ($rs != 0); 
    971          
     971 
    972972        # 
    973973        # Check for $vh_b_val, $vh_e_val in working config; 
     
    976976        my $vh_entry_contents = ''; 
    977977        ($rs, $vh_entry_contents) = get_tag($vh_b_val, $vh_e_val, $working);