[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Tue May 1 10:28:42 EDT 2018


raeburn		Tue May  1 14:28:42 2018 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Sanity checking
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1375 loncom/lonnet/perl/lonnet.pm:1.1376
--- loncom/lonnet/perl/lonnet.pm:1.1375	Sat Apr 14 02:30:01 2018
+++ loncom/lonnet/perl/lonnet.pm	Tue May  1 14:28:41 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1375 2018/04/14 02:30:01 raeburn Exp $
+# $Id: lonnet.pm,v 1.1376 2018/05/01 14:28:41 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -762,16 +762,19 @@
                 $env{$key}=$newenv->{$key};
             }
         }
-        my $opened = open(my $env_file,'+<',$env{'user.environment'});
-        if ($opened
-	    && &timed_flock($env_file,LOCK_EX)
-	    &&
-	    tie(my %disk_env,'GDBM_File',$env{'user.environment'},
-	        (&GDBM_WRITER()|&GDBM_NOLOCK()),0640)) {
-	    while (my ($key,$value) = each(%{$newenv})) {
-	        $disk_env{$key} = $value;
-	    }
-	    untie(%disk_env);
+        my $lonids = $perlvar{'lonIDsDir'};
+        if ($env{'user.environment'} =~ m{^\Q$lonids/\E$match_username\_\d+\_$match_domain\_[\w\-.]+\.id$}) {
+            my $opened = open(my $env_file,'+<',$env{'user.environment'});
+            if ($opened
+	        && &timed_flock($env_file,LOCK_EX)
+	        &&
+	        tie(my %disk_env,'GDBM_File',$env{'user.environment'},
+	            (&GDBM_WRITER()|&GDBM_NOLOCK()),0640)) {
+	        while (my ($key,$value) = each(%{$newenv})) {
+	            $disk_env{$key} = $value;
+	        }
+	        untie(%disk_env);
+            }
         }
     }
     return 'ok';




More information about the LON-CAPA-cvs mailing list