add i_zero macro

This commit is contained in:
Sebastian Hugentobler 2017-06-13 13:59:39 +02:00
parent b54bffe1e6
commit 7d24cae345
2 changed files with 19 additions and 2 deletions

View File

@ -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

12
i_zero.patch Normal file
View File

@ -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