Skip to content

Commit

Permalink
Adjusted Makefile for better linking. For squidguard remove bzero bef…
Browse files Browse the repository at this point in the history
…ore using fgets. Use cleaner printf format.
  • Loading branch information
Jeroen committed Dec 6, 2011
1 parent 4db442c commit b1ad647
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
OWNER=root
GROUP=root
CC=gcc
CFLAGS=-O2 -Wall -ldb
CFLAGS=-O2 -Wall
LIBS=-ldb
SBINDIR=/usr/sbin

all: openufp

openufp:
$(CC) $(CFLAGS) openufp.c cache.c n2h2.c websense.c blacklist.c proxy.c squidguard.c -o $@
$(CC) $(CFLAGS) openufp.c cache.c n2h2.c websense.c blacklist.c proxy.c squidguard.c -o $@ $(LIBS)

install: openufp
install -c -o $(OWNER) -g $(GROUP) -m 755 openufp $(SBINDIR)
Expand Down
2 changes: 1 addition & 1 deletion proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int proxy_backend(char *proxy_ip, int proxy_port, char *proxy_deny_pattern, char

// create proxy request
bzero(proxy_req, sizeof(proxy_req));
sprintf(proxy_req,"%s%s%s", "GET ", url, " HTTP/1.0\r\n\r\n");
sprintf(proxy_req,"GET %s HTTP/1.0\r\n\r\n", url);
proxy_req_len = strlen(proxy_req);

// Send the request to the proxy server, return accept if failes
Expand Down
4 changes: 2 additions & 2 deletions squidguard.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ int squidguard_closefd(FILE *sg_fd[2]) {

int squidguard_backend(FILE *sg_fd[2], char srcip[15], char url[URL_SIZE], int debug) {
char redirect_url[URL_SIZE];
bzero(redirect_url, sizeof(redirect_url));
//bzero(redirect_url, sizeof(redirect_url));

fprintf(sg_fd[1], "%s%s%s%s", url, " ", srcip, "/ - - GET\n");
fprintf(sg_fd[1], "%s %s/ - - GET\n", url, srcip);
fflush(sg_fd[1]);
while (fgets(redirect_url, sizeof(redirect_url)-1, sg_fd[0]) != NULL) {
if (debug > 1)
Expand Down

0 comments on commit b1ad647

Please sign in to comment.