Diff for /loncom/lcinstallfile between versions 1.3 and 1.5

version 1.3, 2009/03/03 12:08:07 version 1.5, 2010/10/12 10:14:25
Line 1 Line 1
 #!/usr/bin/perl  #!/usr/bin/perl
 #  #
 ## Copyright Michigan State University Board of Trustees  # Copyright Michigan State University Board of Trustees
   #
   # $Id$
 #  #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).  # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
 #  #
Line 22 Line 24
 #  #
 #  #
 #  #
 # 2/17/2009 - Ron FOx  # 2/17/2009 - Ron Fox
 #   
 #  #
 # http://www.lon-capa.org/  # http://www.lon-capa.org/
 #  #
Line 41 Line 42
   
 use strict;  use strict;
   
 my $LONCAPAHOME = '/home/httpd';     # Adjust if loncapa isn't installed here.  use lib "/home/httpd/lib/perl";     # Adjust if loncapa lib isn't installed here.
   
 use lib "/home/httpd/lib/perl";  
 use LONCAPA;  use LONCAPA;
 use LONCAPA::Configuration;  use LONCAPA::Configuration;
 use IO::File;  use IO::File;
Line 70  my $noprint = 1; Line 69  my $noprint = 1;
 print ("In lcinstallfile\n") unless $noprint;  print ("In lcinstallfile\n") unless $noprint;
   
 my $wwwid=getpwnam('www');  my $wwwid=getpwnam('www');
 &disable_root_capability;  #&disable_root_capability;
 if ($wwwid!=$>) {  if ($wwwid!=$<) {
     print("User ID mismatch.  This program must be run as user 'www'\n")      print("User ID mismatch.  This program must be run as user 'www'\n")
  unless $noprint;   unless $noprint;
     exit 1;      exit 1;
Line 181  sub enable_root_capability { Line 180  sub enable_root_capability {
     if ($wwwid==$>) {      if ($wwwid==$>) {
  ($<,$>)=($>,0);   ($<,$>)=($>,0);
  ($(,$))=($),0);   ($(,$))=($),0);
     }      } else {
     else {  
  # root capability is already enabled   # root capability is already enabled
     }      }
     print ("Effective uid = $>\n");      print ("Effective uid = $>\n");
Line 194  sub disable_root_capability { Line 192  sub disable_root_capability {
     if ($wwwid==$<) {      if ($wwwid==$<) {
  ($<,$>)=($>,$<);   ($<,$>)=($>,$<);
  ($(,$))=($),$();   ($(,$))=($),$();
     }      } else {
     else {  
  # root capability is already disabled   # root capability is already disabled
     }      }
 }  }

Removed from v.1.3  
changed lines
  Added in v.1.5


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