[LON-CAPA-cvs] cvs: loncom /publisher loncfile.pm

foxr lon-capa-cvs@mail.lon-capa.org
Mon, 05 Aug 2002 02:09:05 -0000


foxr		Sun Aug  4 22:09:05 2002 EDT

  Modified files:              
    /loncom/publisher	loncfile.pm 
  Log:
  Ensure that files manipulated in construction space will have permissions:
  rw-rw---  and directories:  rwxrwxs---
  This fix is inspired by, but not actually all of bug 59... Also need to catch 
  this for uploads.
  
  
  
Index: loncom/publisher/loncfile.pm
diff -u loncom/publisher/loncfile.pm:1.13 loncom/publisher/loncfile.pm:1.14
--- loncom/publisher/loncfile.pm:1.13	Sun Jul 28 21:55:51 2002
+++ loncom/publisher/loncfile.pm	Sun Aug  4 22:09:05 2002
@@ -10,7 +10,7 @@
 #
 
 #
-# $Id: loncfile.pm,v 1.13 2002/07/29 01:55:51 foxr Exp $
+# $Id: loncfile.pm,v 1.14 2002/08/05 02:09:05 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -856,9 +856,13 @@
     &Debug($request ,"Will try to copy $oldfile to $newfile");
     if(-e $oldfile) {
 	unless (copy($oldfile, $newfile)) {
-	    $request->print('<font color=red> Error: '.$!.'</font>');
+	    $request->print('<font color=red> copy Error: '.$!.'</font>');
 	    return 0;
 	} else {
+	    unless (chmod(0660, $newfile)) {
+		$request->print('<font color=red> chmod error: '.$!.'</font>');
+		return 0;
+	    }
 	    return 1;
 	}
     } else {