From c31b13d77b8dba9f2f925890e4ef1930612aa45b Mon Sep 17 00:00:00 2001 From: SJ Date: Wed, 9 Dec 2015 21:19:14 +0100 Subject: [PATCH] adding some licencing stuff --- piler-config.h.in | 1 + src/config.h | 2 +- src/defs.h | 10 ++++++++++ src/errmsg.h | 3 +++ unit_tests/Makefile.in | 3 +++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/piler-config.h.in b/piler-config.h.in index 686eb031..694f4e6b 100644 --- a/piler-config.h.in +++ b/piler-config.h.in @@ -7,6 +7,7 @@ #define DATAROOTDIR "/usr/local/share" #define KEYFILE CONFDIR "/piler.key" +#define LICENCE_SIGNATURE_FILE CONFDIR "/piler.lic" #define MESSAGE_ID_DEDUP_FILE DATAROOTDIR "/piler/deduphelper" diff --git a/src/config.h b/src/config.h index 45c3b330..cf9fcbce 100644 --- a/src/config.h +++ b/src/config.h @@ -13,7 +13,7 @@ #define VERSION "1.2.0-master" -#define BUILD 930 +#define BUILD 931 #define HOSTID "mailarchiver" diff --git a/src/defs.h b/src/defs.h index 164a1551..3fb72e70 100644 --- a/src/defs.h +++ b/src/defs.h @@ -300,6 +300,15 @@ struct import { }; +struct licence { + char customer[TINYBUFSIZE]; + char hostname[TINYBUFSIZE]; + char ip[TINYBUFSIZE]; + time_t expiry; + int licenced_users; +}; + + struct __data { int folder, quiet; char recursive_folder_names; @@ -307,6 +316,7 @@ struct __data { struct node *mydomains[MAXHASH]; struct node *imapfolders[MAXHASH]; struct import *import; + struct licence licence; char *dedup; int child_serial; diff --git a/src/errmsg.h b/src/errmsg.h index 933648ce..c3de489c 100644 --- a/src/errmsg.h +++ b/src/errmsg.h @@ -29,4 +29,7 @@ #define ERR_READING_KEY "ERR: reading cipher key" +#define ERR_LICENCE "ERR: licence validation error" +#define ERR_LICENCE_IP "ERR: licenced IP-address doesn't match with listen_addr parameter" + #endif /* _ERRMSG_H */ diff --git a/unit_tests/Makefile.in b/unit_tests/Makefile.in index 5c4ba671..e98e2074 100644 --- a/unit_tests/Makefile.in +++ b/unit_tests/Makefile.in @@ -32,6 +32,9 @@ check_parser_utils: check_parser_utils.c ../src/libpiler.a smtp: smtp.c ../src/libpiler.a $(CC) $(CFLAGS) $(INCDIR) $(DEFS) -o $@ $< -lpiler $(LIBS) $(LIBDIR) +install: + @echo + clean: rm -f check_parser_utils smtp