From 6b9a9a4d08f32ed12655aa930a2a9457d9ece3c3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 22 Jun 2018 05:18:52 +1200 Subject: [PATCH] dsdb: Ensure a build --without-json-audit --without-ad-dc compiles We still build some of the ldb_modules even when we are not a DC, so we must split up the DSDB_MODULE_HELPERS. Signed-off-by: Andrew Bartlett Reviewed-by: Ralph Boehme --- source4/dsdb/samdb/ldb_modules/audit_log.c | 1 + source4/dsdb/samdb/ldb_modules/audit_util.c | 1 + source4/dsdb/samdb/ldb_modules/group_audit.c | 1 + source4/dsdb/samdb/ldb_modules/wscript_build | 46 +----------------- .../dsdb/samdb/ldb_modules/wscript_build_server | 55 +++++++++++++++++++++- 5 files changed, 58 insertions(+), 46 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/audit_log.c b/source4/dsdb/samdb/ldb_modules/audit_log.c index 80914cb8350..fc2eb502361 100644 --- a/source4/dsdb/samdb/ldb_modules/audit_log.c +++ b/source4/dsdb/samdb/ldb_modules/audit_log.c @@ -29,6 +29,7 @@ #include "dsdb/samdb/samdb.h" #include "dsdb/samdb/ldb_modules/util.h" +#include "dsdb/samdb/ldb_modules/audit_util_proto.h" #include "libcli/security/dom_sid.h" #include "auth/common_auth.h" #include "param/param.h" diff --git a/source4/dsdb/samdb/ldb_modules/audit_util.c b/source4/dsdb/samdb/ldb_modules/audit_util.c index be2c522ace7..766c34c1e23 100644 --- a/source4/dsdb/samdb/ldb_modules/audit_util.c +++ b/source4/dsdb/samdb/ldb_modules/audit_util.c @@ -33,6 +33,7 @@ #include "auth/common_auth.h" #include "param/param.h" #include "dsdb/samdb/ldb_modules/util.h" +#include "dsdb/samdb/ldb_modules/audit_util_proto.h" #define MAX_LENGTH 1024 diff --git a/source4/dsdb/samdb/ldb_modules/group_audit.c b/source4/dsdb/samdb/ldb_modules/group_audit.c index dc586777736..bbd124af156 100644 --- a/source4/dsdb/samdb/ldb_modules/group_audit.c +++ b/source4/dsdb/samdb/ldb_modules/group_audit.c @@ -28,6 +28,7 @@ #include "dsdb/samdb/samdb.h" #include "dsdb/samdb/ldb_modules/util.h" +#include "dsdb/samdb/ldb_modules/audit_util_proto.h" #include "libcli/security/dom_sid.h" #include "auth/common_auth.h" #include "param/param.h" diff --git a/source4/dsdb/samdb/ldb_modules/wscript_build b/source4/dsdb/samdb/ldb_modules/wscript_build index 1216a1fd99f..9e0ac281cc6 100644 --- a/source4/dsdb/samdb/ldb_modules/wscript_build +++ b/source4/dsdb/samdb/ldb_modules/wscript_build @@ -7,9 +7,9 @@ bld.SAMBA_LIBRARY('dsdb-module', grouping_library=True) bld.SAMBA_SUBSYSTEM('DSDB_MODULE_HELPERS', - source='util.c acl_util.c schema_util.c netlogon.c audit_util.c', + source='util.c acl_util.c schema_util.c netlogon.c', autoproto='util_proto.h', - deps='ldb ndr samdb-common samba-security audit_logging' + deps='ldb ndr samdb-common samba-security' ) bld.SAMBA_SUBSYSTEM('DSDB_MODULE_HELPER_RIDALLOC', @@ -41,47 +41,5 @@ bld.SAMBA_BINARY('test_encrypted_secrets', ''', install=False) -# -# These tests require JANSSON, so we only build them if we are doing a selftest -# build. -# -if bld.CONFIG_GET('ENABLE_SELFTEST'): - bld.SAMBA_BINARY('test_audit_util', - source='tests/test_audit_util.c', - deps=''' - talloc - samba-util - samdb-common - samdb - cmocka - audit_logging - DSDB_MODULE_HELPERS - ''', - install=False) - bld.SAMBA_BINARY('test_audit_log', - source='tests/test_audit_log.c', - deps=''' - talloc - samba-util - samdb-common - samdb - cmocka - audit_logging - DSDB_MODULE_HELPERS - ''', - install=False) - bld.SAMBA_BINARY('test_group_audit', - source='tests/test_group_audit.c', - deps=''' - talloc - samba-util - samdb-common - samdb - cmocka - audit_logging - DSDB_MODULE_HELPERS - ''', - install=False) - if bld.AD_DC_BUILD_IS_ENABLED(): bld.PROCESS_SEPARATE_RULE("server") diff --git a/source4/dsdb/samdb/ldb_modules/wscript_build_server b/source4/dsdb/samdb/ldb_modules/wscript_build_server index e5c503239df..39c9477db80 100644 --- a/source4/dsdb/samdb/ldb_modules/wscript_build_server +++ b/source4/dsdb/samdb/ldb_modules/wscript_build_server @@ -1,5 +1,56 @@ #!/usr/bin/env python +bld.SAMBA_SUBSYSTEM('DSDB_MODULE_HELPERS_AUDIT', + source='audit_util.c', + autoproto='audit_util_proto.h', + deps='DSDB_MODULE_HELPERS audit_logging') + +# +# These tests require JANSSON, so we only build them if we are doing a +# build on the AD DC (where Jansson is required). +# + +bld.SAMBA_BINARY('test_audit_util', + source='tests/test_audit_util.c', + deps=''' + talloc + samba-util + samdb-common + samdb + cmocka + audit_logging + DSDB_MODULE_HELPERS + ''', + install=False) + +bld.SAMBA_BINARY('test_audit_log', + source='tests/test_audit_log.c', + deps=''' + talloc + samba-util + samdb-common + samdb + cmocka + audit_logging + DSDB_MODULE_HELPERS + DSDB_MODULE_HELPERS_AUDIT + ''', + install=False) + +bld.SAMBA_BINARY('test_group_audit', + source='tests/test_group_audit.c', + deps=''' + talloc + samba-util + samdb-common + samdb + cmocka + audit_logging + DSDB_MODULE_HELPERS + DSDB_MODULE_HELPERS_AUDIT + ''', + install=False) + bld.SAMBA_MODULE('ldb_samba_dsdb', source='samba_dsdb.c', subsystem='ldb', @@ -437,7 +488,7 @@ bld.SAMBA_MODULE('ldb_audit_log', talloc samba-util samdb-common - DSDB_MODULE_HELPERS + DSDB_MODULE_HELPERS_AUDIT samdb ''' ) @@ -453,7 +504,7 @@ bld.SAMBA_MODULE('ldb_group_audit_log', talloc samba-util samdb-common - DSDB_MODULE_HELPERS + DSDB_MODULE_HELPERS_AUDIT samdb ''' ) -- 2.11.4.GIT