From 9e676ded43c5e6bf0f935b630940ba863efb5af0 Mon Sep 17 00:00:00 2001 From: Peter da Silva Date: Mon, 26 Dec 2016 12:53:43 -0600 Subject: [PATCH] 2.5.5 Clean up to eliminate compile warnings, possible format injection. --- LICENSE | 2 +- Makefile | 2 +- README | 6 ++++++ plug.c | 11 ++++++----- plug.h | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/LICENSE b/LICENSE index bb5e6f0..e0b554d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -PLUGDAEMON. Copyright (c) 2004 Peter da Silva. All rights reserved. +PLUGDAEMON. Copyright (c) 2012 Peter da Silva. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/Makefile b/Makefile index c049c88..4088465 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # SOURCES= README Makefile LICENSE plug.1 plug.c plug.h config.h includes.h -VER=2.5.4 +VER=2.5.5 T=plugdaemon-$(VER) # dietlibc with al diff --git a/README b/README index 0ebf5ce..1fb3584 100644 --- a/README +++ b/README @@ -86,3 +86,9 @@ Changes: (see Makefile) Fix load-balancing (Ben Low). + 2.5.4 Fixes a problem where a remote host closed a + connection too quickly, and getpeername failed. + + 2.5.5 Clean up to eliminate compile warnings, possible format + injection. + diff --git a/plug.c b/plug.c index 9a6b620..c0f3bce 100644 --- a/plug.c +++ b/plug.c @@ -1,5 +1,5 @@ /* - * PLUGDAEMON. Copyright (c) 2004 Peter da Silva. All rights reserved. + * PLUGDAEMON. Copyright (c) 2012 Peter da Silva. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -58,7 +58,7 @@ int nproxies = 0; int nclients = 0; int nprocs = 0; -char *version = "plugdaemon V2.5.3 Copyright (c) 2004 Peter da Silva"; +char *version = "plugdaemon V2.5.5 Copyright (c) 2012 Peter da Silva"; char *usage_string = "[-V] [-P pidfile] [-S sessionfile] [-snklfod[d]...]\n" "\t[-p proxy-addr] [-i srcaddr] [-a accept_rule]...\n" @@ -194,7 +194,8 @@ main(int ac, char **av) if(debug>2) fprintf(stderr, "start main loop\n"); /* wait for connections and service them */ while(1) { - int clifd, prxfd, cli_len, status; + int clifd, prxfd, status; + socklen_t cli_len; struct sockaddr_in cli_sockaddr; if(debug>1) @@ -402,7 +403,7 @@ bailout(char *message, int status) if(!daemonized) fprintf(stderr, "%s\n", msgbuf); else { - syslog(LOG_ERR, msgbuf); + syslog(LOG_ERR, "%s", msgbuf); closelog(); } @@ -824,7 +825,7 @@ void delete_client (client_t *client, client_t *back_ptr) struct dtab *select_target(int clifd, loginfo_t *lp) { struct sockaddr_in p_addr; - int len; + socklen_t len; client_t *client = 0; dest_t *target = NULL; static dest_t *dest_next = 0; diff --git a/plug.h b/plug.h index b1d9b56..f29fa4a 100644 --- a/plug.h +++ b/plug.h @@ -1,5 +1,5 @@ /* - * PLUGDAEMON. Copyright (c) 2004 Peter da Silva. All rights reserved. + * PLUGDAEMON. Copyright (c) 2012 Peter da Silva. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions