From 7d24cae345aaaec209831074a2c94d25b1def841 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Tue, 13 Jun 2017 13:59:39 +0200 Subject: [PATCH] add i_zero macro --- Dockerfile | 9 +++++++-- i_zero.patch | 12 ++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 i_zero.patch diff --git a/Dockerfile b/Dockerfile index 8649b5d..d8bab6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,11 @@ FROM quay.io/thallian/confd-env:latest -RUN apk add --no-cache dovecot dovecot-ldap libressl ssmtp g++ openldap-dev dovecot-dev make tar +RUN apk add --no-cache dovecot dovecot-ldap libressl ssmtp g++ openldap-dev dovecot-dev make tar + +ADD i_zero.patch /usr/include/dovecot/i_zero.patch +WORKDIR /usr/include/dovecot +RUN patch -p1 < i_zero.patch +RUN rm /usr/include/dovecot/i_zero.patch RUN mkdir /tmp/pigeonhole RUN wget -qO- https://pigeonhole.dovecot.org/releases/2.2/dovecot-2.2-pigeonhole-0.4.18.tar.gz | tar -xz -C /tmp/pigeonhole --strip 1 @@ -18,7 +23,7 @@ RUN adduser -u 1111 -h /var/lib/vmail -D -G vmail vmail RUN mkdir /var/lib/vmail/sieve-after/ RUN chown vmail:vmail /var/lib/vmail/sieve-after/ -EXPOSE 143 4190 6334 7777 +EXPOSE 143 4190 6334 7777 VOLUME /var/lib/vmail/mail/ /etc/ssl/mail diff --git a/i_zero.patch b/i_zero.patch new file mode 100644 index 0000000..ecef32e --- /dev/null +++ b/i_zero.patch @@ -0,0 +1,12 @@ +diff --git a/macros.h b/macros.h +index 566c176..ebbf480 100644 +--- a/macros.h ++++ b/macros.h +@@ -240,4 +240,7 @@ + # define STATIC_ARRAY + #endif + ++#define i_zero(p) memset(p, 0, sizeof(*(p))) ++#define i_zero_safe(p) safe_memset(p, 0, sizeof(*(p))) ++ + #endif