From: b Date: Tue, 5 Jan 2016 20:07:43 +0000 (+0000) Subject: script removing access files fixed. X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=9f587a0414ce73c6b85e5c3a6a4f7d0892ebccc0;p=yplom%2Ffacebug1 script removing access files fixed. git-svn-id: svn://botcastle1b/yplom/facebug1@15 7dec801f-c475-4e67-ba99-809552d69c55 --- diff --git a/rmaccess.1.pl b/rmaccess.1.pl index f6fde5f..adbb320 100644 --- a/rmaccess.1.pl +++ b/rmaccess.1.pl @@ -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)){