dsdb: Ensure a build --without-json-audit --without-ad-dc compiles
authorAndrew Bartlett <abartlet@samba.org>
Thu, 21 Jun 2018 17:18:52 +0000 (05:18 +1200)
committerRalph Boehme <slow@samba.org>
Mon, 25 Jun 2018 21:01:20 +0000 (23:01 +0200)
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 <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/dsdb/samdb/ldb_modules/audit_log.c
source4/dsdb/samdb/ldb_modules/audit_util.c
source4/dsdb/samdb/ldb_modules/group_audit.c
source4/dsdb/samdb/ldb_modules/wscript_build
source4/dsdb/samdb/ldb_modules/wscript_build_server

index 80914cb8350b58821ec24710d4645ced0156147b..fc2eb50236142bf5d753333c03ad2f399c2890f6 100644 (file)
@@ -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"
index be2c522ace752cef772c2e7c6f3f39e6aaaf42d4..766c34c1e23c003df29c7b1a62f429ad0aff815b 100644 (file)
@@ -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
 
index dc58677773647a673426bdb340490e5319bfb5a0..bbd124af156c19ee1438cedf24f1756b1bac5493 100644 (file)
@@ -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"
index 1216a1fd99fcfbaaf813dde468bcd4bbcc0cf298..9e0ac281cc6b28c370415255d9145abfe11331c5 100644 (file)
@@ -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")
index e5c503239dfd99a76184e7399c68c10fad6b27d7..39c9477db80fce6cce0dbfa160a688d97c9929fc 100644 (file)
@@ -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
         '''
        )