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

foxr lon-capa-cvs@mail.lon-capa.org
Mon, 18 Oct 2004 10:56:50 -0000


foxr		Mon Oct 18 06:56:50 2004 EDT

  Modified files:              
    /loncom	lchtmldir 
  Log:
  DEFECT 550: Reset ownership of top level user directory if internal.
       This is required for Fs -> internal auth changes of authors.
  
  
  
Index: loncom/lchtmldir
diff -u loncom/lchtmldir:1.8 loncom/lchtmldir:1.9
--- loncom/lchtmldir:1.8	Thu Sep  2 14:59:24 2004
+++ loncom/lchtmldir	Mon Oct 18 06:56:50 2004
@@ -167,7 +167,9 @@
 
 # As root, create the directory.
 
-my $fulldir = $dirtry1."/public_html";
+my $homedir = $dirtry1;
+my $fulldir = $homedir."/public_html";
+
 if($DEBUG) {
     print("Full directory path is: $fulldir \n");
 }
@@ -207,6 +209,7 @@
 END
     close OUT;
     }
+
 &System("/bin/chmod  02775  $fulldir");
 &System("/bin/chmod  0775  $fulldir"."/index.html");
 
@@ -220,6 +223,13 @@
     # Internal, Kerberos, and Local authentication are for users
     # who do not have unix accounts on the system.  Therefore we
     # will give ownership of their public_html directories to www:www
+    # If the user is an internal auth user, the rest of the directory tree
+    # gets owned by root.  This chown is needed in case what's really happening
+    # is that a file system user is being demoted to internal user...
+
+    if($authentication eq "internal:") {
+	&System("/bin/chown -R root:root ".$homedir);
+    }
     &System("/bin/chown -R www:www  ".$fulldir);
 }
 &DisableRoot;