From 350a4faf4c30082f4087e6b1bf716c63719dfe6d Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 19 Jun 2015 17:48:52 +0200 Subject: [PATCH] applying patch proposed by Thomas Dreibholz for building on recent fedoras --- root-context/dcookie.c | 2 +- root-context/fd_bind53.c | 1 + slice-context/src/vsys.c | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/root-context/dcookie.c b/root-context/dcookie.c index ca22353..d6600d0 100644 --- a/root-context/dcookie.c +++ b/root-context/dcookie.c @@ -30,7 +30,7 @@ int main(int argc,char *argv[]) { printf("%s\n",path_buf); } else { - printf("% Not found\n"); + printf("%% Not found\n"); } } } diff --git a/root-context/fd_bind53.c b/root-context/fd_bind53.c index e5582bb..17867ae 100644 --- a/root-context/fd_bind53.c +++ b/root-context/fd_bind53.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include "fdpass.h" diff --git a/slice-context/src/vsys.c b/slice-context/src/vsys.c index 186e47f..dbe8f14 100644 --- a/slice-context/src/vsys.c +++ b/slice-context/src/vsys.c @@ -190,7 +190,7 @@ static int _fifo_push (const char *fifo_in, const char *fifo_out, } // send inputs to the fifo_in - fprintf (in, input); + fprintf (in, "%s", input); // force flush and close the fifo_in so the program on the other side // can process input. @@ -199,7 +199,7 @@ static int _fifo_push (const char *fifo_in, const char *fifo_out, nbytes = fread(msg, SIZE, 1, out); // the error buffer will not be empty if we read an error - if (strcmp(msg, "") != 0){ + if ((nbytes > 0) && (strcmp(msg, "") != 0)) { // an errror was read from the fifo_out ... return -3; } @@ -281,7 +281,7 @@ int _fd_tuntap(int if_type, int no_pi, char *if_name) { vsys_sock = socket (AF_UNIX, SOCK_STREAM, 0); if (vsys_sock == -1){ - snprintf (if_name, SIZE, strerror(errno)); + snprintf (if_name, SIZE, "%s", strerror(errno)); return -2; } @@ -294,7 +294,7 @@ int _fd_tuntap(int if_type, int no_pi, char *if_name) { sizeof(struct sockaddr_un)); if (ret == -1){ - snprintf (if_name, SIZE, strerror(errno)); + snprintf (if_name, SIZE, "%s", strerror(errno)); return -3; } @@ -321,7 +321,7 @@ int _fd_tuntap(int if_type, int no_pi, char *if_name) { ret = ioctl (fd, TUNGETIFF, (void *)&ifr); if (ret == -1){ close (fd); - snprintf (if_name, SIZE, strerror(errno)); + snprintf (if_name, SIZE, "%s", strerror(errno)); return -6; } @@ -338,7 +338,7 @@ int _fd_tuntap(int if_type, int no_pi, char *if_name) { ret = ioctl (fd, TUNSETIFF, (void *)&ifr); if (ret == -1){ close (fd); - snprintf (if_name, SIZE, strerror(errno)); + snprintf (if_name, SIZE, "%s", strerror(errno)); return -7; } */ -- 2.43.0