1 --- a/source3/librpc/rpc/rpc_common.c
2 +++ b/source3/librpc/rpc/rpc_common.c
3 @@ -95,9 +95,11 @@ static bool initialize_interfaces(void)
4 if (!smb_register_ndr_interface(&ndr_table_lsarpc)) {
7 +#ifdef ACTIVE_DIRECTORY
8 if (!smb_register_ndr_interface(&ndr_table_dssetup)) {
12 if (!smb_register_ndr_interface(&ndr_table_samr)) {
15 @@ -141,9 +143,11 @@ static bool initialize_interfaces(void)
16 if (!smb_register_ndr_interface(&ndr_table_epmapper)) {
19 +#ifdef ACTIVE_DIRECTORY
20 if (!smb_register_ndr_interface(&ndr_table_drsuapi)) {
27 --- a/source3/rpc_server/rpc_ep_setup.c
28 +++ b/source3/rpc_server/rpc_ep_setup.c
29 @@ -918,6 +918,7 @@ static bool netdfs_init_cb(void *ptr)
33 +#ifdef ACTIVE_DIRECTORY
34 static bool dssetup_init_cb(void *ptr)
36 struct dcesrv_ep_context *ep_ctx =
37 @@ -966,6 +967,7 @@ static bool dssetup_init_cb(void *ptr)
43 static bool wkssvc_init_cb(void *ptr)
45 @@ -1172,12 +1174,14 @@ bool dcesrv_ep_setup(struct tevent_conte
49 +#ifdef ACTIVE_DIRECTORY
50 dssetup_cb.init = dssetup_init_cb;
51 dssetup_cb.shutdown = NULL;
52 dssetup_cb.private_data = ep_ctx;
53 if (!NT_STATUS_IS_OK(rpc_dssetup_init(&dssetup_cb))) {
58 wkssvc_cb.init = wkssvc_init_cb;
59 wkssvc_cb.shutdown = NULL;
60 --- a/source3/smbd/server_exit.c
61 +++ b/source3/smbd/server_exit.c
62 @@ -132,7 +132,9 @@ static void exit_server_common(enum serv
65 rpc_wkssvc_shutdown();
66 +#ifdef ACTIVE_DIRECTORY
67 rpc_dssetup_shutdown();
70 rpc_rpcecho_shutdown();
72 --- a/source3/rpc_client/cli_pipe.c
73 +++ b/source3/rpc_client/cli_pipe.c
74 @@ -2904,12 +2904,14 @@ NTSTATUS cli_rpc_pipe_open_noauth_transp
75 status = rpc_pipe_bind(result, auth);
76 if (!NT_STATUS_IS_OK(status)) {
78 +#ifdef ACTIVE_DIRECTORY
79 if (ndr_syntax_id_equal(interface,
80 &ndr_table_dssetup.syntax_id)) {
81 /* non AD domains just don't have this pipe, avoid
82 * level 0 statement in that case - gd */
86 DEBUG(lvl, ("cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe "
87 "%s failed with error %s\n",
88 get_pipe_name_from_syntax(talloc_tos(), interface),