Fedora Core patches

Gabriel L. Somlo somlo at cmu.edu
Thu Feb 23 11:03:20 EST 2006


Hi,

I've built argus-2.0.6 for FC4, and needed to apply some patches (the
pcap-bpf.h thing Russell mentioned in an earlier thread, and a few
other things).

I've attached the two patches (for argus-2.0.6 and
argus-clients-2.0.6). The FC4 spec file and SRPM are up at
http://www.contrib.andrew.cmu.edu/~somlo/

Any comments/ideas would be appreciated (e.g., if this stuff is
already fixed in some CVS repo, I'd appreciate a pointer to the
latest version :) )

Thanks,
Gabriel

-------------- next part --------------
diff -NarU5 argus-2.0.6.orig/common/gencode.c argus-2.0.6/common/gencode.c
--- argus-2.0.6.orig/common/gencode.c	2004-02-23 10:00:36.000000000 -0500
+++ argus-2.0.6/common/gencode.c	2006-02-01 13:50:23.000000000 -0500
@@ -57,11 +57,11 @@
 #include <setjmp.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <syslog.h>
 
-#include <net/bpf.h>
+#include <pcap-bpf.h>
 
 #include <argus_out.h>
 #include <argus_filter.h>
 #include <argus_def.h>
 #include <ethertype.h>
diff -NarU5 argus-2.0.6.orig/server/ArgusOutput.c argus-2.0.6/server/ArgusOutput.c
--- argus-2.0.6.orig/server/ArgusOutput.c	2004-02-23 10:00:36.000000000 -0500
+++ argus-2.0.6/server/ArgusOutput.c	2006-02-01 13:50:30.000000000 -0500
@@ -1196,11 +1196,11 @@
 void
 ArgusCheckClientStatus ()
 {
    int retn, fd;
    struct sockaddr from;
-   int len = sizeof (from);
+   socklen_t len = sizeof (from);
 
    if ((fd = accept (ArgusLfd, (struct sockaddr *)&from, &len)) > 0) {
       if ((fcntl (fd, F_SETFL, O_NONBLOCK)) >= 0) {
          if (ArgusTcpWrapper (fd, &from) >= 0) {
             int i;
-------------- next part --------------
diff -NarU5 argus-clients-2.0.6.orig/common/argus_parse.c argus-clients-2.0.6/common/argus_parse.c
--- argus-clients-2.0.6.orig/common/argus_parse.c	2003-12-06 12:42:13.000000000 -0500
+++ argus-clients-2.0.6/common/argus_parse.c	2006-02-03 11:24:38.000000000 -0500
@@ -2202,12 +2202,11 @@
 int
 ArgusReadSaslStreamSocket (struct ARGUS_INPUT *input)
 {
    int retn = 0, fd = input->fd, cnt = 0;
    unsigned int val = 0, *pval = &val;
-   struct ArgusRecord *argus = NULL;
-   char *output = NULL, *end = NULL, *ptr = NULL;
+   char *argus = NULL, *output = NULL, *end = NULL, *ptr = NULL;
    unsigned int outputlen = 0;
 
    if ((retn = sasl_getprop(input->sasl_conn, SASL_MAXOUTBUF, (void **) &pval)) != SASL_OK)
       ArgusLog (LOG_ERR, "ArgusReadSaslStreamSocket: sasl_getprop %s", strerror(errno));
 
@@ -2226,26 +2225,26 @@
       if ((retn = sasl_decode (input->sasl_conn, ptr, cnt, &output, &outputlen)) == SASL_OK) {
 #ifdef ARGUSDEBUG
          ArgusDebug (5, "ArgusReadSaslStreamSocket (0x%x) sasl_decoded %d bytes\n", input, outputlen);
 #endif
          if (outputlen) {
-            argus = (struct ArgusRecord *) output;
+            argus = output;
             end = output + outputlen;
 
-            while ((char *)argus < end) {
-               input->ArgusReadSocketCnt = ntohs(argus->ahdr.length);
-               bcopy ((char *) argus, input->ArgusReadBuffer, input->ArgusReadSocketCnt);
+            while (argus < end) {
+               input->ArgusReadSocketCnt = ntohs(((struct ArgusRecord *)argus)->ahdr.length);
+               bcopy (argus, input->ArgusReadBuffer, input->ArgusReadSocketCnt);
 
-               if (ArgusHandleDatum (argus, &ArgusFilterCode) == 1) {
+               if (ArgusHandleDatum ((struct ArgusRecord *)argus, &ArgusFilterCode) == 1) {
                   if (Sflag)
                      ArgusWriteConnection (input, "DONE: ", strlen("DONE: "));
 
                   retn = 1;
                   break;
 
                } else 
-                  (char *)argus += input->ArgusReadSocketCnt;
+                  argus += input->ArgusReadSocketCnt;
             }
 
             free (output);
          }
 
diff -NarU5 argus-clients-2.0.6.orig/common/gencode.c argus-clients-2.0.6/common/gencode.c
--- argus-clients-2.0.6.orig/common/gencode.c	2004-04-26 12:30:23.000000000 -0400
+++ argus-clients-2.0.6/common/gencode.c	2006-02-03 11:24:52.000000000 -0500
@@ -230,11 +230,11 @@
 
 
 #include <signal.h>
 #include <sys/wait.h>
 
-static u_int ArgusNetMask;
+u_int ArgusNetMask;
 static int snaplen;
 
 int
 ArgusFilterCompile(struct bpf_program *program, char *buf, int optimize, unsigned int mask)
 {


More information about the argus mailing list