File:  [LON-CAPA] / loncom / debugging_tools / modify_config_files.pl
Revision 1.19: download - view: text, annotated - select for diffs
Mon Mar 22 21:15:53 2021 UTC (3 years, 2 months ago) by raeburn
Branches: MAIN
CVS tags: HEAD
- Store wait_timeout value in appropriate MySQL config file for Ubuntu.

    1: #!/usr/bin/perl -w
    2: #
    3: # The LearningOnline Network
    4: #
    5: # $Id: modify_config_files.pl,v 1.19 2021/03/22 21:15:53 raeburn Exp $
    6: #
    7: # Copyright Michigan State University Board of Trustees
    8: #
    9: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
   10: #
   11: # LON-CAPA is free software; you can redistribute it and/or modify
   12: # it under the terms of the GNU General Public License as published by
   13: # the Free Software Foundation; either version 2 of the License, or
   14: # (at your option) any later version.
   15: #
   16: # LON-CAPA is distributed in the hope that it will be useful,
   17: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   18: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   19: # GNU General Public License for more details.
   20: #
   21: # You should have received a copy of the GNU General Public License
   22: # along with LON-CAPA; if not, write to the Free Software
   23: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   24: #
   25: # /home/httpd/html/adm/gpl.txt
   26: #
   27: # http://www.lon-capa.org/
   28: #
   29: ###
   30: 
   31: =pod
   32: 
   33: =head1 NAME
   34: 
   35: B<modify_config_files.pl>
   36: 
   37: =head1 SYNOPSIS
   38: 
   39: This script modifies /etc/my.cnf and one of: /etc/yum.conf 
   40: (for CentOS/Scientific Linux/RHEL >=5 and <8), /etc/apt/sources.list
   41: (for Debian/Ubuntu), /etc/sysconfig/rhn/sources (for RHEL4),
   42: and /etc/yum.repos.d/loncapa.repo (Fedora >= 21; Oracle Linux; 
   43: CentOS/RHEL >= 8).
   44: 
   45: =head1 DESCRIPTION
   46: 
   47: This script modifies /etc/my.cnf, /etc/yum.conf, /etc/yum.repos.d/loncapa.repo,
   48: /etc/apt/sources, or /etc/sysconfig/rhn/sources to ensure certain
   49: parameters are set properly.
   50: 
   51: The LON-CAPA yum repositories are added to /etc/yum.conf, 
   52: /etc/yum.repos.d/loncapa.repo, /etc/sysconfig/rhn/sources
   53: and the LON-CAPA apt repositories are added to 
   54: /etc/apt/sources.list.
   55: 
   56: The /etc/my.cnf file is modified to set the wait_timeout to 1 year.  Backup
   57: copies of each file are made in /etc, /etc/apt, and /etc/sysconfig/rhn, as 
   58: appropriate.
   59: 
   60: =cut
   61: 
   62: use strict;
   63: use File::Copy;
   64: use lib '/home/httpd/lib/perl/';
   65: use LONCAPA::Configuration;
   66: my $loncapa_config=LONCAPA::Configuration::read_conf('loncapa.conf');
   67: 
   68: open(DSH,"$$loncapa_config{'lonDaemons'}/distprobe |");
   69: my $dist = <DSH>;
   70: chomp($dist);
   71: close(DSH);
   72: 
   73: my $yum_status;
   74: my $loninst = 'http://install.loncapa.org';
   75: my $loninst_re = 'http://install\.loncapa\.org';
   76: if ($dist =~ /^fedora(\d+)$/) {
   77:     my $file = '/etc/yum.conf';
   78:     my $ver = $1;
   79:     my $gpgchk = '0';
   80:     my $gpg = "$loninst/versions/fedora/RPM-GPG-KEY-loncapa"; 
   81:     my $nobackup;
   82:     if ($ver > 6) {
   83:         $gpgchk = '1';
   84:     }
   85:     if ($ver >= 21) {
   86:         $file = '/etc/yum.repos.d/loncapa.repo';
   87:         $nobackup = 1;
   88:     }
   89:     $yum_status =  
   90:         &update_file($file,
   91:              [{section => 'loncapa-updates-basearch',
   92:                key     => 'name=',
   93:                value   => 'Fedora Core $releasever LON-CAPA $basearch Updates',
   94:            }, {section => 'loncapa-updates-basearch',
   95:                key     => 'baseurl=',
   96:                value   => $loninst.'/fedora/linux/loncapa/$releasever/$basearch',
   97:            }, {section => 'loncapa-updates-basearch',
   98:                key     => 'gpgcheck=',
   99:                value   =>  $gpgchk,
  100:            }, {section => 'loncapa-updates-basearch',
  101:                key     => 'gpgkey=',
  102:                value   => $gpg,
  103:            }, {section => 'loncapa-updates-noarch',
  104:                key     => 'name=',
  105:                value   => 'Fedora Core $releasever LON-CAPA noarch Updates',
  106:            }, {section => 'loncapa-updates-noarch',
  107:                key     => 'baseurl=',
  108:                value   => $loninst.'/fedora/linux/loncapa/$releasever/noarch',
  109:            }, {section => 'loncapa-updates-noarch',
  110:                key     => 'gpgcheck=',
  111:                value   => $gpgchk,
  112:            }, {section => 'loncapa-updates-noarch',
  113:                key     => 'gpgkey=',
  114:                value   => $gpg,
  115:            }],$nobackup);
  116: } elsif ($dist =~ /^(rhes|centos|scientific|oracle)(\d+)$/) {
  117:     my $type = $1;
  118:     my $ver = $2;
  119:     my $longver = $ver;
  120:     my $nobackup;
  121:     if ($type eq 'rhes') {
  122:         if ($ver == 4) {
  123:             $longver = '4ES';
  124:         } elsif ($ver == 5) {
  125:             $longver = '5Server';
  126:         }
  127:     }
  128:     my %info = (
  129:                  rhes => {
  130:                            title => 'RHEL',
  131:                            path => 'redhat/linux/enterprise/loncapa',
  132:                            gpg => 'versions/redhat/RPM-GPG-KEY-loncapa',
  133:                            gpgchk => 1,
  134:                          },
  135:                  centos => {
  136:                              title => 'CentOS',
  137:                              path => 'centos/loncapa',
  138:                              gpg => 'versions/centos/RPM-GPG-KEY-loncapa',
  139:                              gpgchk => 1,
  140:                            },
  141:                  scientific => {
  142:                                  title => 'Scientific Linux',
  143:                                  path => 'scientific/loncapa',
  144:                                  gpg => 'versions/scientific/RPM-GPG-KEY-loncapa',
  145:                                  gpgchk => 1,
  146:                                },
  147:                  oracle => {
  148:                              title => 'Oracle Linux',
  149:                              path => 'oracle/loncapa',
  150:                              gpg => 'versions/oracle/RPM-GPG-KEY-loncapa',
  151:                              gpgchk => 1,
  152:                            },
  153:                );
  154:     if (ref($info{$type}) eq 'HASH') {
  155:         if ($ver > 4) {
  156:             my $file = '/etc/yum.conf';
  157:             if (($ver > 7) || ($type eq 'oracle')) {
  158:                 $file = '/etc/yum.repos.d/loncapa.repo';
  159:                 $nobackup = 1;
  160:             }
  161:             $yum_status =
  162:                 &update_file($file,
  163:                      [{section => 'loncapa-updates-basearch',
  164:                        key     => 'name=',
  165:                        value   => $info{$type}{title}.' $releasever LON-CAPA $basearch Updates',
  166:                       }, {section => "loncapa-updates-basearch",
  167:                           key     => 'baseurl=',
  168:                           value   => "$loninst/$info{$type}{path}/".'$releasever/$basearch',
  169:                       }, {section => 'loncapa-updates-basearch',
  170:                           key     => 'gpgcheck=',
  171:                           value   => $info{$type}{gpgchk},
  172:                       }, {section => 'loncapa-updates-basearch',
  173:                           key     => 'gpgkey=',
  174:                           value   => "$loninst/$info{$type}{gpg}",
  175:                       }, {section => 'loncapa-updates-noarch',
  176:                           key     => 'name=',
  177:                           value   => $info{$type}{title}.' $releasever LON-CAPA noarch Updates',
  178:                       }, {section => 'loncapa-updates-noarch',
  179:                           key     => 'baseurl=',
  180:                           value   => "$loninst/$info{$type}{path}/".'$releasever/noarch',
  181:                       }, {section => 'loncapa-updates-noarch',
  182:                           key     => 'gpgcheck=',
  183:                           value   => $info{$type}{gpgchk},
  184:                       }, {section => 'loncapa-updates-noarch',
  185:                           key     => 'gpgkey=',
  186:                           value   => "$loninst/$info{$type}{gpg}",
  187:                       }],$nobackup);
  188:         } elsif (($type eq 'rhes') && ($ver == 4)) {
  189:             my %rhn = (
  190:                         basearch => { 
  191:                             regexp => '\s*yum\s+loncapa\-updates\-basearch\s+'.$loninst_re.'/'.$info{$type}{path}.'/'.$longver.'/\$ARCH',
  192:                             text => "yum loncapa-updates-basearch $loninst/$info{$type}{path}/$longver/".'$ARCH',
  193:                                     },
  194:                         noarch =>  {
  195:                             regexp => '\s*yum\s+loncapa\-updates\-noarch\s+'.$loninst_re.'/'.$info{$type}{path}.'/'.$longver.'/noarch',
  196:                             text => "yum loncapa-updates-noarch $loninst/$info{$type}{path}/$longver/noarch",
  197:                                    },
  198:                       );
  199:             $yum_status = &update_rhn_source(\%rhn); 
  200:         }
  201:     }
  202: } elsif ($dist =~ /^(debian|ubuntu)\d+$/) {
  203:     my %apt_get_source = (
  204:                            debian5 => {
  205:                                         regexp => '\s*deb\s+'.$loninst_re.'/debian/?\s+lenny\s+main',
  206:                                         text   => "deb $loninst/debian lenny main",
  207:                                       },
  208:                            ubuntu6 => {
  209:                                         regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+dapper\s+main',
  210:                                         text   => "deb $loninst/ubuntu dapper main",
  211:                                       },
  212:                            ubuntu8 => {
  213:                                         regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+hardy\s+main',
  214:                                         text   => "deb $loninst/ubuntu hardy main",
  215:                                       },
  216:                            ubuntu10 => {
  217:                                         regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+lucid\s+main',
  218:                                         text   => "deb $loninst/ubuntu lucid main",
  219:                                        },
  220:                            ubuntu12 => {
  221:                                         regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+precise\s+main',
  222:                                         text   => "deb $loninst/ubuntu precise main",
  223:                                        },
  224:                            ubuntu14 => {
  225:                                         regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+trusty\s+main',
  226:                                         text   => "deb $loninst/ubuntu trusty main",
  227:                                        },
  228:                            ubuntu16 => {
  229:                                         regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+xenial\s+main',
  230:                                         text   => "deb $loninst/ubuntu xenial main",
  231:                                        },
  232:                            ubuntu18 => {
  233:                                         regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+bionic\s+main',
  234:                                         text   => "deb $loninst/ubuntu bionic main",
  235:                                        },
  236:                            ubuntu20 => {
  237:                                         regexp => '\s*deb\s+'.$loninst_re.'/ubuntu/?\s+focal\s+main',
  238:                                         text   => "deb $loninst/ubuntu focal main",
  239:                                        },
  240:                          );
  241:     my $apt_status;
  242:     if (defined($apt_get_source{$dist})) {
  243:         $apt_status = &update_apt_source($apt_get_source{$dist},);
  244:     }
  245: }
  246: 
  247: my $mysqlfile = '/etc/my.cnf';
  248: if ($dist =~ /^ubuntu(\d+)$/) {
  249:     my $version = $1;
  250:     $mysqlfile = '/etc/mysql/my.cnf';
  251:     if ($version > 14) {
  252:         $mysqlfile = '/etc/mysql/mysql.conf.d/mysqld.cnf';
  253:     }
  254: }
  255: 
  256: my $mysql_global_status =
  257:     &update_file($mysqlfile,
  258:              [{section =>'mysqld',
  259:                key     =>'wait_timeout=',
  260:                value   =>'31536000', }]);
  261: 
  262: my $local_my_cnf = '/home/www/.my.cnf';
  263: if (! -e $local_my_cnf) {
  264:     # Create a file so we can do something with it...
  265:     system("touch $local_my_cnf");
  266: }
  267: my $mysql_www_status =
  268:     &update_file($local_my_cnf,
  269:              [{section =>'client',
  270:                key     =>'user=',
  271:                value   =>'www',},
  272:               {section =>'client',
  273:                key     =>'password=',
  274:                value   =>$loncapa_config->{'lonSqlAccess'}},]);
  275: 
  276: my $exitvalue = 0;
  277: 
  278: if ($mysql_global_status) { $exitvalue = 1; }
  279: 
  280: exit $exitvalue;
  281: 
  282: 
  283: sub update_file {
  284:     my ($file,$newdata,$nobackup) = @_;
  285:     return 1 if (! -e $file);
  286:     unless ($nobackup) {
  287:         my $backup = $file.'.backup';
  288:         if (! copy($file,$backup)) {
  289:             warn "**** Error: Unable to make backup of $file";
  290:             return 0;
  291:         }
  292:     }
  293:     my ($filedata) = &parse_config_file($file);
  294:     if (! ref($filedata)) { warn "**** Error: $filedata"; return 0;}
  295:     my $modified = 0;
  296:     foreach my $data (@$newdata) {
  297:         my $section = $data->{'section'};
  298:         my $key = $data->{'key'};
  299:         my $value = $data->{'value'};
  300:         my $result = &modify_config_file($filedata,$section,$key,$value);
  301:         if ($result) { $modified = 1; }
  302:     }
  303:     if ($modified) {
  304:         my $result = &write_config_file($file,$filedata);
  305:         if (defined($result)) { warn 'Error:'.$result; return 0; }
  306:     }
  307:     return $modified;
  308: }
  309: 
  310: #################################################################
  311: #################################################################
  312: 
  313: =pod
  314: 
  315: =over 4
  316: 
  317: =item &parse_config_file()
  318: 
  319: Read a configuration file in and parse it into an internal data structure.
  320: 
  321: Input: filename
  322: 
  323: Output: array ref $filedata  OR  scalar error message
  324: 
  325: =back 
  326: 
  327: =cut
  328: 
  329: #################################################################
  330: #################################################################
  331: sub parse_config_file {
  332:     my ($file) = @_;
  333:     open(INFILE,$file) || return ('Unable to open '.$file.' for reading');
  334:     my @Input = <INFILE>;
  335:     close(INFILE);
  336:     my @Structure;
  337:     my %Sections;
  338:     while (my $line = shift(@Input)) {
  339:         chomp($line);
  340:         if ($line =~ /^\[([^\]]*)\]/) {
  341:             my $section_id = $1;
  342:             push(@Structure,'__section__'.$section_id);
  343:             while ($line = shift(@Input)) {
  344:                 chomp($line);
  345:                 if ($line =~ /^\[([^\]]*)\]/) {
  346:                     unshift(@Input,$line);
  347:                     last;
  348:                 } else {
  349:                     push(@{$Sections{$section_id}},$line);
  350:                 }
  351:             }
  352:         } else {
  353:             push(@Structure,$line);
  354:         }
  355:     }
  356:     my $filedata = [\@Structure,\%Sections];
  357:     return $filedata;
  358: }
  359: 
  360: #################################################################
  361: #################################################################
  362: 
  363: =pod
  364: 
  365: =over 4
  366: 
  367: =item
  368: 
  369: Write a configuration file out based on the internal data structure returned
  370: by &parse_config_file
  371: 
  372: Inputs: filename, $filedata (the return value of &parse_config_file
  373: 
  374: Returns: undef on success, scalar error message on failure.
  375: 
  376: =back
  377: 
  378: =cut
  379: 
  380: #################################################################
  381: #################################################################
  382: sub write_config_file {
  383:     my ($file,$filedata) = @_;
  384:     my ($structure,$sections) = @$filedata;
  385:     if (! defined($structure) || ! ref($structure)) {
  386:         return 'Bad subroutine inputs';
  387:     }
  388:     open(OUTPUT,'>',$file) || return('Unable to open '.$file.' for writing');
  389:     for (my $i=0;$i<scalar(@$structure);$i++) {
  390:         my $line = $structure->[$i];
  391:         chomp($line);
  392:         if ($line =~ /^__section__(.*)$/) {
  393:             my $section_id = $1;
  394:             print OUTPUT ('['.$section_id.']'.$/);
  395:             foreach my $section_line (@{$sections->{$section_id}}) {
  396:                 chomp($section_line);
  397:                 print OUTPUT $section_line.$/;
  398:             }
  399:             # Deal with blank lines
  400:             if ($sections->{$section_id}->[-1] =~ /^\s*$/) {
  401:                 # No need to output a blank line at the end if there is one 
  402:                 # already
  403:             } else {
  404:                 print OUTPUT $/;
  405:             }
  406:         } else {
  407:             print OUTPUT $line.$/;
  408:         }
  409:     }
  410:     close OUTPUT;
  411:     return undef;
  412: }
  413: 
  414: #################################################################
  415: #################################################################
  416: 
  417: =pod
  418: 
  419: =over 4
  420: 
  421: =item &modify_config_file()
  422: 
  423: Modifies the internal data structure of a configuration file to include new
  424: sections and/or new configuration directives.
  425: 
  426: Inputs: $filedata (see &parse_config_file
  427: $section, the [section] the new entry is to reside in.  A value of undef will
  428: cause the "outer" section (as in yum.conf) to be updated (or have the new
  429: value prepended).
  430: $newkey: A line which matches this will be replaced with $newkey.$newvalue
  431: $newvalue: The new value to be placed with the new key.
  432: 
  433: Returns: 0 or 1, indicating if the file was modified(1) or not(0).
  434: 
  435: =back 
  436: 
  437: =cut
  438: 
  439: #################################################################
  440: #################################################################
  441: sub modify_config_file {
  442:     my ($filedata,$section,$newkey,$newvalue)=@_;
  443:     my $modified = 0;    # returned value - set to true if the file is modified
  444:     my ($structure,$sections) = @$filedata;
  445:     if (! defined($newvalue)) {
  446:         $newvalue = '';
  447:     }
  448:     my $newline = $newkey.$newvalue;
  449:     #
  450:     # Determine which array ref gets the item
  451:     my $target;
  452:     if (defined($section)) {
  453:         if (! exists($sections->{$section})) {
  454:             push(@$structure,'__section__'.$section);
  455:             $sections->{$section}=[];
  456:         }
  457:         $target = $sections->{$section};
  458:     } else {
  459:         $target = $structure;
  460:     }
  461:     #
  462:     # Put the item in or update it.
  463:     my $key_is_new = 1;
  464:     for (my $i=0;$i<scalar(@$target);$i++) {
  465:         if ($target->[$i] =~/^$newkey/) {
  466:             if ($target->[$i] ne $newline) {
  467:                 $target->[$i]=$newline;
  468:                 $modified = 1;
  469:             }
  470:             $key_is_new = 0;
  471:             last;
  472:         }
  473:     }
  474:     if ($key_is_new) {
  475:         if (! defined($section)) {
  476:             unshift(@$target,$newline);
  477:         } else {
  478:             # No need to put things after a blank line.
  479:             if (defined($target->[-1]) && $target->[-1] =~ /^\s*$/) {
  480:                 $target->[-1] = $newline;
  481:                 $modified = 1;
  482:             } else {
  483:                 push(@$target,$newline);
  484:                 $modified = 1;
  485:             }
  486:         }
  487:     }
  488:     return $modified;
  489: }
  490: 
  491: #################################################################
  492: #################################################################
  493: 
  494: =pod
  495: 
  496: =over 4
  497: 
  498: =item &update_rhn_source()
  499: 
  500: Modifies the Red Hat 4 sources file which includes repositories used by up2date 
  501: 
  502: Inputs: 
  503: $rhn_items - a reference to hash of a hash containing the regular expression
  504: to test for, and the text string to append to the file, if an entry for the 
  505: LON-CAPA RHEL repository is missing for two cases:
  506: 
  507: (a) basearch
  508: (b) noarch 
  509: 
  510: Returns: 0 or 1, indicating if the file was modified(1) or not(0).
  511: 
  512: =back
  513: 
  514: =cut
  515: 
  516: #################################################################
  517: #################################################################
  518: sub update_rhn_source {
  519:     my ($rhn_items) = @_;
  520:     return 0 if (ref($rhn_items) ne 'HASH');
  521:     return 0 if ((ref($rhn_items->{basearch}) ne 'HASH') || (ref($rhn_items->{noarch}) ne 'HASH'));
  522:     my $file = '/etc/sysconfig/rhn/sources';
  523:     return 0 if (! -e $file);
  524:     my $backup = $file.'.backup';
  525:     if (! copy($file,$backup)) {
  526:         warn "**** Error: Unable to make backup of $file";
  527:         return 0;
  528:     }
  529:     my $result = 0;
  530:     my $fh;
  531:     if (open($fh,'<',$file)) {
  532:         my $total = 0;
  533:         my %found;
  534:         foreach my $item (keys(%{$rhn_items})) {
  535:             $found{$item} = 0;
  536:         }
  537:         while(<$fh>) {
  538:             foreach my $item (keys(%{$rhn_items})) {
  539:                 if (ref($rhn_items->{$item}) eq 'HASH') {
  540:                     my $pattern = $rhn_items->{$item}->{regexp};
  541:                     if ($pattern ne '') { 
  542:                         if (m{^$pattern}) {
  543:                             $found{$item} = 1;
  544:                             $total ++;
  545:                         }
  546:                     }
  547:                 }
  548:             }
  549:             last if $total == 2;
  550:         }
  551:         close($fh);
  552:         if ($total < 2) {
  553:             if (open($fh,'>>',$file)) {
  554:                 foreach my $item (keys(%{$rhn_items})) {
  555:                     unless ($found{$item}) {
  556:                         if (ref($rhn_items->{$item}) eq 'HASH') {
  557:                             if ($rhn_items->{$item}->{text} ne '') {
  558:                                 print $fh "\n".$rhn_items->{$item}->{text}."\n";
  559:                                 $result = 1;
  560:                             }
  561:                         }
  562:                     }
  563:                 }
  564:                 close($fh);
  565:             }
  566:         }
  567:     }
  568:     return $result;
  569: }
  570: 
  571: #################################################################
  572: #################################################################
  573: 
  574: =pod
  575: 
  576: =over 4
  577: 
  578: =item &update_apt_source()
  579: 
  580: Modifies the source.list file which includes repositories used by apt-get
  581: 
  582: Inputs:
  583: $deb_row - a reference to containing the regular expression
  584: to test for, and the text string to append to the file, if an entry for the
  585: LON-CAPA Debian/ or Ubuntu repository is missing.
  586: 
  587: Returns: 0 or 1, indicating if the file was modified(1) or not(0).
  588: 
  589: =back
  590: 
  591: =cut
  592: 
  593: #################################################################
  594: #################################################################
  595: sub update_apt_source {
  596:     my ($deb_row) = @_;
  597:     return 0 if (ref($deb_row) ne 'HASH');
  598:     return 0 if (($deb_row->{regexp} eq '') || ($deb_row->{text} eq ''));
  599:     my $file = '/etc/apt/sources.list';
  600:     return 0 if (! -e $file);
  601:     my $backup = $file.'.backup';
  602:     if (! copy($file,$backup)) {
  603:         warn "**** Error: Unable to make backup of $file";
  604:         return 0;
  605:     }
  606:     my $result = 0;
  607:     my $fh;
  608:     if (open($fh,'<',$file)) {
  609:         my $found = 0;
  610:         my $pattern = $deb_row->{regexp};
  611:         while(<$fh>) {
  612:             if (m{^$pattern}) {
  613:                 $found = 1;
  614:                 last;
  615:             }
  616:         }
  617:         close($fh);
  618:         if (!$found) {
  619:             if (open($fh,'>>',$file)) {
  620:                 print $fh "\n".$deb_row->{text}."\n";
  621:                 close($fh);
  622:                 $result = 1;
  623:             }
  624:         }
  625:     }
  626:     return $result;
  627: }
  628: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>