File portsentry-compile.patch of Package portsentry
--- portsentry-1.1/portsentry_io.c.orig 2001-07-11 18:57:49.000000000 +0200
+++ portsentry-1.1/portsentry_io.c 2019-06-26 18:11:15.120991058 +0200
@@ -90,7 +90,9 @@ DaemonSeed (void)
exit (0);
setsid ();
- chdir ("/");
+ if (chdir ("/") < 0) {
+ return (ERROR);
+ }
umask (077);
/* close stdout, stdin, stderr */
@@ -327,10 +329,10 @@ ConfigTokenRetrieve (char *token, char *
#endif
/* search for the token and make sure the trailing character */
/* is a " " or "=" to make sure the entire token was found */
- if ((strstr (buffer, token) != (char) NULL) &&
+ if ((strstr (buffer, token) != NULL) &&
((buffer[strlen(token)] == '=') || (buffer[strlen(token)] == ' ')))
{ /* cut off the '=' and send it back */
- if (strstr (buffer, "\"") == (char) NULL)
+ if (strstr (buffer, "\"") == NULL)
{
Log ("adminalert: Quotes missing from %s token. Option skipped\n", token);
fclose (config);
@@ -676,7 +678,7 @@ IsBlocked (char *target, char *filename)
while (fgets (buffer, MAXBUF, input) != NULL)
{
- if((ipOffset = strstr(buffer, target)) != (char) NULL)
+ if((ipOffset = strstr(buffer, target)) != NULL)
{
for(count = 0; count < strlen(ipOffset); count++)
{
@@ -733,7 +735,7 @@ char tempString[MAXBUF], *tempStringPtr;
#endif
/* string not found in target */
- if (strstr (target, find) == (char) NULL)
+ if (strstr (target, find) == NULL)
{
strncpy(result, target, MAXBUF);
#ifdef DEBUG
--- portsentry-1.1/portsentry.c.orig 2001-07-11 18:57:49.000000000 +0200
+++ portsentry-1.1/portsentry.c 2019-06-26 18:22:39.791193793 +0200
@@ -1086,7 +1086,8 @@ PortSentryModeTCP (void)
{
struct sockaddr_in client, server;
- int length, portCount = 0, ports[MAXSOCKS];
+ socklen_t length;
+ int portCount = 0, ports[MAXSOCKS];
int openSockfd[MAXSOCKS], incomingSockfd, result = TRUE;
int count = 0, scanDetectTrigger = TRUE, showBanner = FALSE, boundPortCount = 0;
int selectResult = 0;
@@ -1286,7 +1287,8 @@ int
PortSentryModeUDP (void)
{
struct sockaddr_in client, server;
- int length, ports[MAXSOCKS], openSockfd[MAXSOCKS], result = TRUE;
+ socklen_t length;
+ int ports[MAXSOCKS], openSockfd[MAXSOCKS], result = TRUE;
int count = 0, portCount = 0, selectResult = 0, scanDetectTrigger = 0;
int boundPortCount = 0, showBanner = FALSE;
char *temp, target[IPMAXBUF], bannerBuffer[MAXBUF], configToken[MAXBUF];