Lines 175-181
Link Here
|
175 |
sgReloadConfig(); |
175 |
sgReloadConfig(); |
176 |
} |
176 |
} |
177 |
if(failsafe_mode) { |
177 |
if(failsafe_mode) { |
178 |
puts(""); |
178 |
puts("ERR message=\"squidGuard failsafe mode\""); |
179 |
fflush(stdout); |
179 |
fflush(stdout); |
180 |
if(sig_hup){ |
180 |
if(sig_hup){ |
181 |
sgReloadConfig(); |
181 |
sgReloadConfig(); |
Lines 184-190
Link Here
|
184 |
} |
184 |
} |
185 |
if(parseLine(buf,&squidInfo) != 1){ |
185 |
if(parseLine(buf,&squidInfo) != 1){ |
186 |
sgLogError("Error parsing squid line: %s",buf); |
186 |
sgLogError("Error parsing squid line: %s",buf); |
187 |
puts(""); |
187 |
puts("BH message=\"squidGuard error parsing squid line\""); |
188 |
} |
188 |
} |
189 |
else { |
189 |
else { |
190 |
src = Source; |
190 |
src = Source; |
Lines 196-209
Link Here
|
196 |
acl = sgAclCheckSource(src); |
196 |
acl = sgAclCheckSource(src); |
197 |
if((redirect = sgAclAccess(src,acl,&squidInfo)) == NULL){ |
197 |
if((redirect = sgAclAccess(src,acl,&squidInfo)) == NULL){ |
198 |
if(src == NULL || src->cont_search == 0){ |
198 |
if(src == NULL || src->cont_search == 0){ |
199 |
puts(""); |
199 |
puts("ERR"); |
200 |
break; |
200 |
break; |
201 |
} else |
201 |
} else |
202 |
if(src->next != NULL){ |
202 |
if(src->next != NULL){ |
203 |
src = src->next; |
203 |
src = src->next; |
204 |
continue; |
204 |
continue; |
205 |
} else { |
205 |
} else { |
206 |
puts(""); |
206 |
puts("ERR"); |
207 |
break; |
207 |
break; |
208 |
} |
208 |
} |
209 |
} else { |
209 |
} else { |
Lines 215-223
Link Here
|
215 |
squidInfo.ident[0] = '-'; |
215 |
squidInfo.ident[0] = '-'; |
216 |
squidInfo.ident[1] = '\0'; |
216 |
squidInfo.ident[1] = '\0'; |
217 |
} |
217 |
} |
218 |
fprintf(stdout,"%s %s/%s %s %s\n",redirect,squidInfo.src, |
218 |
if (isdigit(redirect[0]) && isdigit(redirect[1]) && isdigit(redirect[2]) && redirect[3]==':') { |
219 |
squidInfo.srcDomain,squidInfo.ident, |
219 |
fprintf(stdout,"OK status=%c%c%c url=\"%s\"\n", redirect[0], redirect[1], redirect[2], &redirect[4]); |
220 |
squidInfo.method); |
220 |
} else |
|
|
221 |
fprintf(stdout,"OK rewrite-url=\"%s\"\n",redirect); |
221 |
/* sgLogError("%s %s/%s %s %s\n",redirect,squidInfo.src,squidInfo.srcDomain,squidInfo.ident,squidInfo.method); */ |
222 |
/* sgLogError("%s %s/%s %s %s\n",redirect,squidInfo.src,squidInfo.srcDomain,squidInfo.ident,squidInfo.method); */ |
222 |
break; |
223 |
break; |
223 |
} |
224 |
} |