[LON-CAPA-cvs] cvs: loncom / lchtmldir lcuseradd

foxr lon-capa-cvs@mail.lon-capa.org
Tue, 25 Jan 2005 11:39:52 -0000


foxr		Tue Jan 25 06:39:52 2005 EDT

  Modified files:              
    /loncom	lchtmldir lcuseradd 
  Log:
  Fix defect 3853: Directory ownerships were not correct if the user
  was to become an author e.g.  Set the ownerships as follows:
  top level dir: username:www  public_html and below username:www
  everything else, the user should be able to control via their Unix
  login and should be, if deisired, hide-able from LonCAPA.
  
  
Index: loncom/lchtmldir
diff -u loncom/lchtmldir:1.12 loncom/lchtmldir:1.13
--- loncom/lchtmldir:1.12	Mon Dec  6 07:07:59 2004
+++ loncom/lchtmldir	Tue Jan 25 06:39:52 2005
@@ -214,14 +214,14 @@
     close OUT;
     }
 
-&System("/bin/chmod  02775  $fulldir");
-&System("/bin/chmod  0775  $fulldir"."/index.html");
+&System("/bin/chmod  02770  $fulldir");
+&System("/bin/chmod  0770  $fulldir"."/index.html");
 
 
 # Based on the authentiation mode, set the ownership of the directory.
 
 if($authentication eq "unix:") {	# Unix mode authentication...
-    &System("/bin/chown -R   $safeuser".":".$safeuser." ".$fulldir);
+    &System("/bin/chown -R   $safeuser:www"." ".$fulldir);
     &JoinGroup($safeuser);
 } else {
     # Internal, Kerberos, and Local authentication are for users
Index: loncom/lcuseradd
diff -u loncom/lcuseradd:1.31 loncom/lcuseradd:1.32
--- loncom/lcuseradd:1.31	Mon Oct 18 06:43:39 2004
+++ loncom/lcuseradd	Tue Jan 25 06:39:52 2005
@@ -6,7 +6,7 @@
 #             with adding a user with filesystem privileges (e.g. author)
 #
 #
-# $Id: lcuseradd,v 1.31 2004/10/18 10:43:39 foxr Exp $
+# $Id: lcuseradd,v 1.32 2005/01/25 11:39:52 foxr Exp $
 ###
 
 ###############################################################################
@@ -314,9 +314,15 @@
 </html>
 END
 close OUT;
-
+system('/bin/chown','0660', "/home/$safeusername/public_html/index.html");
+#
+#   In order to allow the loncapa daemons appropriate access
+#   to public_html, Top level and public_html directories should
+#   be owned by safeusername:www as should the smaple index.html..
 print "lcuseradd ownership\n" unless $noprint;
-system('/bin/chown','-R',"$safeusername:$safeusername","/home/$safeusername");
+system('/bin/chown','-R',"$safeusername:$safeusername","/home/$safeusername"); # First set std ownership on everything.
+system('/bin/chown',"$safeusername:www","/home/$safeusername");	# Now adust top level...
+system('/bin/chown','-R',"$safeusername:www","/home/$safeusername/public_html"); # And web dir.
 # ---------------------------------------------------- Gracefull Apache Restart
 if (-e '/var/run/httpd.pid') {
     print "lcuseradd Apache restart\n" unless $noprint;