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

@ -2,6 +2,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 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 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
WORKDIR /tmp/pigeonhole WORKDIR /tmp/pigeonhole

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