On 2014/11/30 18:03, Gökhan Güler wrote:
> Hello. I ported /security/logsurfer to 64-bit system a while ago and wanted
> to submit it to ports. However I don't have an account and I need help on
> submitting. I had to delete the OpenBSD system but I have patch files. Can
> anybody help and submit the port using the patch files?
>
> Here is the new patch files:
> https://www.dropbox.com/s/a2jsf07onu1svot/patch_files.tar.gz?dl=0
Formatted as a diff below for the benefit of the list. I'm not making
any comments on the code in the diff at the moment (except that
OpenBSD doesn't run on systems where sizeof(char) != 1 ;) I just
wanted to get it somewhere other than dropbox.
Index: Makefile
===================================================================
RCS file: /cvs/ports/security/logsurfer/Makefile,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile
--- Makefile 11 Mar 2013 11:41:25 -0000 1.22
+++ Makefile 2 Dec 2014 09:37:49 -0000
@@ -19,6 +19,6 @@ CONFIGURE_STYLE= gnu
NO_TEST= Yes
-NOT_FOR_ARCHS= ${LP64_ARCHS}
+#NOT_FOR_ARCHS= ${LP64_ARCHS}
.include <bsd.port.mk>
Index: patches/patch-Makefile_in
===================================================================
RCS file: /cvs/ports/security/logsurfer/patches/patch-Makefile_in,v
retrieving revision 1.2
diff -u -p -r1.2 patch-Makefile_in
--- patches/patch-Makefile_in 25 Aug 2012 10:07:26 -0000 1.2
+++ patches/patch-Makefile_in 2 Dec 2014 09:37:49 -0000
@@ -1,6 +1,6 @@
-$OpenBSD: patch-Makefile_in,v 1.2 2012/08/25 10:07:26 sthen Exp $
---- Makefile.in.orig Thu Aug 11 04:15:31 2011
-+++ Makefile.in Thu Aug 23 10:50:52 2012
+$OpenBSD$
+--- Makefile.in.orig Thu Aug 11 03:15:31 2011
++++ Makefile.in Tue Dec 2 09:36:33 2014
@@ -8,12 +8,12 @@ version = 1.8
# Where is the default configuration file
Index: patches/patch-src_context_c
===================================================================
RCS file: patches/patch-src_context_c
diff -N patches/patch-src_context_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_context_c 2 Dec 2014 09:37:49 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+--- src/context.c.orig Wed Aug 3 22:41:32 2011
++++ src/context.c Tue Dec 2 09:36:33 2014
+@@ -133,7 +133,7 @@ open_context(context_def)
+ return;
+ }
+ /* use fastmap if enough memeory available */
+- new_context->match_regex->fastmap=(char *)malloc(256);
++ new_context->match_regex->fastmap=(char *)malloc(64 * sizeof(char *));
+ new_context->match_regex->translate=(char *) 0;
+ new_context->match_regex->buffer=NULL;
+ new_context->match_regex->allocated=0;
+@@ -162,7 +162,7 @@ open_context(context_def)
+ return;
+ }
+ /* use fastmap if enough memeory available */
+- new_context->match_not_regex->fastmap=(char *)malloc(256);
++ new_context->match_not_regex->fastmap=(char *)malloc(64 *
sizeof(char *));
+ new_context->match_not_regex->translate=(char *) 0;
+ new_context->match_not_regex->buffer=NULL;
+ new_context->match_not_regex->allocated=0;
Index: patches/patch-src_logsurfer_c
===================================================================
RCS file: /cvs/ports/security/logsurfer/patches/patch-src_logsurfer_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-src_logsurfer_c
--- patches/patch-src_logsurfer_c 25 Aug 2012 10:07:26 -0000 1.3
+++ patches/patch-src_logsurfer_c 2 Dec 2014 09:37:49 -0000
@@ -1,6 +1,17 @@
-$OpenBSD: patch-src_logsurfer_c,v 1.3 2012/08/25 10:07:26 sthen Exp $
---- src/logsurfer.c.orig Mon Sep 5 10:35:08 2011
-+++ src/logsurfer.c Thu Aug 23 10:50:53 2012
+$OpenBSD$
+--- src/logsurfer.c.orig Mon Sep 5 09:35:08 2011
++++ src/logsurfer.c Tue Dec 2 09:36:33 2014
+@@ -385,8 +385,8 @@ main(argc, argv)
+ FILE *pidfile; /* write pid info to file */
+
+ char *logline_buffer; /* buffer for reading */
+- int logline_buffer_size; /* size of buffer */
+- int logline_buffer_pos; /* position within buffer */
++ long logline_buffer_size; /* size of buffer */
++ long logline_buffer_pos; /* position within buffer */
+
+ struct sigaction signal_info; /* used by sigaction() */
+
@@ -458,7 +458,7 @@ main(argc, argv)
*/
logline_buffer_size=4096;
@@ -10,3 +21,12 @@ $OpenBSD: patch-src_logsurfer_c,v 1.3 20
(void) fprintf(stderr, "unable to allocate memory for
logline_buffer\n");
exit(99);
}
+@@ -522,7 +522,7 @@ main(argc, argv)
+ exit(99);
+ }
+
+- start_regex->fastmap=(char *)malloc(256);
++ start_regex->fastmap=(char *)malloc(64 * sizeof(char
*));
+ start_regex->translate=(char *) 0;
+ start_regex->buffer=NULL;
+ start_regex->allocated=0;
Index: patches/patch-src_readcf_c
===================================================================
RCS file: patches/patch-src_readcf_c
diff -N patches/patch-src_readcf_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_readcf_c 2 Dec 2014 09:37:49 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/readcf.c.orig Thu Aug 29 11:24:17 2002
++++ src/readcf.c Tue Dec 2 09:36:33 2014
+@@ -92,7 +92,7 @@ read_config(filename)
+ {
+ FILE *infile; /* filehandel for configfile */
+ char *buffer; /* buffer for reading */
+- int buf_size, buf_pos; /* used for buffer description */
++ long buf_size, buf_pos; /* used for buffer description */
+ char *cfline; /* one configuration line */
+ int cfline_size; /* size of cfline buffer */
+ char *input_line; /* a new line from the cf file */
Index: patches/patch-src_readline_c
===================================================================
RCS file: patches/patch-src_readline_c
diff -N patches/patch-src_readline_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_readline_c 2 Dec 2014 09:37:49 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+--- src/readline.c.orig Tue Aug 3 11:10:29 1999
++++ src/readline.c Tue Dec 2 09:36:33 2014
+@@ -31,6 +31,7 @@ char *strchr();
+ #endif
+ #endif
+
++#include <stdlib.h>
+ #include <ctype.h>
+ #include <sys/types.h>
+
+@@ -88,8 +89,8 @@ char *
+ readline(infile, buffer, buffer_size, buffer_pos)
+ FILE *infile;
+ char **buffer;
+- int *buffer_size;
+- int *buffer_pos;
++ long *buffer_size;
++ long *buffer_pos;
+ {
+ int byte_count=0;
+ char *help_ptr;
Index: patches/patch-src_readline_h
===================================================================
RCS file: patches/patch-src_readline_h
diff -N patches/patch-src_readline_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_readline_h 2 Dec 2014 09:37:49 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- src/readline.h.orig Tue Aug 3 11:10:29 1999
++++ src/readline.h Tue Dec 2 09:36:33 2014
+@@ -7,7 +7,7 @@
+ #if __STDC__
+
+ int expand_buf(char **, int *, int);
+-char *readline(FILE *, char **, int *, int *);
++char *readline(FILE *, char **, long *, long *);
+
+ #else /* __STDC__ */
+
Index: patches/patch-src_regex_c
===================================================================
RCS file: patches/patch-src_regex_c
diff -N patches/patch-src_regex_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_regex_c 2 Dec 2014 09:37:49 -0000
@@ -0,0 +1,158 @@
+$OpenBSD$
+--- src/regex.c.orig Tue Aug 3 11:10:29 1999
++++ src/regex.c Tue Dec 2 09:36:33 2014
+@@ -729,7 +729,7 @@ print_compiled_pattern (bufp)
+ unsigned char *buffer = bufp->buffer;
+
+ print_partial_compiled_pattern (buffer, buffer + bufp->used);
+- printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated);
++ printf ("%lu bytes used/%lu bytes allocated.\n", bufp->used,
bufp->allocated);
+
+ if (bufp->fastmap_accurate && bufp->fastmap)
+ {
+@@ -737,7 +737,7 @@ print_compiled_pattern (bufp)
+ print_fastmap (bufp->fastmap);
+ }
+
+- printf ("re_nsub: %d\t", bufp->re_nsub);
++ printf ("re_nsub: %ld\t", bufp->re_nsub);
+ printf ("regs_alloc: %d\t", bufp->regs_allocated);
+ printf ("can_be_null: %d\t", bufp->can_be_null);
+ printf ("newline_anchor: %d\n", bufp->newline_anchor);
+@@ -2354,7 +2354,7 @@ typedef struct
+ char *destination;
\
+ /* Must be int, so when we don't save any registers, the arithmetic
\
+ of 0 + -1 isn't done as unsigned. */ \
+- int this_reg; \
++ long this_reg; \
+ \
+ DEBUG_STATEMENT (failure_id++); \
+ DEBUG_STATEMENT (nfailure_points_pushed++);
\
+@@ -2366,7 +2366,7 @@ typedef struct
+ DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \
+ \
+ /* Ensure we have enough space allocated for what we will push. */
\
+- while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \
++ while (((unsigned long) REMAINING_AVAIL_SLOTS) < NUM_FAILURE_ITEMS)
\
+ {
\
+ if (!DOUBLE_FAIL_STACK (fail_stack)) \
+ return failure_code;
\
+@@ -2403,10 +2403,10 @@ typedef struct
+ PUSH_FAILURE_ITEM (reg_info[this_reg].word); \
+ }
\
+ \
+- DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\
++ DEBUG_PRINT2 (" Pushing low active reg: %lu\n", lowest_active_reg);\
+ PUSH_FAILURE_ITEM (lowest_active_reg); \
+ \
+- DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\
++ DEBUG_PRINT2 (" Pushing high active reg: %lu\n", highest_active_reg);\
+ PUSH_FAILURE_ITEM (highest_active_reg); \
+ \
+ DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \
+@@ -2461,7 +2461,7 @@ typedef struct
+ #define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend,
reg_info)\
+ { \
+ DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
+- int this_reg;
\
++ long this_reg; \
+ const unsigned char *string_temp; \
+ \
+ assert (!FAIL_STACK_EMPTY ()); \
+@@ -2492,15 +2492,15 @@ typedef struct
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
+ \
+ /* Restore register info. */
\
+- high_reg = (unsigned) POP_FAILURE_ITEM (); \
+- DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \
++ high_reg = (unsigned long) POP_FAILURE_ITEM ();
\
++ DEBUG_PRINT2 (" Popping high active reg: %lu\n", high_reg);
\
+ \
+- low_reg = (unsigned) POP_FAILURE_ITEM (); \
+- DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \
++ low_reg = (unsigned long) POP_FAILURE_ITEM ();
\
++ DEBUG_PRINT2 (" Popping low active reg: %lu\n", low_reg); \
+ \
+ for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
+ { \
+- DEBUG_PRINT2 (" Popping reg: %d\n", this_reg);
\
++ DEBUG_PRINT2 (" Popping reg: %lu\n", this_reg);
\
+ \
+ reg_info[this_reg].word = POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]);
\
+@@ -3034,7 +3034,7 @@ typedef union
+ #define SET_REGS_MATCHED() \
+ do \
+ { \
+- unsigned r; \
++ unsigned long r;
\
+ for (r = lowest_active_reg; r <= highest_active_reg; r++)
\
+ { \
+ MATCHED_SOMETHING (reg_info[r]) \
+@@ -3208,8 +3208,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos,
+ unsigned num_regs = bufp->re_nsub + 1;
+
+ /* The currently active registers. */
+- unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+- unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
++ unsigned long lowest_active_reg = NO_LOWEST_ACTIVE_REG;
++ unsigned long highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+
+ /* Information on the contents of registers. These are pointers into
+ the input strings; they record just what was matched (on this
+@@ -3762,13 +3762,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos,
+ regstart[r] = old_regstart[r];
+
+ /* xx why this test? */
+- if ((int) old_regend[r] >= (int) regstart[r])
++ if ((long) old_regend[r] >= (long) regstart[r])
+ regend[r] = old_regend[r];
+ }
+ }
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+- PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
++ PUSH_FAILURE_POINT (p1 + ((long) mcnt), d, -2);
+
+ goto fail;
+ }
+@@ -3915,7 +3915,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos,
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
+
+- PUSH_FAILURE_POINT (p + mcnt, NULL, -2);
++ PUSH_FAILURE_POINT (p + ((long) mcnt), NULL, -2);
+ break;
+
+
+@@ -3968,7 +3968,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos,
+ }
+
+ DEBUG_PRINT1 (":\n");
+- PUSH_FAILURE_POINT (p + mcnt, d, -2);
++ PUSH_FAILURE_POINT (p + ((long) mcnt), d, -2);
+ break;
+
+
+@@ -4069,7 +4069,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos,
+ actual values. Otherwise, we will restore only one
+ register from the stack, since lowest will == highest in
+ `pop_failure_point'. */
+- unsigned dummy_low_reg, dummy_high_reg;
++ unsigned long dummy_low_reg, dummy_high_reg;
+ unsigned char *pdummy;
+ const char *sdummy;
+
+@@ -4661,10 +4661,10 @@ re_comp (s)
+
+ if (!re_comp_buf.buffer)
+ {
+- re_comp_buf.buffer = (unsigned char *) malloc (200);
++ re_comp_buf.buffer = (unsigned char *) malloc (50 * sizeof(unsigned
char *));
+ if (re_comp_buf.buffer == NULL)
+ return "Memory exhausted";
+- re_comp_buf.allocated = 200;
++ re_comp_buf.allocated = 50 * sizeof(unsigned char *);
+
+ re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
+ if (re_comp_buf.fastmap == NULL)
Index: patches/patch-src_rule_c
===================================================================
RCS file: patches/patch-src_rule_c
diff -N patches/patch-src_rule_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_rule_c 2 Dec 2014 09:37:49 -0000
@@ -0,0 +1,39 @@
+$OpenBSD$
+--- src/rule.c.orig Wed Aug 3 22:41:32 2011
++++ src/rule.c Tue Dec 2 09:36:33 2014
+@@ -200,7 +200,7 @@ parse_rule(input_line)
+ return(NULL);
+ }
+ /* use fastmap if enough memeory available */
+- new_rule->match_regex->fastmap=(char *)malloc(256);
++ new_rule->match_regex->fastmap=(char *)malloc(64 * sizeof(char *));
+ new_rule->match_regex->translate=(char *) 0;
+ new_rule->match_regex->buffer=NULL;
+ new_rule->match_regex->allocated=0;
+@@ -227,7 +227,7 @@ parse_rule(input_line)
+ return(NULL);
+ }
+ /* use fastmap if enough memeory available */
+- new_rule->match_not_regex->fastmap=(char *)malloc(256);
++ new_rule->match_not_regex->fastmap=(char *)malloc(64 *
sizeof(char *));
+ new_rule->match_not_regex->translate=(char *) 0;
+ new_rule->match_not_regex->buffer=NULL;
+ new_rule->match_not_regex->allocated=0;
+@@ -258,7 +258,7 @@ parse_rule(input_line)
+ return(NULL);
+ }
+ /* use fastmap if enough memeory available */
+- new_rule->stop_regex->fastmap=(char *)malloc(256);
++ new_rule->stop_regex->fastmap=(char *)malloc(64 * sizeof(char
*));
+ new_rule->stop_regex->translate=(char *) 0;
+ new_rule->stop_regex->buffer=NULL;
+ new_rule->stop_regex->allocated=0;
+@@ -288,7 +288,7 @@ parse_rule(input_line)
+ return(NULL);
+ }
+ /* use fastmap if enough memeory available */
+- new_rule->stop_not_regex->fastmap=(char *)malloc(256);
++ new_rule->stop_not_regex->fastmap=(char *)malloc(64 *
sizeof(char *));
+ new_rule->stop_not_regex->translate=(char *) 0;
+ new_rule->stop_not_regex->buffer=NULL;
+ new_rule->stop_not_regex->allocated=0;