]> bicyclesonthemoon.info Git - yplom/facebug1/commitdiff
script removing access files fixed.
authorb <b@7dec801f-c475-4e67-ba99-809552d69c55>
Tue, 5 Jan 2016 20:07:43 +0000 (20:07 +0000)
committerb <b@7dec801f-c475-4e67-ba99-809552d69c55>
Tue, 5 Jan 2016 20:07:43 +0000 (20:07 +0000)
git-svn-id: svn://botcastle1b/yplom/facebug1@15 7dec801f-c475-4e67-ba99-809552d69c55

rmaccess.1.pl

index f6fde5f36e120590a2203bfdb76205672cdc9e22..adbb320ad70fc7fa69afc6129e033b1cc9600825 100644 (file)
@@ -36,12 +36,15 @@ my $timeout_inact = TIMEOUT_INACT*60;
        
 if (opendir ($dir, ACCESS_PATH)) {
        while (defined($path = readdir $dir)) {
+               if ($path !~ /^[0-9a-fA-F]+$/) {
+                       next;
+               }
                if (open ($file, '<', ACCESS_PATH.$path)) {
-                       $unlocktime=<$accessfile>;
-                       $lasttime=<$accessfile>;
+                       $unlocktime=<$file>;
+                       $lasttime=<$file>;
                        close($file);
                        
-                       if (($unlocktime !~ /^([0-9]+)$/) || ($lasttime !~ /^([0-9]+)$/)) {
+                       if (($unlocktime !~ /^([0-9]+)$/) or ($lasttime !~ /^([0-9]+)$/)) {
                                unlink (ACCESS_PATH.$path);
                        }
                        elsif ((abs($time-$unlocktime)>$timeout_unlock) or (abs($time-$lasttime)>$timeout_inact)){