[PATCH] Fix the build of recent dsdb changes

Günther Deschner gd at samba.org
Tue Jun 12 10:56:51 UTC 2018


Hi,

dsdb currently does not compile:

../source4/dsdb/samdb/ldb_modules/audit_util.c: In function
‘dsdb_audit_add_ldb_value’:
../source4/dsdb/samdb/ldb_modules/audit_util.c:484:2: error: ISO C90
forbids mixed declarations and code [-Werror=declaration-after-statement]

Please review and push.

Thanks,
Guenther

-- 
Günther Deschner                    GPG-ID: 8EE11688
Red Hat                         gdeschner at redhat.com
Samba Team                              gd at samba.org
-------------- next part --------------
From 28b33aafd7220506f1961ce6818b98199acd37a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Tue, 12 Jun 2018 12:54:15 +0200
Subject: [PATCH] s4-dsdb: fix the build of audit_util.c

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
---
 source4/dsdb/samdb/ldb_modules/audit_util.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source4/dsdb/samdb/ldb_modules/audit_util.c b/source4/dsdb/samdb/ldb_modules/audit_util.c
index e36ddcb90eb..7816f92877c 100644
--- a/source4/dsdb/samdb/ldb_modules/audit_util.c
+++ b/source4/dsdb/samdb/ldb_modules/audit_util.c
@@ -470,6 +470,9 @@ static void dsdb_audit_add_ldb_value(
 	struct json_object *array,
 	const struct ldb_val lv)
 {
+	bool base64 = ldb_should_b64_encode(NULL, &lv);
+	int len = min(lv.length, MAX_LENGTH);
+	struct json_object value = json_new_object();
 
 	json_assert_is_array(array);
 	if (json_is_invalid(array)) {
@@ -481,9 +484,6 @@ static void dsdb_audit_add_ldb_value(
 		return;
 	}
 
-	bool base64 = ldb_should_b64_encode(NULL, &lv);
-	int len = min(lv.length, MAX_LENGTH);
-	struct json_object value = json_new_object();
 	if (lv.length > MAX_LENGTH) {
 		json_add_bool(&value, "truncated", true);
 	}
-- 
2.17.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180612/46776fd6/signature.sig>


More information about the samba-technical mailing list