mirror of
https://gitlab.kit.edu/kit/scc/sys/mail/exim-encrypt-dlfunc.git
synced 2025-12-06 10:03:56 +01:00
Merge branch 'meson'
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,5 +1,2 @@
|
|||||||
src/genkey
|
/build
|
||||||
src/*.so
|
|
||||||
src/recipient_sk.*
|
|
||||||
src/recipient_pk.*
|
|
||||||
src/*.c~
|
|
||||||
|
|||||||
@ -5,14 +5,17 @@ stages:
|
|||||||
.build:
|
.build:
|
||||||
stage: build
|
stage: build
|
||||||
before_script:
|
before_script:
|
||||||
- apt-get update && apt-get install -y build-essential exim4-dev libsodium-dev
|
- apt-get update
|
||||||
|
- DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical apt-get install -y build-essential exim4-dev libsodium-dev meson exim4-daemon-heavy pkg-config openssl
|
||||||
script:
|
script:
|
||||||
- cd src
|
- meson build
|
||||||
- make all
|
- cd build
|
||||||
|
- ninja
|
||||||
|
- ninja test
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- src/genkey
|
- build/src/genkey
|
||||||
- src/libexim-encrypt-dlfunc.so
|
- build/src/libexim-encrypt-dlfunc.so
|
||||||
|
|
||||||
build:buster:
|
build:buster:
|
||||||
extends:
|
extends:
|
||||||
@ -33,34 +36,3 @@ build:focal:
|
|||||||
image: ubuntu:focal
|
image: ubuntu:focal
|
||||||
extends:
|
extends:
|
||||||
- .build
|
- .build
|
||||||
.test:
|
|
||||||
stage: test
|
|
||||||
before_script:
|
|
||||||
- apt-get update && apt-get install -y exim4-daemon-heavy openssl libsodium23
|
|
||||||
script:
|
|
||||||
- cd src
|
|
||||||
- ./simple_exim_test.sh
|
|
||||||
|
|
||||||
test:buster:
|
|
||||||
extends:
|
|
||||||
- .test
|
|
||||||
needs: ["build:buster"]
|
|
||||||
image: debian:buster
|
|
||||||
|
|
||||||
test:bullseye:
|
|
||||||
extends:
|
|
||||||
- .test
|
|
||||||
needs: ["build:bullseye"]
|
|
||||||
image: debian:bullseye
|
|
||||||
|
|
||||||
test:bionic:
|
|
||||||
extends:
|
|
||||||
- .test
|
|
||||||
needs: ["build:bionic"]
|
|
||||||
image: ubuntu:bionic
|
|
||||||
|
|
||||||
test:focal:
|
|
||||||
extends:
|
|
||||||
- .test
|
|
||||||
needs: ["build:focal"]
|
|
||||||
image: ubuntu:focal
|
|
||||||
|
|||||||
23
meson.build
Normal file
23
meson.build
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
project('libexim-encrypt-dlfunc', 'c',
|
||||||
|
default_options: ['b_lundef=false', 'b_pie=true'])
|
||||||
|
|
||||||
|
compiler = meson.get_compiler('c')
|
||||||
|
conf_data = configuration_data()
|
||||||
|
|
||||||
|
sodium_deps = dependency('libsodium')
|
||||||
|
|
||||||
|
exim4_code = '''
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <exim4/local_scan.h>
|
||||||
|
int main() {
|
||||||
|
printf("%d\n", LOCAL_SCAN_ABI_VERSION_MAJOR);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
'''
|
||||||
|
|
||||||
|
result = compiler.run(exim4_code)
|
||||||
|
local_scan_version = result.stdout().strip().to_int()
|
||||||
|
|
||||||
|
conf_data.set('local_scan_version', local_scan_version)
|
||||||
|
|
||||||
|
subdir('src')
|
||||||
4
src/config.h.in
Normal file
4
src/config.h.in
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define LOCAL_SCAN_VERSION @local_scan_version@
|
||||||
|
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
@ -6,8 +8,10 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#define LOCAL_SCAN
|
||||||
|
#define DLFUNC_IMPL
|
||||||
/* Exim4 dlfunc API header */
|
/* Exim4 dlfunc API header */
|
||||||
#include <local_scan.h>
|
#include <exim4/local_scan.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is a set of workarounds for the different exim local_scan ABI versions, distribution patches and missing
|
* This is a set of workarounds for the different exim local_scan ABI versions, distribution patches and missing
|
||||||
@ -21,26 +25,14 @@
|
|||||||
* 3.1 Ubuntu 20-04 (Focal)
|
* 3.1 Ubuntu 20-04 (Focal)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// local_scan ABI version < 3
|
#if LOCAL_SCAN_VERSION < 3
|
||||||
#if LOCAL_SCAN_ABI_VERSION_MAJOR < 3
|
#define store_get_untainted(size) (store_get(size))
|
||||||
#define LOCAL_SCAN
|
#define store_get_tainted(size) (store_get(size))
|
||||||
#define store_get_untainted(size) store_get(size)
|
#elif LOCAL_SCAN_VERSION >= 3
|
||||||
#define store_get_tainted(size) store_get(size)
|
#define store_get_untainted(size) (store_get(size, FALSE))
|
||||||
|
#define store_get_tainted(size) (store_get(size, TRUE))
|
||||||
// local_scan ABI version == 3
|
|
||||||
#elif LOCAL_SCAN_ABI_VERSION_MAJOR == 3
|
|
||||||
#define DLFUNC_IMPL
|
|
||||||
#define store_get_untainted(size) store_get(size, FALSE)
|
|
||||||
#define store_get_tainted(size) store_get(size, TRUE)
|
|
||||||
|
|
||||||
# define string_copy(s) string_copy_function(s)
|
|
||||||
extern uschar * string_copy_function(const uschar *);
|
|
||||||
|
|
||||||
// local_scan ABI version > 3
|
|
||||||
#else
|
#else
|
||||||
#define DLFUNC_IMPL
|
#error "exim4 local version"
|
||||||
#define store_get_untainted(size) store_get(size, FALSE)
|
|
||||||
#define store_get_tainted(size) store_get(size, TRUE)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
14
src/meson.build
Normal file
14
src/meson.build
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
configure_file(input: 'config.h.in',
|
||||||
|
output: 'config.h',
|
||||||
|
configuration: conf_data)
|
||||||
|
|
||||||
|
executable('genkey', 'genkey.c', dependencies : [ sodium_deps ] )
|
||||||
|
|
||||||
|
shared_library('exim-encrypt-dlfunc', 'libexim-encrypt-dlfunc.c',
|
||||||
|
dependencies : [ sodium_deps ],
|
||||||
|
install: true)
|
||||||
|
|
||||||
|
|
||||||
|
simple_exim_test = find_program('simple_exim_test.sh')
|
||||||
|
test('simple test', simple_exim_test)
|
||||||
|
|
||||||
@ -2,8 +2,10 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
PATH=/sbin:/usr/sbin:$PATH
|
||||||
|
|
||||||
# copy to /tmp to keep call to exim under 256 chars (prevent problems on Ubuntu)
|
# copy to /tmp to keep call to exim under 256 chars (prevent problems on Ubuntu)
|
||||||
install -t /tmp libexim-encrypt-dlfunc.so
|
install -t /tmp src/libexim-encrypt-dlfunc.so
|
||||||
|
|
||||||
LIB=/tmp/libexim-encrypt-dlfunc.so
|
LIB=/tmp/libexim-encrypt-dlfunc.so
|
||||||
CLEARTEXT="127.88.99.23" # keep short; see above
|
CLEARTEXT="127.88.99.23" # keep short; see above
|
||||||
|
|||||||
Reference in New Issue
Block a user