Re: [squid-users] running squid on VERY low-end devices

From: Leonardo Rodrigues Magalhães <leolistas_at_solutti.com.br>
Date: Tue, 23 Sep 2008 18:51:36 -0300

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
	gertrudes_at_solutti.com.br
	My SPAMTRAP, do not email it
Received on Tue Sep 23 2008 - 21:51:42 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 24 2008 - 12:00:03 MDT