John Doe escreveu:
other questions ..... when those routerboard boots, the date is December 31 1969. It will then get clock sincronized with ntp and go on.

is it possible to have an ACL based on the local date but include the year on the acl ??? i wanna squid to denied everything before clock get ntp adjusted. I dont wanna 1969 log entries on my logs to mess my reports ....

i know i can use time acl for matching weekdays and hours, but have never seen something year-related on the documents.

is that possible, to have an ACL matching local year of the machine running squid ?

Maybe an external_acl helper would do the trick...
It would check the date and allow/deny access


   i have written a small external helper in perl and it seems to do the trick.


--------------------------------
#!/usr/bin/microperl

while (<STDIN>) {

       ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, 
$dayOfYear, $daylightSavings) = localtime();
       $year =3D 1900 + $yearOffset;

       if ($year < 2008) {
               print "ERR\n";
       } else {
               print "OK\n";
       }
}
--------------------------------


   i know perl isnt the most optimized language .... but as the= external acl 
is started on squid startup and keeps running until squid exits, i dont think 
that will be a problem.

   anyway, i would love to see something similar in C that could be compiled 
and run with less memory than perl requires .... unfortunelly i cant code even 
a 'hello world' in C !!! But i'll try that ..... shouldnt be too difficult.


--


        Atenciosamente / Sincerily,
        Leonardo Rodrigues
        Solutti Tecnologia
        http://www.solutti.com.br

        Minha armadilha de SPAM, NÃO mandem email
        [EMAIL PROTECTED]
        My SPAMTRAP, do not email it




Reply via email to