]>
Commit | Line | Data |
---|---|---|
f28b8ba4 JB |
1 | diff -up openchange-openchange-2.3-VULCAN/libmapiadmin/mapiadmin_user.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/libmapiadmin/mapiadmin_user.c |
2 | --- openchange-openchange-2.3-VULCAN/libmapiadmin/mapiadmin_user.c.samba-4.10-macros 2019-02-14 15:19:53.317769411 +0100 | |
3 | +++ openchange-openchange-2.3-VULCAN/libmapiadmin/mapiadmin_user.c 2019-02-14 15:19:53.331769410 +0100 | |
4 | @@ -39,6 +39,8 @@ | |
5 | ||
6 | #include <time.h> | |
7 | ||
8 | +#include "libmapi/libmapi_private.h" | |
9 | + | |
10 | static ssize_t openchange_sys_read(int fd, void *buf, size_t count) | |
11 | { | |
12 | ssize_t ret; | |
13 | @@ -101,7 +103,7 @@ static enum ndr_err_code openchange_ndr_ | |
14 | NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->sid_rev_num)); | |
15 | NDR_CHECK(ndr_push_int8(ndr, NDR_SCALARS, r->num_auths)); | |
16 | NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->id_auth, 6)); | |
17 | - if (r->num_auths < 0 || r->num_auths > ARRAY_SIZE(r->sub_auths)) { | |
18 | + if (r->num_auths < 0 || r->num_auths > OC_ARRAY_SIZE(r->sub_auths)) { | |
19 | return ndr_push_error(ndr, NDR_ERR_RANGE, "value out of range"); | |
20 | } | |
21 | for (cntr_sub_auths_0 = 0; cntr_sub_auths_0 < r->num_auths; cntr_sub_auths_0++) { | |
22 | @@ -659,7 +661,7 @@ again: | |
23 | ||
24 | OC_DEBUG(3, "Setting account password '%s'", mapiadmin_ctx->password); | |
25 | ||
26 | - ZERO_STRUCT(u); | |
27 | + OC_ZERO_STRUCT(u); | |
28 | s.in.user_handle = &mapiadmin_ctx->user_ctx->user_handle; | |
29 | s.in.info = &u; | |
30 | s.in.level = 24; | |
31 | @@ -687,7 +689,7 @@ again: | |
32 | } | |
33 | } | |
34 | ||
35 | - ZERO_STRUCT(u); | |
36 | + OC_ZERO_STRUCT(u); | |
37 | s.in.user_handle = &mapiadmin_ctx->user_ctx->user_handle; | |
38 | s.in.info = &u; | |
39 | s.in.level = 21; | |
1b9a9805 JB |
40 | --- openchange-openchange-2.3-VULCAN/libmapi/libmapi_private.h.orig 2021-03-26 18:59:00.581217605 +0100 |
41 | +++ openchange-openchange-2.3-VULCAN/libmapi/libmapi_private.h 2021-03-26 19:01:10.224577853 +0100 | |
42 | @@ -141,6 +141,11 @@ const char *iface_best_ip(struct interf | |
43 | bool iface_is_local(struct interface *, const char *); | |
44 | bool iface_same_net(const char *, const char *, const char *); | |
f28b8ba4 JB |
45 | |
46 | +#define OC_ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) | |
47 | +#define OC_ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0) | |
48 | +#define OC_ZERO_STRUCTPN(x) memset((char *)(x), 0, sizeof(*(x))) | |
49 | +#define OC_ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) | |
50 | + | |
51 | __END_DECLS | |
52 | ||
53 | #undef _PRINTF_ATTRIBUTE | |
54 | diff -up openchange-openchange-2.3-VULCAN/libmapi/socket/interface.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/libmapi/socket/interface.c | |
55 | --- openchange-openchange-2.3-VULCAN/libmapi/socket/interface.c.samba-4.10-macros 2019-02-14 15:19:53.318769411 +0100 | |
56 | +++ openchange-openchange-2.3-VULCAN/libmapi/socket/interface.c 2019-02-14 15:19:53.331769410 +0100 | |
57 | @@ -70,7 +70,7 @@ static void add_interface(TALLOC_CTX *me | |
58 | if (iface == NULL) | |
59 | return; | |
60 | ||
61 | - ZERO_STRUCTPN(iface); | |
62 | + OC_ZERO_STRUCTPN(iface); | |
63 | ||
64 | iface->ip = ip; | |
65 | iface->nmask = nmask; | |
66 | diff -up openchange-openchange-2.3-VULCAN/mapiproxy/dcesrv_mapiproxy.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/mapiproxy/dcesrv_mapiproxy.c | |
67 | --- openchange-openchange-2.3-VULCAN/mapiproxy/dcesrv_mapiproxy.c.samba-4.10-macros 2015-05-16 17:22:04.000000000 +0200 | |
68 | +++ openchange-openchange-2.3-VULCAN/mapiproxy/dcesrv_mapiproxy.c 2019-02-14 15:19:53.331769410 +0100 | |
69 | @@ -703,7 +703,7 @@ NTSTATUS dcerpc_server_mapiproxy_init(vo | |
70 | NTSTATUS ret; | |
71 | struct dcesrv_endpoint_server ep_server; | |
72 | ||
73 | - ZERO_STRUCT(ep_server); | |
74 | + OC_ZERO_STRUCT(ep_server); | |
75 | ||
76 | /* Fill in our name */ | |
77 | ep_server.name = "mapiproxy"; | |
78 | diff -up openchange-openchange-2.3-VULCAN/ndr_mapi.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/ndr_mapi.c | |
79 | --- openchange-openchange-2.3-VULCAN/ndr_mapi.c.samba-4.10-macros 2019-02-14 15:19:53.329769410 +0100 | |
80 | +++ openchange-openchange-2.3-VULCAN/ndr_mapi.c 2019-02-14 15:19:53.331769410 +0100 | |
81 | @@ -921,7 +921,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo | |
82 | TALLOC_CTX *_mem_save_length_0; | |
83 | ||
84 | if (flags & NDR_IN) { | |
85 | - ZERO_STRUCT(r->out); | |
86 | + OC_ZERO_STRUCT(r->out); | |
87 | ||
88 | if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { | |
89 | NDR_PULL_ALLOC(ndr, r->in.handle); | |
90 | @@ -961,7 +961,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo | |
91 | NDR_PULL_ALLOC(ndr, r->out.handle); | |
92 | *r->out.handle = *r->in.handle; | |
93 | NDR_PULL_ALLOC(ndr, r->out.mapi_response); | |
94 | - ZERO_STRUCTP(r->out.mapi_response); | |
95 | + OC_ZERO_STRUCTP(r->out.mapi_response); | |
96 | NDR_PULL_ALLOC(ndr, r->out.length); | |
97 | *r->out.length = *r->in.length; | |
98 | } | |
99 | @@ -1235,7 +1235,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo | |
100 | TALLOC_CTX *_mem_save_rgbAuxOut_1; | |
101 | ||
102 | if (flags & NDR_IN) { | |
103 | - ZERO_STRUCT(r->out); | |
104 | + OC_ZERO_STRUCT(r->out); | |
105 | ||
106 | NDR_CHECK(ndr_pull_array_size(ndr, &r->in.szUserDN)); | |
107 | NDR_CHECK(ndr_pull_array_length(ndr, &r->in.szUserDN)); | |
108 | @@ -1294,19 +1294,19 @@ _PUBLIC_ enum ndr_err_code ndr_pull_EcDo | |
109 | } | |
110 | NDR_PULL_SET_MEM_CTX(ndr, _mem_save_pcbAuxOut_0, LIBNDR_FLAG_REF_ALLOC); | |
111 | NDR_PULL_ALLOC(ndr, r->out.handle); | |
112 | - ZERO_STRUCTP(r->out.handle); | |
113 | + OC_ZERO_STRUCTP(r->out.handle); | |
114 | NDR_PULL_ALLOC(ndr, r->out.pcmsPollsMax); | |
115 | - ZERO_STRUCTP(r->out.pcmsPollsMax); | |
116 | + OC_ZERO_STRUCTP(r->out.pcmsPollsMax); | |
117 | NDR_PULL_ALLOC(ndr, r->out.pcRetry); | |
118 | - ZERO_STRUCTP(r->out.pcRetry); | |
119 | + OC_ZERO_STRUCTP(r->out.pcRetry); | |
120 | NDR_PULL_ALLOC(ndr, r->out.pcmsRetryDelay); | |
121 | - ZERO_STRUCTP(r->out.pcmsRetryDelay); | |
122 | + OC_ZERO_STRUCTP(r->out.pcmsRetryDelay); | |
123 | NDR_PULL_ALLOC(ndr, r->out.picxr); | |
124 | - ZERO_STRUCTP(r->out.picxr); | |
125 | + OC_ZERO_STRUCTP(r->out.picxr); | |
126 | NDR_PULL_ALLOC(ndr, r->out.szDNPrefix); | |
127 | - ZERO_STRUCTP(r->out.szDNPrefix); | |
128 | + OC_ZERO_STRUCTP(r->out.szDNPrefix); | |
129 | NDR_PULL_ALLOC(ndr, r->out.szDisplayName); | |
130 | - ZERO_STRUCTP(r->out.szDisplayName); | |
131 | + OC_ZERO_STRUCTP(r->out.szDisplayName); | |
132 | NDR_PULL_ALLOC(ndr, r->out.pulTimeStamp); | |
133 | *r->out.pulTimeStamp = *r->in.pulTimeStamp; | |
134 | NDR_PULL_ALLOC(ndr, r->out.pcbAuxOut); | |
135 | diff -up openchange-openchange-2.3-VULCAN/testsuite/libmapi/mapi_property.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/testsuite/libmapi/mapi_property.c | |
136 | --- openchange-openchange-2.3-VULCAN/testsuite/libmapi/mapi_property.c.samba-4.10-macros 2015-05-16 17:22:04.000000000 +0200 | |
137 | +++ openchange-openchange-2.3-VULCAN/testsuite/libmapi/mapi_property.c 2019-02-14 15:19:53.331769410 +0100 | |
138 | @@ -280,7 +280,7 @@ static void _make_test_srow(TALLOC_CTX * | |
139 | { | |
140 | struct SPropValue prop_val; | |
141 | ||
142 | - ZERO_STRUCT(prop_val); | |
143 | + OC_ZERO_STRUCT(prop_val); | |
144 | /* PT_I8 */ | |
145 | prop_val.ulPropTag = PR_FID; | |
146 | prop_val.value.d = 0x0123456789ABCDEFul; | |
147 | diff -up openchange-openchange-2.3-VULCAN/testsuite/libmapiproxy/openchangedb_logger.c.samba-4.10-macros openchange-openchange-2.3-VULCAN/testsuite/libmapiproxy/openchangedb_logger.c | |
148 | --- openchange-openchange-2.3-VULCAN/testsuite/libmapiproxy/openchangedb_logger.c.samba-4.10-macros 2015-05-16 17:22:04.000000000 +0200 | |
149 | +++ openchange-openchange-2.3-VULCAN/testsuite/libmapiproxy/openchangedb_logger.c 2019-02-14 15:19:53.332769410 +0100 | |
150 | @@ -638,7 +638,7 @@ static void ocdb_logger_setup(void) | |
151 | ck_abort(); | |
152 | } | |
153 | ||
154 | - ZERO_STRUCT(functions_called); | |
155 | + OC_ZERO_STRUCT(functions_called); | |
156 | } | |
157 | ||
158 | static void ocdb_logger_teardown(void) |