View | Details | Raw Unified | Return to bug 193771
Collapse All | Expand All

(-)squidGuard-1.4.upgraded/src/main.c (-7 / +8 lines)
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
	  }
(-)squidGuard-1.4.upgraded/src/sgDiv.c (-1 / +1 lines)
Lines 771-777 Link Here
771
  }
771
  }
772
  sgLogError("Going into emergency mode");
772
  sgLogError("Going into emergency mode");
773
  while(fgets(buf, MAX_BUF, stdin) != NULL){
773
  while(fgets(buf, MAX_BUF, stdin) != NULL){
774
    puts("");
774
    puts("ERR");
775
    fflush(stdout);
775
    fflush(stdout);
776
  }
776
  }
777
  sgLogError("ending emergency mode, stdin empty");
777
  sgLogError("ending emergency mode, stdin empty");
(-)squidGuard-1.4.upgraded/src/sgDiv.c.in (-1 / +1 lines)
Lines 782-788 Link Here
782
  }
782
  }
783
  sgLogError("Going into emergency mode");
783
  sgLogError("Going into emergency mode");
784
  while(fgets(buf, MAX_BUF, stdin) != NULL){
784
  while(fgets(buf, MAX_BUF, stdin) != NULL){
785
    puts("");
785
    puts("ERR");
786
    fflush(stdout);
786
    fflush(stdout);
787
  }
787
  }
788
  sgLogError("ending emergency mode, stdin empty");
788
  sgLogError("ending emergency mode, stdin empty");

Return to bug 193771