1 --- a/libcli/util/doserr.c
2 +++ b/libcli/util/doserr.c
3 @@ -28,6 +28,7 @@ struct werror_code_struct {
5 static const struct werror_code_struct dos_errs[] =
8 { "WERR_OK", WERR_OK },
9 { "WERR_BADFILE", WERR_BADFILE },
10 { "WERR_ACCESS_DENIED", WERR_ACCESS_DENIED },
11 @@ -2668,6 +2669,7 @@ static const struct werror_code_struct d
12 { "WERR_AMBIGUOUS_SYSTEM_DEVICE", WERR_AMBIGUOUS_SYSTEM_DEVICE },
13 { "WERR_SYSTEM_DEVICE_NOT_FOUND", WERR_SYSTEM_DEVICE_NOT_FOUND },
14 /* END GENERATED-WIN32-ERROR-CODES */
19 @@ -2684,12 +2686,14 @@ const char *win_errstr(WERROR werror)
24 while (dos_errs[idx].dos_errstr != NULL) {
25 if (W_ERROR_V(dos_errs[idx].werror) ==
27 return dos_errs[idx].dos_errstr;
32 slprintf(msg, sizeof(msg), "DOS code 0x%08x", W_ERROR_V(werror));
34 @@ -2702,6 +2706,7 @@ struct werror_str_struct {
37 const struct werror_str_struct dos_err_strs[] = {
39 { WERR_OK, "Success" },
40 { WERR_ACCESS_DENIED, "Access is denied" },
41 { WERR_INVALID_PARAM, "Invalid parameter" },
42 @@ -5324,6 +5329,7 @@ const struct werror_str_struct dos_err_s
43 { WERR_AMBIGUOUS_SYSTEM_DEVICE, "The requested system device cannot be identified due to multiple indistinguishable devices potentially matching the identification criteria." },
44 { WERR_SYSTEM_DEVICE_NOT_FOUND, "The requested system device cannot be found." },
45 /* END GENERATED-WIN32-ERROR-CODES-DESC */
50 @@ -5334,6 +5340,7 @@ const struct werror_str_struct dos_err_s
52 const char *get_friendly_werror_msg(WERROR werror)
57 for (i = 0; i < ARRAY_SIZE(dos_err_strs); i++) {
58 @@ -5342,6 +5349,7 @@ const char *get_friendly_werror_msg(WERR
59 return dos_err_strs[i].friendly_errstr;
64 return win_errstr(werror);
66 --- a/librpc/ndr/libndr.h
67 +++ b/librpc/ndr/libndr.h
68 @@ -598,4 +598,20 @@ _PUBLIC_ enum ndr_err_code ndr_push_enum
70 _PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b);
72 +#ifndef VERBOSE_ERROR
73 +#define ndr_print_bool(...) do {} while (0)
74 +#define ndr_print_struct(...) do {} while (0)
75 +#define ndr_print_null(...) do {} while (0)
76 +#define ndr_print_enum(...) do {} while (0)
77 +#define ndr_print_bitmap_flag(...) do {} while (0)
78 +#define ndr_print_ptr(...) do {} while (0)
79 +#define ndr_print_union(...) do {} while (0)
80 +#define ndr_print_bad_level(...) do {} while (0)
81 +#define ndr_print_array_uint8(...) do {} while (0)
82 +#define ndr_print_string_array(...) do {} while (0)
83 +#define ndr_print_string_array(...) do {} while (0)
84 +#define ndr_print_NTSTATUS(...) do {} while (0)
85 +#define ndr_print_WERROR(...) do {} while (0)
88 #endif /* __LIBNDR_H__ */
89 --- a/librpc/ndr/ndr_basic.c
90 +++ b/librpc/ndr/ndr_basic.c
92 #define NDR_SIVAL(ndr, ofs, v) do { if (NDR_BE(ndr)) { RSIVAL(ndr->data,ofs,v); } else SIVAL(ndr->data,ofs,v); } while (0)
93 #define NDR_SIVALS(ndr, ofs, v) do { if (NDR_BE(ndr)) { RSIVALS(ndr->data,ofs,v); } else SIVALS(ndr->data,ofs,v); } while (0)
95 +#undef ndr_print_bool
96 +#undef ndr_print_struct
97 +#undef ndr_print_null
98 +#undef ndr_print_enum
99 +#undef ndr_print_bitmap_flag
100 +#undef ndr_print_ptr
101 +#undef ndr_print_union
102 +#undef ndr_print_bad_level
103 +#undef ndr_print_array_uint8
104 +#undef ndr_print_string_array
105 +#undef ndr_print_string_array
106 +#undef ndr_print_NTSTATUS
107 +#undef ndr_print_WERROR
110 check for data leaks from the server by looking for non-zero pad bytes
111 --- a/librpc/ndr/ndr_string.c
112 +++ b/librpc/ndr/ndr_string.c
113 @@ -588,6 +588,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_stri
114 return NDR_ERR_SUCCESS;
117 +#undef ndr_print_string_array
118 _PUBLIC_ void ndr_print_string_array(struct ndr_print *ndr, const char *name, const char **a)
121 --- a/librpc/rpc/dcerpc_error.c
122 +++ b/librpc/rpc/dcerpc_error.c
123 @@ -31,6 +31,7 @@ struct dcerpc_fault_table {
124 static const struct dcerpc_fault_table dcerpc_faults[] =
126 #define _FAULT_STR(x) { #x , x }
127 +#ifdef VERBOSE_ERROR
128 _FAULT_STR(DCERPC_NCA_S_COMM_FAILURE),
129 _FAULT_STR(DCERPC_NCA_S_OP_RNG_ERROR),
130 _FAULT_STR(DCERPC_NCA_S_UNKNOWN_IF),
131 @@ -78,6 +79,7 @@ static const struct dcerpc_fault_table d
132 _FAULT_STR(DCERPC_NCA_S_FAULT_CODESET_CONV_ERROR),
133 _FAULT_STR(DCERPC_NCA_S_FAULT_OBJECT_NOT_FOUND),
134 _FAULT_STR(DCERPC_NCA_S_FAULT_NO_CLIENT_STUB),
139 @@ -87,12 +89,14 @@ _PUBLIC_ const char *dcerpc_errstr(TALLO
141 WERROR werr = W_ERROR(fault_code);
143 +#ifdef VERBOSE_ERROR
144 while (dcerpc_faults[idx].errstr != NULL) {
145 if (dcerpc_faults[idx].faultcode == fault_code) {
146 return dcerpc_faults[idx].errstr;
152 return win_errstr(werr);
154 --- a/source3/libsmb/nterr.c
155 +++ b/source3/libsmb/nterr.c
156 @@ -702,6 +702,7 @@ const char *nt_errstr(NTSTATUS nt_code)
157 NT_STATUS_DOS_CODE(nt_code));
160 +#ifdef VERBOSE_ERROR
161 while (nt_errs[idx].nt_errstr != NULL) {
162 if (NT_STATUS_V(nt_errs[idx].nt_errcode) ==
163 NT_STATUS_V(nt_code)) {
164 @@ -709,6 +710,7 @@ const char *nt_errstr(NTSTATUS nt_code)
170 result = talloc_asprintf(talloc_tos(), "NT code 0x%08x",
171 NT_STATUS_V(nt_code));
172 @@ -724,12 +726,14 @@ const char *get_friendly_nt_error_msg(NT
176 +#ifdef VERBOSE_ERROR
177 while (nt_err_desc[idx].nt_errstr != NULL) {
178 if (NT_STATUS_V(nt_err_desc[idx].nt_errcode) == NT_STATUS_V(nt_code)) {
179 return nt_err_desc[idx].nt_errstr;
185 /* fall back to NT_STATUS_XXX string */
187 @@ -745,6 +749,7 @@ const char *get_nt_error_c_code(NTSTATUS
191 +#ifdef VERBOSE_ERROR
192 while (nt_errs[idx].nt_errstr != NULL) {
193 if (NT_STATUS_V(nt_errs[idx].nt_errcode) ==
194 NT_STATUS_V(nt_code)) {
195 @@ -752,6 +757,7 @@ const char *get_nt_error_c_code(NTSTATUS
201 result = talloc_asprintf(talloc_tos(), "NT_STATUS(0x%08x)",
202 NT_STATUS_V(nt_code));
203 @@ -767,12 +773,14 @@ NTSTATUS nt_status_string_to_code(const
207 +#ifdef VERBOSE_ERROR
208 while (nt_errs[idx].nt_errstr != NULL) {
209 if (strcasecmp(nt_errs[idx].nt_errstr, nt_status_str) == 0) {
210 return nt_errs[idx].nt_errcode;
215 return NT_STATUS_UNSUCCESSFUL;
218 --- a/lib/tdb/common/tdb_private.h
219 +++ b/lib/tdb/common/tdb_private.h
220 @@ -69,7 +69,11 @@ typedef uint32_t tdb_off_t;
221 /* NB assumes there is a local variable called "tdb" that is the
222 * current context, also takes doubly-parenthesized print-style
224 +#ifdef VERBOSE_DEBUG
225 #define TDB_LOG(x) tdb->log.log_fn x
227 +#define TDB_LOG(x) do {} while(0)
231 void tdb_trace(struct tdb_context *tdb, const char *op);
232 --- a/source3/script/mkbuildoptions.awk
233 +++ b/source3/script/mkbuildoptions.awk
234 @@ -55,7 +55,7 @@ BEGIN {
235 print "****************************************************************************/";
236 print "void build_options(bool screen)";
238 - print " if ((DEBUGLEVEL < 4) && (!screen)) {";
239 + print " if ((DEBUGLEVEL < 4) || (!screen)) {";
243 --- a/source3/script/mkbuildoptions-waf.awk
244 +++ b/source3/script/mkbuildoptions-waf.awk
245 @@ -55,7 +55,7 @@ BEGIN {
246 print "****************************************************************************/";
247 print "void build_options(bool screen)";
249 - print " if ((DEBUGLEVEL < 4) && (!screen)) {";
250 + print " if ((DEBUGLEVEL < 4) || (!screen)) {";