7548036417
for Squid. It can be used to limit the web access for some users, block access to URLs, redirect trafic, etc. from Claudio Correa <correa@pucpcaldas.br>, thanks.
55 lines
1.5 KiB
Plaintext
55 lines
1.5 KiB
Plaintext
$OpenBSD: patch-src_sg_y,v 1.1.1.1 2007/06/02 15:26:54 aanriot Exp $
|
|
--- src/sg.y.orig Wed Apr 11 02:57:02 2007
|
|
+++ src/sg.y Fri Jun 1 20:07:12 2007
|
|
@@ -21,9 +21,12 @@
|
|
#include "sg.h"
|
|
|
|
#ifdef HAVE_LIBLDAP
|
|
-#include "lber.h"
|
|
-#include "ldap.h"
|
|
+#ifndef LDAP_DEPRECATED
|
|
+#define LDAP_DEPRECATED 1
|
|
#endif
|
|
+#include <lber.h>
|
|
+#include <ldap.h>
|
|
+#endif
|
|
|
|
#include "sgEx.h"
|
|
|
|
@@ -954,7 +957,7 @@ struct Source *sgFindSource (bsrc, net, ident, domain)
|
|
founduser = 1;
|
|
unblockeduser = 1;
|
|
if(s->userquota.seconds != 0){
|
|
- struct UserInfo uq;
|
|
+ // struct UserInfo uq;
|
|
time_t t = time(NULL) + globalDebugTimeDelta;
|
|
//sgLogError("status %d time %d lasttime %d consumed %d", userquota->status, userquota->time, userquota->last, userquota->consumed);
|
|
//sgLogError("renew %d seconds %d", s->userquota.renew, s->userquota.seconds);
|
|
@@ -1940,11 +1943,14 @@ void sgTimeSetAcl()
|
|
for(rew = Rewrite; rew != NULL; rew = rew->next){
|
|
if(rew->time != NULL){
|
|
rew->active = rew->time->active;
|
|
- if(rew->within == OUTSIDE)
|
|
- if(rew->active)
|
|
+ if(rew->within == OUTSIDE) {
|
|
+ if(rew->active) {
|
|
rew->active = 0;
|
|
- else
|
|
+ }
|
|
+ else {
|
|
rew->active = 1;
|
|
+ }
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
@@ -2347,7 +2353,7 @@ char *sgAclAccess(src, acl, req)
|
|
}
|
|
}
|
|
if(aclpass->dest->regExp != NULL && access){
|
|
- if((result = sgRegExpMatch(aclpass->dest->regExp,req->url)) != 0){
|
|
+ if((result = sgRegExpMatch(aclpass->dest->regExp,req->strippedurl)) != 0){
|
|
if(aclpass->access){
|
|
access++;
|
|
break;
|