Fix build with -fno-common

While here add license (GPLv2)
This commit is contained in:
Stefan Eßer 2020-09-22 13:28:40 +00:00
parent f83e4e70fe
commit 6fc230b634
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=549592
10 changed files with 157 additions and 4 deletions

View File

@ -3,12 +3,16 @@
PORTNAME= logtool
PORTVERSION= 1.3.1
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://xjack.org/logtool/download/
MAINTAINER= rodrigo@FreeBSD.org
COMMENT= Parse ASCII logfiles into ANSI, CSV, HTML formats
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
USES= gmake
GNU_CONFIGURE= yes

View File

@ -0,0 +1,11 @@
--- src/ansi.c.orig 2003-04-21 17:42:38 UTC
+++ src/ansi.c
@@ -20,6 +20,8 @@
#include "includes.h"
+st_color color;
+
void lt_colorset_ansi() { /* this sets up color definitions for the output module */
/* simple strcpy's to the appropriate variables */

View File

@ -0,0 +1,11 @@
--- src/gethost.c.orig 2003-05-16 20:13:20 UTC
+++ src/gethost.c
@@ -21,6 +21,8 @@
/* Yee ole includes (I put this all in one file for my sanity) */
#include "includes.h"
+char lt_host[LSIZE];
+
#ifndef NO_RESOLVER
/* var's for gethostbyaddr() stuff */
extern int h_errno;

View File

@ -1,10 +1,10 @@
--- logtool/includes.h.orig Wed Jan 10 04:18:00 2001
+++ src/includes.h Wed Jan 10 04:20:00 2001
@@ -22,6 +22,7 @@
--- src/includes.h.orig 2003-05-02 17:44:53 UTC
+++ src/includes.h
@@ -27,6 +27,7 @@
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
+#include<unistd.h>
#include<regex.h>
#include<errno.h>
#include<time.h>

View File

@ -0,0 +1,44 @@
--- src/logtool.h.orig 2003-05-29 22:36:57 UTC
+++ src/logtool.h
@@ -82,7 +82,7 @@ int strncasecmp(const char *s1, const char *s2, size_t
#endif
/* this is a global variable we use to pass around hostname's */
-char lt_host[LSIZE];
+extern char lt_host[LSIZE];
/*
* This is the structure each line of syslog file get's parsed into.
@@ -105,7 +105,7 @@ typedef struct {
char pmsg[(LSIZE * 4)]; /* where we store the string we're going to print */
MOD m; /* pointer to where we store extra data for mod_* events*/
} st_event;
-st_event event;
+extern st_event event;
/* Structure for the event color variables */
typedef struct {
@@ -137,7 +137,7 @@ typedef struct {
char unknown[256]; /* \033u */
char end[256]; /* \033e */
} st_color;
-st_color color;
+extern st_color color;
typedef struct {
char configfile[1024]; /* ascii name of our config file */
@@ -158,7 +158,7 @@ typedef struct {
short int resolv; /* disable host resolution, even if enabled in cfg file */
} CONFIG;
-CONFIG cf;
+extern CONFIG cf;
extern int errno; /* the error number thing from the errno functions */
@@ -242,4 +242,4 @@ typedef struct {
regex_t include_reg;
} STRUCTURE_REGEXS;
-STRUCTURE_REGEXS reg;
+extern STRUCTURE_REGEXS reg;

View File

@ -0,0 +1,11 @@
--- src/mod_iptables.c.orig 2003-04-17 11:18:16 UTC
+++ src/mod_iptables.c
@@ -21,6 +21,8 @@
/* Yee ole includes (I put this all in one file for my sanity) */
#include "includes.h"
+IPTABLES it;
+
/*
* a module to process iptables messages into something sane to read with the naked eye
*/

View File

@ -0,0 +1,11 @@
--- src/mod_snort.c.orig 2003-05-02 16:38:33 UTC
+++ src/mod_snort.c
@@ -21,7 +21,7 @@
/* Yee ole includes (I put this all in one file for my sanity) */
#include "includes.h"
-
+SNORT sn;
/*
* NOTES:

View File

@ -0,0 +1,37 @@
--- src/mods.h.orig 2003-04-17 11:21:37 UTC
+++ src/mods.h
@@ -45,12 +45,12 @@ short int ltm_iptables();
char *get_host(char *host);
/* for the snort log lines (this one's a bit complicated) */
-short int ltm_snort();
+extern short int ltm_snort();
/* variables to tell us if we're to use the functions in question or not */
-short int ltm_use_syslog;
-short int ltm_use_snort;
-short int ltm_use_sudo;
+extern short int ltm_use_syslog;
+extern short int ltm_use_snort;
+extern short int ltm_use_sudo;
/* "ltm_unknown(); we allways have enabled (otherwise, what's the use? */
/* data structs for iptables and snort and so-on for linking in event->special */
@@ -66,7 +66,7 @@ typedef struct {
char class[512]; /* Classification: field */
char prior[512]; /* Priority: field */
} SNORT;
-SNORT sn;
+extern SNORT sn;
/* repeat for iptables variables */
typedef struct {
@@ -84,7 +84,7 @@ typedef struct {
char ttl[64]; /* TTL=ttl packet time to live */
char proto[64]; /* PROTO=UDP protocol of datagram */
} IPTABLES;
-IPTABLES it;
+extern IPTABLES it;
/* a wrapper struct so's we can point to structs like the above from
* event.* struct (see logtool.h for this struct) */

View File

@ -0,0 +1,11 @@
--- src/parser.c.orig 2003-05-29 18:13:56 UTC
+++ src/parser.c
@@ -20,6 +20,8 @@
#include "includes.h"
+st_event event;
+
/* a parsing function to do a string replacement (sorta like sed w/o the extended syntax) */
/* A function to do string replacement's (a bit like sed) */

View File

@ -0,0 +1,13 @@
--- src/readconf.c.orig 2003-04-17 11:12:41 UTC
+++ src/readconf.c
@@ -19,6 +19,10 @@
*/
#include "includes.h"
+
+CONFIG cf;
+STRUCTURE_REGEXS reg;
+
void lt_set_config_err(char *option, char *val) {
printf("Error: invalid value [%s] to option [%s] in cfg file\n", val, option);
exit (1);