summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-12-30 13:16:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:49:03 -0500
commitd4de4c2d210d2e8c9b5aedf70695594809ad6a0b (patch)
tree6e0764fa01f33ad8d178c62208bc085da60014db /source4
parentab8cd4470c392e04e458eed378b857db00e97f13 (diff)
downloadsamba-d4de4c2d210d2e8c9b5aedf70695594809ad6a0b.tar.gz
samba-d4de4c2d210d2e8c9b5aedf70695594809ad6a0b.tar.xz
samba-d4de4c2d210d2e8c9b5aedf70695594809ad6a0b.zip
r12608: Remove some unused #include lines.
(This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981)
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/auth_anonymous.c2
-rw-r--r--source4/auth/auth_developer.c2
-rw-r--r--source4/auth/auth_sam.c2
-rw-r--r--source4/auth/auth_sam_reply.c5
-rw-r--r--source4/auth/auth_unix.c2
-rw-r--r--source4/auth/auth_util.c3
-rw-r--r--source4/auth/auth_winbind.c1
-rw-r--r--source4/auth/credentials/credentials.c1
-rw-r--r--source4/auth/credentials/credentials_ntlm.c1
-rw-r--r--source4/auth/gensec/gensec_gssapi.c1
-rw-r--r--source4/auth/gensec/gensec_krb5.c2
-rw-r--r--source4/auth/gensec/schannel_state.c2
-rw-r--r--source4/auth/ntlm_check.c1
-rw-r--r--source4/auth/ntlmssp/ntlmssp.c1
-rw-r--r--source4/cldap_server/cldap_server.c1
-rw-r--r--source4/client/client.c2
-rw-r--r--source4/dsdb/samdb/cracknames.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/proxy.c1
-rw-r--r--source4/dsdb/samdb/ldb_modules/samba3sam.c1
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c2
-rw-r--r--source4/dsdb/samdb/samdb_privilege.c2
-rw-r--r--source4/gtk/tools/gepdump.c2
-rw-r--r--source4/gtk/tools/gregedit.c2
-rw-r--r--source4/gtk/tools/gwcrontab.c1
-rw-r--r--source4/gtk/tools/gwsam_user.c1
-rw-r--r--source4/ldap_server/ldap_backend.c1
-rw-r--r--source4/ldap_server/ldap_bind.c1
-rw-r--r--source4/ldap_server/ldap_simple_ldb.c3
-rw-r--r--source4/lib/cmdline/credentials.c3
-rw-r--r--source4/lib/cmdline/popt_common.c2
-rw-r--r--source4/lib/cmdline/popt_credentials.c3
-rw-r--r--source4/lib/com/dcom/main.c3
-rw-r--r--source4/lib/com/dcom/tables.c1
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c1
-rw-r--r--source4/lib/ldb/samba/ldif_handlers.c1
-rw-r--r--source4/lib/ldb/tools/ldbadd.c1
-rw-r--r--source4/lib/ldb/tools/ldbdel.c1
-rw-r--r--source4/lib/ldb/tools/ldbedit.c1
-rw-r--r--source4/lib/ldb/tools/ldbmodify.c1
-rw-r--r--source4/lib/ldb/tools/ldbrename.c1
-rw-r--r--source4/lib/ldb/tools/ldbsearch.c1
-rw-r--r--source4/lib/ldb/tools/ldbtest.c1
-rw-r--r--source4/lib/messaging/messaging.c3
-rw-r--r--source4/lib/registry/patchfile.c2
-rw-r--r--source4/lib/registry/tools/regdiff.c1
-rw-r--r--source4/lib/registry/tools/regpatch.c3
-rw-r--r--source4/lib/registry/tools/regshell.c2
-rw-r--r--source4/lib/registry/tools/regtree.c1
-rw-r--r--source4/lib/samba3/smbpasswd.c1
-rw-r--r--source4/lib/socket/connect.c1
-rw-r--r--source4/lib/socket/connect_multi.c1
-rw-r--r--source4/lib/socket/socket_ipv6.c1
-rw-r--r--source4/lib/system.c1
-rw-r--r--source4/lib/tls/tls.c1
-rw-r--r--source4/lib/unix_privs.c1
-rw-r--r--source4/lib/util.c1
-rw-r--r--source4/libcli/cldap/cldap.c1
-rw-r--r--source4/libcli/cliconnect.c1
-rw-r--r--source4/libcli/composite/composite.c1
-rw-r--r--source4/libcli/dgram/browse.c4
-rw-r--r--source4/libcli/dgram/dgramsocket.c1
-rw-r--r--source4/libcli/dgram/mailslot.c1
-rw-r--r--source4/libcli/dgram/netlogon.c5
-rw-r--r--source4/libcli/dgram/ntlogon.c5
-rw-r--r--source4/libcli/ldap/ldap_bind.c1
-rw-r--r--source4/libcli/ldap/ldap_client.c2
-rw-r--r--source4/libcli/ldap/ldap_ildap.c1
-rw-r--r--source4/libcli/ldap/ldap_msg.c1
-rw-r--r--source4/libcli/ldap/ldap_ndr.c1
-rw-r--r--source4/libcli/raw/clitransport.c1
-rw-r--r--source4/libcli/raw/clitree.c1
-rw-r--r--source4/libcli/raw/rawacl.c1
-rw-r--r--source4/libcli/raw/rawfile.c1
-rw-r--r--source4/libcli/raw/rawlpq.c1
-rw-r--r--source4/libcli/resolve/bcast.c3
-rw-r--r--source4/libcli/resolve/host.c2
-rw-r--r--source4/libcli/resolve/nbtlist.c2
-rw-r--r--source4/libcli/resolve/resolve.c2
-rw-r--r--source4/libcli/resolve/wins.c3
-rw-r--r--source4/libcli/security/access_check.c1
-rw-r--r--source4/libcli/security/dom_sid.c1
-rw-r--r--source4/libcli/security/privilege.c1
-rw-r--r--source4/libcli/security/sddl.c1
-rw-r--r--source4/libcli/security/security_descriptor.c1
-rw-r--r--source4/libcli/security/security_token.c1
-rw-r--r--source4/libcli/smb2/flush.c1
-rw-r--r--source4/libcli/smb2/ioctl.c1
-rw-r--r--source4/libcli/smb2/keepalive.c2
-rw-r--r--source4/libcli/smb2/logoff.c2
-rw-r--r--source4/libcli/smb2/read.c1
-rw-r--r--source4/libcli/smb2/request.c1
-rw-r--r--source4/libcli/smb2/tcon.c1
-rw-r--r--source4/libcli/smb2/tdis.c2
-rw-r--r--source4/libcli/smb2/write.c1
-rw-r--r--source4/libcli/smb_composite/appendacl.c1
-rw-r--r--source4/libcli/smb_composite/connect.c1
-rw-r--r--source4/libcli/smb_composite/fetchfile.c1
-rw-r--r--source4/libcli/smb_composite/fsinfo.c1
-rw-r--r--source4/libcli/smb_composite/loadfile.c1
-rw-r--r--source4/libcli/smb_composite/savefile.c1
-rw-r--r--source4/libcli/util/smbdes.c1
-rw-r--r--source4/libnet/domain.c1
-rw-r--r--source4/libnet/libnet_join.c3
-rw-r--r--source4/libnet/libnet_lookup.c3
-rw-r--r--source4/libnet/libnet_passwd.c1
-rw-r--r--source4/libnet/libnet_samdump.c2
-rw-r--r--source4/libnet/libnet_samdump_keytab.c3
-rw-r--r--source4/libnet/libnet_samsync_ldb.c4
-rw-r--r--source4/libnet/libnet_share.c1
-rw-r--r--source4/libnet/libnet_time.c1
-rw-r--r--source4/libnet/libnet_vampire.c2
-rw-r--r--source4/libnet/userinfo.c1
-rw-r--r--source4/libnet/userman.c1
-rw-r--r--source4/librpc/ndr/ndr_sec.c1
-rw-r--r--source4/librpc/ndr/ndr_sec_helper.c1
-rw-r--r--source4/librpc/ndr/ndr_string.c1
-rw-r--r--source4/librpc/rpc/dcerpc.c1
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c5
-rw-r--r--source4/librpc/rpc/dcerpc_schannel.c1
-rw-r--r--source4/librpc/rpc/dcerpc_smb.c1
-rw-r--r--source4/librpc/rpc/dcerpc_smb2.c1
-rw-r--r--source4/librpc/rpc/dcerpc_sock.c2
-rw-r--r--source4/librpc/rpc/dcerpc_util.c1
-rw-r--r--source4/nbt_server/dgram/browse.c3
-rw-r--r--source4/nbt_server/dgram/netlogon.c2
-rw-r--r--source4/nbt_server/dgram/ntlogon.c3
-rw-r--r--source4/nbt_server/dgram/request.c1
-rw-r--r--source4/nbt_server/nbt_server.c1
-rw-r--r--source4/nbt_server/packet.c1
-rw-r--r--source4/nbt_server/wins/winsdb.c1
-rw-r--r--source4/ntptr/ntptr_base.c1
-rw-r--r--source4/ntptr/simple_ldb/ntptr_simple_ldb.c1
-rw-r--r--source4/ntvfs/cifs/vfs_cifs.c2
-rw-r--r--source4/ntvfs/common/sidmap.c2
-rw-r--r--source4/ntvfs/ipc/vfs_ipc.c1
-rw-r--r--source4/ntvfs/unixuid/vfs_unixuid.c1
-rw-r--r--source4/param/loadparm.c3
-rw-r--r--source4/rpc_server/dcerpc_server.c2
-rw-r--r--source4/rpc_server/dcerpc_sock.c2
-rw-r--r--source4/rpc_server/drsuapi/dcesrv_drsuapi.c1
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c5
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c2
-rw-r--r--source4/rpc_server/samr/samr_password.c2
-rw-r--r--source4/scripting/ejs/smbcalls_options.c1
-rw-r--r--source4/smb_server/smb/nttrans.c1
-rw-r--r--source4/smb_server/smb/receive.c1
-rw-r--r--source4/smb_server/smb/reply.c1
-rw-r--r--source4/smb_server/smb/request.c2
-rw-r--r--source4/smb_server/smb/sesssetup.c1
-rw-r--r--source4/smb_server/smb2/fileio.c1
-rw-r--r--source4/smb_server/smb2/keepalive.c3
-rw-r--r--source4/smb_server/smb2/receive.c1
-rw-r--r--source4/smb_server/smb_server.c3
-rw-r--r--source4/smb_server/tcon.c1
-rw-r--r--source4/smbd/process_model.c1
-rw-r--r--source4/smbd/process_single.c3
-rw-r--r--source4/smbd/process_standard.c2
-rw-r--r--source4/smbd/service.c1
-rw-r--r--source4/torture/auth/pac.c1
-rw-r--r--source4/torture/basic/attr.c1
-rw-r--r--source4/torture/basic/charset.c1
-rw-r--r--source4/torture/basic/delete.c1
-rw-r--r--source4/torture/basic/denytest.c1
-rw-r--r--source4/torture/basic/dir.c1
-rw-r--r--source4/torture/basic/disconnect.c1
-rw-r--r--source4/torture/basic/rename.c1
-rw-r--r--source4/torture/basic/scanner.c1
-rw-r--r--source4/torture/basic/secleak.c1
-rw-r--r--source4/torture/basic/unlink.c1
-rw-r--r--source4/torture/basic/utable.c1
-rw-r--r--source4/torture/ldap/basic.c2
-rw-r--r--source4/torture/ldap/cldap.c2
-rw-r--r--source4/torture/ldap/common.c1
-rw-r--r--source4/torture/libnet/domain.c1
-rw-r--r--source4/torture/libnet/libnet_lookup.c2
-rw-r--r--source4/torture/libnet/libnet_rpc.c1
-rw-r--r--source4/torture/libnet/libnet_user.c2
-rw-r--r--source4/torture/libnet/userinfo.c1
-rw-r--r--source4/torture/libnet/userman.c1
-rw-r--r--source4/torture/local/messaging.c1
-rw-r--r--source4/torture/local/registry.c2
-rw-r--r--source4/torture/local/resolve.c1
-rw-r--r--source4/torture/local/sddl.c1
-rw-r--r--source4/torture/nbench/nbio.c1
-rw-r--r--source4/torture/nbt/dgram.c2
-rw-r--r--source4/torture/nbt/query.c2
-rw-r--r--source4/torture/nbt/register.c2
-rw-r--r--source4/torture/nbt/wins.c2
-rw-r--r--source4/torture/nbt/winsbench.c2
-rw-r--r--source4/torture/nbt/winsreplication.c2
-rw-r--r--source4/torture/raw/acls.c2
-rw-r--r--source4/torture/raw/chkpath.c1
-rw-r--r--source4/torture/raw/context.c1
-rw-r--r--source4/torture/raw/eas.c1
-rw-r--r--source4/torture/raw/mux.c1
-rw-r--r--source4/torture/raw/notify.c1
-rw-r--r--source4/torture/raw/qfileinfo.c1
-rw-r--r--source4/torture/raw/rename.c1
-rw-r--r--source4/torture/raw/streams.c1
-rw-r--r--source4/torture/raw/unlink.c1
-rw-r--r--source4/torture/rpc/dcom.c1
-rw-r--r--source4/torture/rpc/dssync.c4
-rw-r--r--source4/torture/rpc/epmapper.c1
-rw-r--r--source4/torture/rpc/join.c2
-rw-r--r--source4/torture/rpc/netlogon.c1
-rw-r--r--source4/torture/rpc/oxidresolve.c1
-rw-r--r--source4/torture/rpc/remact.c1
-rw-r--r--source4/torture/rpc/samsync.c1
-rw-r--r--source4/torture/rpc/schannel.c2
-rw-r--r--source4/torture/rpc/svcctl.c1
-rw-r--r--source4/torture/rpc/testjoin.c1
-rw-r--r--source4/torture/rpc/unixinfo.c1
-rw-r--r--source4/torture/smb2/connect.c3
-rw-r--r--source4/torture/smb2/find.c1
-rw-r--r--source4/torture/smb2/getinfo.c1
-rw-r--r--source4/torture/smb2/scan.c1
-rw-r--r--source4/torture/smb2/util.c1
-rw-r--r--source4/torture/torture.c3
-rw-r--r--source4/torture/torture_util.c1
-rw-r--r--source4/utils/net/net_join.c1
-rw-r--r--source4/utils/net/net_password.c1
-rw-r--r--source4/utils/net/net_user.c1
-rw-r--r--source4/utils/nmblookup.c1
-rw-r--r--source4/utils/ntlm_auth.c2
-rw-r--r--source4/utils/setntacl.c1
-rw-r--r--source4/utils/setnttoken.c1
-rw-r--r--source4/web_server/http.c2
-rw-r--r--source4/winbind/wb_async_helpers.c9
-rw-r--r--source4/winbind/wb_cmd_getdcname.c1
-rw-r--r--source4/winbind/wb_cmd_list_trustdom.c2
-rw-r--r--source4/winbind/wb_cmd_lookupname.c1
-rw-r--r--source4/winbind/wb_cmd_lookupsid.c1
-rw-r--r--source4/winbind/wb_cmd_userdomgroups.c3
-rw-r--r--source4/winbind/wb_cmd_usersids.c3
-rw-r--r--source4/winbind/wb_dom_info.c4
-rw-r--r--source4/winbind/wb_dom_info_trusted.c4
-rw-r--r--source4/winbind/wb_init_domain.c13
-rw-r--r--source4/winbind/wb_pam_auth.c2
-rw-r--r--source4/winbind/wb_samba3_cmd.c6
-rw-r--r--source4/winbind/wb_samba3_protocol.c2
-rw-r--r--source4/winbind/wb_server.c3
-rw-r--r--source4/winbind/wb_sid2domain.c4
-rw-r--r--source4/wrepl_server/wrepl_apply_records.c7
-rw-r--r--source4/wrepl_server/wrepl_in_call.c5
-rw-r--r--source4/wrepl_server/wrepl_in_connection.c4
-rw-r--r--source4/wrepl_server/wrepl_out_helpers.c4
-rw-r--r--source4/wrepl_server/wrepl_out_pull.c9
-rw-r--r--source4/wrepl_server/wrepl_out_push.c9
-rw-r--r--source4/wrepl_server/wrepl_periodic.c9
-rw-r--r--source4/wrepl_server/wrepl_scavenging.c10
-rw-r--r--source4/wrepl_server/wrepl_server.c3
251 files changed, 1 insertions, 463 deletions
diff --git a/source4/auth/auth_anonymous.c b/source4/auth/auth_anonymous.c
index 82aa69c72af..ce960062ebf 100644
--- a/source4/auth/auth_anonymous.c
+++ b/source4/auth/auth_anonymous.c
@@ -22,8 +22,6 @@
#include "includes.h"
#include "auth/auth.h"
-#include "librpc/gen_ndr/ndr_samr.h"
-#include "librpc/gen_ndr/ndr_security.h"
/**
* Return a anonymous logon for anonymous users (username = "")
diff --git a/source4/auth/auth_developer.c b/source4/auth/auth_developer.c
index a961d7efa14..14e005efc9e 100644
--- a/source4/auth/auth_developer.c
+++ b/source4/auth/auth_developer.c
@@ -22,8 +22,6 @@
#include "includes.h"
#include "auth/auth.h"
-#include "librpc/gen_ndr/ndr_samr.h"
-#include "librpc/gen_ndr/ndr_security.h"
/**
* Return an error based on username
diff --git a/source4/auth/auth_sam.c b/source4/auth/auth_sam.c
index a013a2051c3..2c41ff4df91 100644
--- a/source4/auth/auth_sam.c
+++ b/source4/auth/auth_sam.c
@@ -21,10 +21,8 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "system/time.h"
#include "auth/auth.h"
-#include "lib/ldb/include/ldb.h"
#include "dsdb/samdb/samdb.h"
#include "libcli/ldap/ldap.h"
diff --git a/source4/auth/auth_sam_reply.c b/source4/auth/auth_sam_reply.c
index 2918dfd4996..89b389aa836 100644
--- a/source4/auth/auth_sam_reply.c
+++ b/source4/auth/auth_sam_reply.c
@@ -22,12 +22,7 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "rpc_server/dcerpc_server.h"
-#include "rpc_server/common/common.h"
-#include "librpc/gen_ndr/ndr_dcom.h"
#include "auth/auth.h"
-#include "lib/ldb/include/ldb.h"
NTSTATUS auth_convert_server_info_sambaseinfo(TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info *server_info,
diff --git a/source4/auth/auth_unix.c b/source4/auth/auth_unix.c
index f49a92a35f9..c68aa159fc1 100644
--- a/source4/auth/auth_unix.c
+++ b/source4/auth/auth_unix.c
@@ -22,8 +22,6 @@
#include "includes.h"
#include "auth/auth.h"
-#include "system/passwd.h"
-#include "system/iconv.h"
/* TODO: look at how to best fill in parms retrieveing a struct passwd info
* except in case USER_INFO_DONT_CHECK_UNIX_ACCOUNT is set
diff --git a/source4/auth/auth_util.c b/source4/auth/auth_util.c
index dbedde91908..5660787ee88 100644
--- a/source4/auth/auth_util.c
+++ b/source4/auth/auth_util.c
@@ -23,9 +23,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_samr.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "auth/auth.h"
/* this default function can be used by mostly all backends
diff --git a/source4/auth/auth_winbind.c b/source4/auth/auth_winbind.c
index bda96029262..86854dfcec7 100644
--- a/source4/auth/auth_winbind.c
+++ b/source4/auth/auth_winbind.c
@@ -23,7 +23,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
#include "auth/auth.h"
#include "nsswitch/winbind_client.h"
diff --git a/source4/auth/credentials/credentials.c b/source4/auth/credentials/credentials.c
index 0ea2a01ea12..a6bfb15decc 100644
--- a/source4/auth/credentials/credentials.c
+++ b/source4/auth/credentials/credentials.c
@@ -23,7 +23,6 @@
*/
#include "includes.h"
-#include "lib/ldb/include/ldb.h"
#include "librpc/gen_ndr/ndr_samr.h" /* for struct samrPassword */
diff --git a/source4/auth/credentials/credentials_ntlm.c b/source4/auth/credentials/credentials_ntlm.c
index 9fd4c094738..c7932e6f1a9 100644
--- a/source4/auth/credentials/credentials_ntlm.c
+++ b/source4/auth/credentials/credentials_ntlm.c
@@ -23,7 +23,6 @@
*/
#include "includes.h"
-#include "lib/ldb/include/ldb.h"
#include "librpc/gen_ndr/ndr_samr.h" /* for struct samrPassword */
#include "lib/crypto/crypto.h"
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index 68da2567da6..b71bee03ea2 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "system/kerberos.h"
-#include "system/network.h"
#include "auth/kerberos/kerberos.h"
#include "librpc/gen_ndr/ndr_krb5pac.h"
#include "auth/auth.h"
diff --git a/source4/auth/gensec/gensec_krb5.c b/source4/auth/gensec/gensec_krb5.c
index c8640dde8c6..161690f6651 100644
--- a/source4/auth/gensec/gensec_krb5.c
+++ b/source4/auth/gensec/gensec_krb5.c
@@ -26,8 +26,6 @@
#include "includes.h"
#include "system/kerberos.h"
-#include "system/time.h"
-#include "system/network.h"
#include "auth/kerberos/kerberos.h"
#include "librpc/gen_ndr/ndr_krb5pac.h"
#include "auth/auth.h"
diff --git a/source4/auth/gensec/schannel_state.c b/source4/auth/gensec/schannel_state.c
index 43391b3a699..7ef64ca00b3 100644
--- a/source4/auth/gensec/schannel_state.c
+++ b/source4/auth/gensec/schannel_state.c
@@ -21,11 +21,9 @@
*/
#include "includes.h"
-#include "system/time.h"
#include "auth/auth.h"
#include "lib/ldb/include/ldb.h"
#include "lib/ldb/include/ldb_errors.h"
-#include "db_wrap.h"
#include "dsdb/samdb/samdb.h"
/*
diff --git a/source4/auth/ntlm_check.c b/source4/auth/ntlm_check.c
index 42748f05304..5a08cf5f09d 100644
--- a/source4/auth/ntlm_check.c
+++ b/source4/auth/ntlm_check.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "lib/crypto/crypto.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
/****************************************************************************
diff --git a/source4/auth/ntlmssp/ntlmssp.c b/source4/auth/ntlmssp/ntlmssp.c
index ef870af3bfd..e2fce5856de 100644
--- a/source4/auth/ntlmssp/ntlmssp.c
+++ b/source4/auth/ntlmssp/ntlmssp.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "auth/auth.h"
-#include "lib/crypto/crypto.h"
#include "auth/ntlmssp/ntlmssp.h"
/**
diff --git a/source4/cldap_server/cldap_server.c b/source4/cldap_server/cldap_server.c
index 31b59ebbe9c..e112d7a33ba 100644
--- a/source4/cldap_server/cldap_server.c
+++ b/source4/cldap_server/cldap_server.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "libcli/ldap/ldap.h"
-#include "lib/events/events.h"
#include "lib/socket/socket.h"
#include "lib/messaging/irpc.h"
#include "smbd/service_task.h"
diff --git a/source4/client/client.c b/source4/client/client.c
index dc3ea7df746..fef847e8b2e 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -28,8 +28,6 @@
#include "librpc/gen_ndr/ndr_srvsvc.h"
#include "librpc/gen_ndr/ndr_lsa.h"
#include "libcli/raw/libcliraw.h"
-#include "libcli/nbt/libnbt.h"
-#include "system/time.h"
#include "system/dir.h"
#include "system/filesys.h"
#include "dlinklist.h"
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index 6c9739f2450..9dd44e680b1 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -24,9 +24,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
-#include "rpc_server/drsuapi/dcesrv_drsuapi.h"
#include "rpc_server/common/common.h"
-#include "lib/ldb/include/ldb.h"
#include "lib/ldb/include/ldb_errors.h"
#include "system/kerberos.h"
#include "auth/kerberos/kerberos.h"
diff --git a/source4/dsdb/samdb/ldb_modules/proxy.c b/source4/dsdb/samdb/ldb_modules/proxy.c
index a567db689d3..fc1b896be47 100644
--- a/source4/dsdb/samdb/ldb_modules/proxy.c
+++ b/source4/dsdb/samdb/ldb_modules/proxy.c
@@ -41,7 +41,6 @@
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
#include "ldb/include/ldb_private.h"
-#include "lib/cmdline/popt_common.h"
struct proxy_data {
struct ldb_context *upstream;
diff --git a/source4/dsdb/samdb/ldb_modules/samba3sam.c b/source4/dsdb/samdb/ldb_modules/samba3sam.c
index 5e88cd64699..f2c4441f976 100644
--- a/source4/dsdb/samdb/ldb_modules/samba3sam.c
+++ b/source4/dsdb/samdb/ldb_modules/samba3sam.c
@@ -8,7 +8,6 @@
#include "ldb/modules/ldb_map.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_private.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "system/passwd.h"
/*
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 84ffcdd1bee..50ad2db38a5 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -36,8 +36,6 @@
#include "lib/ldb/include/ldb.h"
#include "lib/ldb/include/ldb_errors.h"
#include "lib/ldb/include/ldb_private.h"
-#include "system/time.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "dsdb/samdb/samdb.h"
#define SAM_ACCOUNT_NAME_BASE "$000000-000000000000"
diff --git a/source4/dsdb/samdb/samdb_privilege.c b/source4/dsdb/samdb/samdb_privilege.c
index ba29a8e96ed..33d53e56e87 100644
--- a/source4/dsdb/samdb/samdb_privilege.c
+++ b/source4/dsdb/samdb/samdb_privilege.c
@@ -21,8 +21,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/security.h"
-#include "lib/ldb/include/ldb.h"
#include "libcli/ldap/ldap.h"
#include "dsdb/samdb/samdb.h"
#include "auth/auth.h"
diff --git a/source4/gtk/tools/gepdump.c b/source4/gtk/tools/gepdump.c
index e43c79b9264..ea77b193852 100644
--- a/source4/gtk/tools/gepdump.c
+++ b/source4/gtk/tools/gepdump.c
@@ -22,9 +22,7 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_mgmt.h"
-#include "gtk/common/select.h"
#include "gtk/common/gtk-smb.h"
-#include "lib/cmdline/popt_common.h"
#include "auth/gensec/gensec.h"
#include "smb_build.h"
diff --git a/source4/gtk/tools/gregedit.c b/source4/gtk/tools/gregedit.c
index f98a366e9b6..8c243873ca4 100644
--- a/source4/gtk/tools/gregedit.c
+++ b/source4/gtk/tools/gregedit.c
@@ -21,8 +21,6 @@
#include "includes.h"
#include "lib/registry/registry.h"
-#include "lib/cmdline/popt_common.h"
-#include "gtk/common/select.h"
#include "gtk/common/gtk-smb.h"
#include "smb_build.h"
diff --git a/source4/gtk/tools/gwcrontab.c b/source4/gtk/tools/gwcrontab.c
index 391110c56d8..f294e843923 100644
--- a/source4/gtk/tools/gwcrontab.c
+++ b/source4/gtk/tools/gwcrontab.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_atsvc.h"
-#include "gtk/common/select.h"
#include "gtk/common/gtk-smb.h"
#include "smb_build.h"
diff --git a/source4/gtk/tools/gwsam_user.c b/source4/gtk/tools/gwsam_user.c
index fa29e63a032..ffd8ae28eb4 100644
--- a/source4/gtk/tools/gwsam_user.c
+++ b/source4/gtk/tools/gwsam_user.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "gtk/common/select.h"
#include "gtk/common/gtk-smb.h"
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c
index a1c08fcc99f..637ce7bd638 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "ldap_server/ldap_server.h"
#include "dlinklist.h"
-#include "libcli/ldap/ldap.h"
struct ldapsrv_reply *ldapsrv_init_reply(struct ldapsrv_call *call, uint8_t type)
diff --git a/source4/ldap_server/ldap_bind.c b/source4/ldap_server/ldap_bind.c
index badd4ec541b..beaf3da46cb 100644
--- a/source4/ldap_server/ldap_bind.c
+++ b/source4/ldap_server/ldap_bind.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "ldap_server/ldap_server.h"
#include "auth/auth.h"
-#include "libcli/ldap/ldap.h"
#include "smbd/service_stream.h"
#include "dsdb/samdb/samdb.h"
diff --git a/source4/ldap_server/ldap_simple_ldb.c b/source4/ldap_server/ldap_simple_ldb.c
index 806266b7a5b..6fd60209889 100644
--- a/source4/ldap_server/ldap_simple_ldb.c
+++ b/source4/ldap_server/ldap_simple_ldb.c
@@ -21,10 +21,7 @@
#include "includes.h"
#include "ldap_server/ldap_server.h"
-#include "lib/ldb/include/ldb.h"
#include "lib/ldb/include/ldb_errors.h"
-#include "auth/auth.h"
-#include "db_wrap.h"
#include "dsdb/samdb/samdb.h"
#define VALID_DN_SYNTAX(dn,i) do {\
diff --git a/source4/lib/cmdline/credentials.c b/source4/lib/cmdline/credentials.c
index cb1ba5c963d..b19cbf73c0b 100644
--- a/source4/lib/cmdline/credentials.c
+++ b/source4/lib/cmdline/credentials.c
@@ -19,10 +19,7 @@
*/
#include "includes.h"
-#include "version.h"
#include "system/filesys.h"
-#include "system/passwd.h"
-#include "lib/cmdline/popt_common.h"
static const char *cmdline_get_userpassword(struct cli_credentials *credentials)
{
diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c
index b8c5b5b9d31..f31408b5ada 100644
--- a/source4/lib/cmdline/popt_common.c
+++ b/source4/lib/cmdline/popt_common.c
@@ -22,8 +22,6 @@
#include "includes.h"
#include "version.h"
-#include "system/filesys.h"
-#include "system/passwd.h"
#include "lib/cmdline/popt_common.h"
/* Handle command line options:
diff --git a/source4/lib/cmdline/popt_credentials.c b/source4/lib/cmdline/popt_credentials.c
index a974d808e34..49916d0ff34 100644
--- a/source4/lib/cmdline/popt_credentials.c
+++ b/source4/lib/cmdline/popt_credentials.c
@@ -20,9 +20,6 @@
*/
#include "includes.h"
-#include "version.h"
-#include "system/filesys.h"
-#include "system/passwd.h"
#include "lib/cmdline/popt_common.h"
/* Handle command line options:
diff --git a/source4/lib/com/dcom/main.c b/source4/lib/com/dcom/main.c
index bfa41f9ef6d..9c18756da69 100644
--- a/source4/lib/com/dcom/main.c
+++ b/source4/lib/com/dcom/main.c
@@ -20,11 +20,8 @@
#include "includes.h"
#include "system/filesys.h"
-#include "dlinklist.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_remact.h"
-#include "librpc/gen_ndr/ndr_oxidresolver.h"
-#include "librpc/gen_ndr/ndr_dcom.h"
#include "librpc/gen_ndr/com_dcom.h"
#include "lib/com/dcom/dcom.h"
diff --git a/source4/lib/com/dcom/tables.c b/source4/lib/com/dcom/tables.c
index a824413b34f..ce4f672d37a 100644
--- a/source4/lib/com/dcom/tables.c
+++ b/source4/lib/com/dcom/tables.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "system/filesys.h"
#include "dlinklist.h"
#include "librpc/gen_ndr/com_dcom.h"
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c b/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
index 3a18f5df88d..c2e65cf8257 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "ldb/include/ldb.h"
-#include "ldb/include/ldb_private.h"
#include "ldb/ldb_tdb/ldb_tdb.h"
/*
diff --git a/source4/lib/ldb/samba/ldif_handlers.c b/source4/lib/ldb/samba/ldif_handlers.c
index 84270195dc9..51cb3f8d78f 100644
--- a/source4/lib/ldb/samba/ldif_handlers.c
+++ b/source4/lib/ldb/samba/ldif_handlers.c
@@ -25,7 +25,6 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_private.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "dsdb/samdb/samdb.h"
diff --git a/source4/lib/ldb/tools/ldbadd.c b/source4/lib/ldb/tools/ldbadd.c
index 058f4dc751b..c22cfde4ece 100644
--- a/source4/lib/ldb/tools/ldbadd.c
+++ b/source4/lib/ldb/tools/ldbadd.c
@@ -35,7 +35,6 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
-#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbdel.c b/source4/lib/ldb/tools/ldbdel.c
index 6da8d0269f9..a6574a50885 100644
--- a/source4/lib/ldb/tools/ldbdel.c
+++ b/source4/lib/ldb/tools/ldbdel.c
@@ -35,7 +35,6 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
-#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbedit.c b/source4/lib/ldb/tools/ldbedit.c
index 4d47cf27c9f..8818777ceb2 100644
--- a/source4/lib/ldb/tools/ldbedit.c
+++ b/source4/lib/ldb/tools/ldbedit.c
@@ -35,7 +35,6 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
-#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbmodify.c b/source4/lib/ldb/tools/ldbmodify.c
index 4c78e485b5e..f067aef3f8c 100644
--- a/source4/lib/ldb/tools/ldbmodify.c
+++ b/source4/lib/ldb/tools/ldbmodify.c
@@ -34,7 +34,6 @@
#include "includes.h"
#include "ldb/include/ldb.h"
-#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbrename.c b/source4/lib/ldb/tools/ldbrename.c
index 4b3b27c1300..f225246cc78 100644
--- a/source4/lib/ldb/tools/ldbrename.c
+++ b/source4/lib/ldb/tools/ldbrename.c
@@ -36,7 +36,6 @@
#include "includes.h"
#include "ldb/include/ldb.h"
-#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c
index f8c06f0fa4a..c493356405a 100644
--- a/source4/lib/ldb/tools/ldbsearch.c
+++ b/source4/lib/ldb/tools/ldbsearch.c
@@ -35,7 +35,6 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
-#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbtest.c b/source4/lib/ldb/tools/ldbtest.c
index 7abc1bfcef1..f79f5c6b4c9 100644
--- a/source4/lib/ldb/tools/ldbtest.c
+++ b/source4/lib/ldb/tools/ldbtest.c
@@ -35,7 +35,6 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
-#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
index e3ad8e7e257..c7cce9c133e 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -22,16 +22,13 @@
#include "includes.h"
#include "lib/events/events.h"
-#include "system/dir.h"
#include "system/filesys.h"
-#include "system/time.h"
#include "messages.h"
#include "dlinklist.h"
#include "lib/socket/socket.h"
#include "librpc/gen_ndr/ndr_irpc.h"
#include "lib/messaging/irpc.h"
#include "db_wrap.h"
-#include "lib/tdb/include/tdb.h"
#include "lib/tdb/include/tdbutil.h"
/* change the message version with any incompatible changes in the protocol */
diff --git a/source4/lib/registry/patchfile.c b/source4/lib/registry/patchfile.c
index 21c9c26b216..e498c296ae3 100644
--- a/source4/lib/registry/patchfile.c
+++ b/source4/lib/registry/patchfile.c
@@ -20,9 +20,7 @@
*/
#include "includes.h"
-#include "dynconfig.h"
#include "lib/registry/registry.h"
-#include "lib/cmdline/popt_common.h"
#include "system/filesys.h"
#define DEFAULT_IDENT_STRING "SAMBA4 REGISTRY"
diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c
index 3720298df8e..68cc56f9dd3 100644
--- a/source4/lib/registry/tools/regdiff.c
+++ b/source4/lib/registry/tools/regdiff.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "dynconfig.h"
#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
#include "smb_build.h"
diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c
index 2cc1507b3e3..b8b88054863 100644
--- a/source4/lib/registry/tools/regpatch.c
+++ b/source4/lib/registry/tools/regpatch.c
@@ -20,11 +20,8 @@
*/
#include "includes.h"
-#include "dynconfig.h"
#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
-#include "system/filesys.h"
-#include "librpc/gen_ndr/winreg.h"
#include "smb_build.h"
int main(int argc, char **argv)
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index 52bda8aa423..c858b37f4a1 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -20,11 +20,9 @@
*/
#include "includes.h"
-#include "dynconfig.h"
#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
#include "system/time.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "smb_build.h"
/*
diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c
index 01e4f92f4a6..9a9121379b9 100644
--- a/source4/lib/registry/tools/regtree.c
+++ b/source4/lib/registry/tools/regtree.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "dynconfig.h"
#include "lib/registry/registry.h"
#include "lib/cmdline/popt_common.h"
#include "smb_build.h"
diff --git a/source4/lib/samba3/smbpasswd.c b/source4/lib/samba3/smbpasswd.c
index 483fbcfe05e..e6c52966d98 100644
--- a/source4/lib/samba3/smbpasswd.c
+++ b/source4/lib/samba3/smbpasswd.c
@@ -54,7 +54,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "lib/samba3/samba3.h"
#include "system/iconv.h"
diff --git a/source4/lib/socket/connect.c b/source4/lib/socket/connect.c
index 4dc10530215..dd3a6047a68 100644
--- a/source4/lib/socket/connect.c
+++ b/source4/lib/socket/connect.c
@@ -25,7 +25,6 @@
#include "includes.h"
#include "lib/socket/socket.h"
#include "lib/events/events.h"
-#include "librpc/gen_ndr/nbt.h"
#include "libcli/composite/composite.h"
diff --git a/source4/lib/socket/connect_multi.c b/source4/lib/socket/connect_multi.c
index 258560cec57..6a90ef9a05b 100644
--- a/source4/lib/socket/connect_multi.c
+++ b/source4/lib/socket/connect_multi.c
@@ -26,7 +26,6 @@
#include "lib/socket/socket.h"
#include "lib/events/events.h"
#include "libcli/composite/composite.h"
-#include "librpc/gen_ndr/nbt.h"
#define MULTI_PORT_DELAY 2000 /* microseconds */
diff --git a/source4/lib/socket/socket_ipv6.c b/source4/lib/socket/socket_ipv6.c
index ee3e1183495..bc47d4f554b 100644
--- a/source4/lib/socket/socket_ipv6.c
+++ b/source4/lib/socket/socket_ipv6.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "lib/socket/socket.h"
#include "system/network.h"
-#include "system/filesys.h"
static struct in6_addr interpret_addr6(const char *name)
{
diff --git a/source4/lib/system.c b/source4/lib/system.c
index 629b2b07ffb..07afa904ca9 100644
--- a/source4/lib/system.c
+++ b/source4/lib/system.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "system/network.h"
-#include "system/wait.h"
#include "system/filesys.h"
/*
diff --git a/source4/lib/tls/tls.c b/source4/lib/tls/tls.c
index 12087639c1d..bbb7fde9f35 100644
--- a/source4/lib/tls/tls.c
+++ b/source4/lib/tls/tls.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "lib/events/events.h"
#include "lib/socket/socket.h"
-#include "lib/tls/tls.h"
#if HAVE_LIBGNUTLS
#include "gnutls/gnutls.h"
diff --git a/source4/lib/unix_privs.c b/source4/lib/unix_privs.c
index 2ea4d1b2a0b..3c0f3197767 100644
--- a/source4/lib/unix_privs.c
+++ b/source4/lib/unix_privs.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "system/filesys.h"
-#include "system/passwd.h"
/*
there are times when smbd needs to temporarily gain root privileges
diff --git a/source4/lib/util.c b/source4/lib/util.c
index 3443d137d69..ed384572fe6 100644
--- a/source4/lib/util.c
+++ b/source4/lib/util.c
@@ -26,7 +26,6 @@
#include "dynconfig.h"
#include "system/network.h"
#include "system/iconv.h"
-#include "system/dir.h"
#include "system/filesys.h"
/***************************************************************************
diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c
index 07744553c80..d406b50baf3 100644
--- a/source4/libcli/cldap/cldap.c
+++ b/source4/libcli/cldap/cldap.c
@@ -38,7 +38,6 @@
#include "libcli/ldap/ldap.h"
#include "libcli/cldap/cldap.h"
#include "lib/socket/socket.h"
-#include "include/asn_1.h"
/*
destroy a pending request
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c
index c344ece3858..220b5a3898e 100644
--- a/source4/libcli/cliconnect.c
+++ b/source4/libcli/cliconnect.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
-#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
/*
diff --git a/source4/libcli/composite/composite.c b/source4/libcli/composite/composite.c
index c9cc20e9235..33b5b77c062 100644
--- a/source4/libcli/composite/composite.c
+++ b/source4/libcli/composite/composite.c
@@ -26,7 +26,6 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
#include "lib/messaging/irpc.h"
-#include "libcli/nbt/libnbt.h"
/*
block until a composite function has completed, then return the status
diff --git a/source4/libcli/dgram/browse.c b/source4/libcli/dgram/browse.c
index d6813b36b9b..821bf9d8150 100644
--- a/source4/libcli/dgram/browse.c
+++ b/source4/libcli/dgram/browse.c
@@ -22,11 +22,7 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
-#include "libcli/nbt/libnbt.h"
#include "libcli/dgram/libdgram.h"
-#include "lib/socket/socket.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
NTSTATUS dgram_mailslot_browse_send(struct nbt_dgram_socket *dgmsock,
struct nbt_name *dest_name, const struct nbt_peer_socket *dest,
diff --git a/source4/libcli/dgram/dgramsocket.c b/source4/libcli/dgram/dgramsocket.c
index 6c6a45f48e4..143b9c309b5 100644
--- a/source4/libcli/dgram/dgramsocket.c
+++ b/source4/libcli/dgram/dgramsocket.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "lib/events/events.h"
#include "dlinklist.h"
-#include "libcli/nbt/libnbt.h"
#include "libcli/dgram/libdgram.h"
#include "lib/socket/socket.h"
diff --git a/source4/libcli/dgram/mailslot.c b/source4/libcli/dgram/mailslot.c
index d5214844223..0e6b99c3e3b 100644
--- a/source4/libcli/dgram/mailslot.c
+++ b/source4/libcli/dgram/mailslot.c
@@ -35,7 +35,6 @@
#include "includes.h"
#include "lib/events/events.h"
#include "dlinklist.h"
-#include "libcli/nbt/libnbt.h"
#include "libcli/dgram/libdgram.h"
#include "lib/socket/socket.h"
diff --git a/source4/libcli/dgram/netlogon.c b/source4/libcli/dgram/netlogon.c
index 0627fe900cd..dffeae2007b 100644
--- a/source4/libcli/dgram/netlogon.c
+++ b/source4/libcli/dgram/netlogon.c
@@ -21,12 +21,7 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
-#include "dlinklist.h"
-#include "libcli/nbt/libnbt.h"
#include "libcli/dgram/libdgram.h"
-#include "lib/socket/socket.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
/*
send a netlogon mailslot request
diff --git a/source4/libcli/dgram/ntlogon.c b/source4/libcli/dgram/ntlogon.c
index 2bdce6f8537..3205416cea3 100644
--- a/source4/libcli/dgram/ntlogon.c
+++ b/source4/libcli/dgram/ntlogon.c
@@ -21,12 +21,7 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
-#include "dlinklist.h"
-#include "libcli/nbt/libnbt.h"
#include "libcli/dgram/libdgram.h"
-#include "lib/socket/socket.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
/*
send a ntlogon mailslot request
diff --git a/source4/libcli/ldap/ldap_bind.c b/source4/libcli/ldap/ldap_bind.c
index 766416f5758..6b1c321d49e 100644
--- a/source4/libcli/ldap/ldap_bind.c
+++ b/source4/libcli/ldap/ldap_bind.c
@@ -23,7 +23,6 @@
*/
#include "includes.h"
-#include "libcli/ldap/ldap.h"
#include "libcli/ldap/ldap_client.h"
#include "auth/auth.h"
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index 1ce86f7f857..77fc7db0498 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -28,8 +28,6 @@
#include "dlinklist.h"
#include "lib/events/events.h"
#include "lib/socket/socket.h"
-#include "lib/tls/tls.h"
-#include "libcli/ldap/ldap.h"
#include "libcli/ldap/ldap_client.h"
#include "libcli/composite/composite.h"
#include "lib/stream/packet.h"
diff --git a/source4/libcli/ldap/ldap_ildap.c b/source4/libcli/ldap/ldap_ildap.c
index 666cc025366..f29685a67c6 100644
--- a/source4/libcli/ldap/ldap_ildap.c
+++ b/source4/libcli/ldap/ldap_ildap.c
@@ -22,7 +22,6 @@
*/
#include "includes.h"
-#include "libcli/ldap/ldap.h"
#include "libcli/ldap/ldap_client.h"
/*
diff --git a/source4/libcli/ldap/ldap_msg.c b/source4/libcli/ldap/ldap_msg.c
index 9b531f31380..c77d9eb356e 100644
--- a/source4/libcli/ldap/ldap_msg.c
+++ b/source4/libcli/ldap/ldap_msg.c
@@ -23,7 +23,6 @@
*/
#include "includes.h"
-#include "libcli/ldap/ldap.h"
#include "libcli/ldap/ldap_client.h"
diff --git a/source4/libcli/ldap/ldap_ndr.c b/source4/libcli/ldap/ldap_ndr.c
index 0cccdbe9719..1d5e4ccf202 100644
--- a/source4/libcli/ldap/ldap_ndr.c
+++ b/source4/libcli/ldap/ldap_ndr.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "libcli/ldap/ldap.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/ndr_misc.h"
/*
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 2972da07a0c..a0efe7042c9 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -26,7 +26,6 @@
#include "dlinklist.h"
#include "lib/events/events.h"
#include "lib/stream/packet.h"
-#include "libcli/nbt/libnbt.h"
/*
diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c
index 96d36c569ce..6e120ed6155 100644
--- a/source4/libcli/raw/clitree.c
+++ b/source4/libcli/raw/clitree.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
-#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
#define SETUP_REQUEST_TREE(cmd, wct, buflen) do { \
diff --git a/source4/libcli/raw/rawacl.c b/source4/libcli/raw/rawacl.c
index ae17447784e..08515eadde1 100644
--- a/source4/libcli/raw/rawacl.c
+++ b/source4/libcli/raw/rawacl.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/raw/libcliraw.h"
/****************************************************************************
diff --git a/source4/libcli/raw/rawfile.c b/source4/libcli/raw/rawfile.c
index c6652125c24..6981a768002 100644
--- a/source4/libcli/raw/rawfile.c
+++ b/source4/libcli/raw/rawfile.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
#define SETUP_REQUEST(cmd, wct, buflen) do { \
req = smbcli_request_setup(tree, cmd, wct, buflen); \
diff --git a/source4/libcli/raw/rawlpq.c b/source4/libcli/raw/rawlpq.c
index e83ee48707c..40669e51de9 100644
--- a/source4/libcli/raw/rawlpq.c
+++ b/source4/libcli/raw/rawlpq.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
/****************************************************************************
lpq - async send
diff --git a/source4/libcli/resolve/bcast.c b/source4/libcli/resolve/bcast.c
index c47bba38c54..c95fe945b1f 100644
--- a/source4/libcli/resolve/bcast.c
+++ b/source4/libcli/resolve/bcast.c
@@ -21,9 +21,6 @@
*/
#include "includes.h"
-#include "system/network.h"
-#include "libcli/raw/libcliraw.h"
-#include "libcli/composite/composite.h"
/*
broadcast name resolution method - async send
diff --git a/source4/libcli/resolve/host.c b/source4/libcli/resolve/host.c
index f1925ca0d86..c283f0fda17 100644
--- a/source4/libcli/resolve/host.c
+++ b/source4/libcli/resolve/host.c
@@ -33,9 +33,7 @@
#include "lib/events/events.h"
#include "system/network.h"
#include "system/filesys.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
-#include "libcli/nbt/libnbt.h"
struct host_state {
struct nbt_name name;
diff --git a/source4/libcli/resolve/nbtlist.c b/source4/libcli/resolve/nbtlist.c
index f8fe5df9a1b..3af40c1b24b 100644
--- a/source4/libcli/resolve/nbtlist.c
+++ b/source4/libcli/resolve/nbtlist.c
@@ -25,8 +25,6 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
-#include "libcli/nbt/libnbt.h"
#include "libcli/composite/composite.h"
struct nbtlist_state {
diff --git a/source4/libcli/resolve/resolve.c b/source4/libcli/resolve/resolve.c
index dcbccc0c706..d3d197e567f 100644
--- a/source4/libcli/resolve/resolve.c
+++ b/source4/libcli/resolve/resolve.c
@@ -22,9 +22,7 @@
#include "includes.h"
#include "lib/events/events.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
-#include "libcli/nbt/libnbt.h"
struct resolve_state {
struct nbt_name name;
diff --git a/source4/libcli/resolve/wins.c b/source4/libcli/resolve/wins.c
index aa4ec0cea45..b2e0ddae6f3 100644
--- a/source4/libcli/resolve/wins.c
+++ b/source4/libcli/resolve/wins.c
@@ -21,9 +21,6 @@
*/
#include "includes.h"
-#include "system/network.h"
-#include "libcli/raw/libcliraw.h"
-#include "libcli/composite/composite.h"
/*
wins name resolution method - async send
diff --git a/source4/libcli/security/access_check.c b/source4/libcli/security/access_check.c
index 0ffca1ade89..00275d88244 100644
--- a/source4/libcli/security/access_check.c
+++ b/source4/libcli/security/access_check.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
/*
diff --git a/source4/libcli/security/dom_sid.c b/source4/libcli/security/dom_sid.c
index c19959f8ae5..646a513df5e 100644
--- a/source4/libcli/security/dom_sid.c
+++ b/source4/libcli/security/dom_sid.c
@@ -22,7 +22,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
/*****************************************************************
Compare the auth portion of two sids.
diff --git a/source4/libcli/security/privilege.c b/source4/libcli/security/privilege.c
index aa01dc2c657..fec8c1278c0 100644
--- a/source4/libcli/security/privilege.c
+++ b/source4/libcli/security/privilege.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
static const struct {
diff --git a/source4/libcli/security/sddl.c b/source4/libcli/security/sddl.c
index 83dfeed5ac9..c4340725297 100644
--- a/source4/libcli/security/sddl.c
+++ b/source4/libcli/security/sddl.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "system/iconv.h"
-#include "librpc/gen_ndr/ndr_security.h"
struct flag_map {
const char *name;
diff --git a/source4/libcli/security/security_descriptor.c b/source4/libcli/security/security_descriptor.c
index 91448e7c35e..64983e20d06 100644
--- a/source4/libcli/security/security_descriptor.c
+++ b/source4/libcli/security/security_descriptor.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
/*
return a blank security descriptor (no owners, dacl or sacl)
diff --git a/source4/libcli/security/security_token.c b/source4/libcli/security/security_token.c
index e61e2edcf59..04d10bf83bd 100644
--- a/source4/libcli/security/security_token.c
+++ b/source4/libcli/security/security_token.c
@@ -22,7 +22,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "dsdb/samdb/samdb.h"
/*
diff --git a/source4/libcli/smb2/flush.c b/source4/libcli/smb2/flush.c
index f5d623c69c4..d9178aeb9f8 100644
--- a/source4/libcli/smb2/flush.c
+++ b/source4/libcli/smb2/flush.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb2/ioctl.c b/source4/libcli/smb2/ioctl.c
index 37e07dbae19..533f12c9d36 100644
--- a/source4/libcli/smb2/ioctl.c
+++ b/source4/libcli/smb2/ioctl.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb2/keepalive.c b/source4/libcli/smb2/keepalive.c
index 4017623a616..99d9dd3ae9b 100644
--- a/source4/libcli/smb2/keepalive.c
+++ b/source4/libcli/smb2/keepalive.c
@@ -21,9 +21,7 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
-#include "libcli/smb2/smb2_calls.h"
/*
send a keepalive request
diff --git a/source4/libcli/smb2/logoff.c b/source4/libcli/smb2/logoff.c
index febe0d6b456..ba0e691e8b9 100644
--- a/source4/libcli/smb2/logoff.c
+++ b/source4/libcli/smb2/logoff.c
@@ -21,9 +21,7 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
-#include "libcli/smb2/smb2_calls.h"
/*
send a logoff request
diff --git a/source4/libcli/smb2/read.c b/source4/libcli/smb2/read.c
index 8709aa6ce22..da2d3bb7c93 100644
--- a/source4/libcli/smb2/read.c
+++ b/source4/libcli/smb2/read.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb2/request.c b/source4/libcli/smb2/request.c
index 03c0ed43504..9fe9ad12faa 100644
--- a/source4/libcli/smb2/request.c
+++ b/source4/libcli/smb2/request.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
-#include "libcli/smb2/smb2_calls.h"
#include "include/dlinklist.h"
#include "lib/events/events.h"
diff --git a/source4/libcli/smb2/tcon.c b/source4/libcli/smb2/tcon.c
index ddc4babeeaf..3fc14075a5c 100644
--- a/source4/libcli/smb2/tcon.c
+++ b/source4/libcli/smb2/tcon.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb2/tdis.c b/source4/libcli/smb2/tdis.c
index c08370d9e08..7d1f7aee4e7 100644
--- a/source4/libcli/smb2/tdis.c
+++ b/source4/libcli/smb2/tdis.c
@@ -21,9 +21,7 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
-#include "libcli/smb2/smb2_calls.h"
/*
send a tdis request
diff --git a/source4/libcli/smb2/write.c b/source4/libcli/smb2/write.c
index 591cf2c891c..adf690c1b3c 100644
--- a/source4/libcli/smb2/write.c
+++ b/source4/libcli/smb2/write.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/libcli/smb_composite/appendacl.c b/source4/libcli/smb_composite/appendacl.c
index b47a41a43b4..c68c0a185df 100644
--- a/source4/libcli/smb_composite/appendacl.c
+++ b/source4/libcli/smb_composite/appendacl.c
@@ -2,7 +2,6 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
-#include "librpc/gen_ndr/ndr_security.h"
/* the stages of this call */
enum appendacl_stage {APPENDACL_OPENPATH, APPENDACL_GET,
diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c
index 4191c43ca6e..785b0d076bd 100644
--- a/source4/libcli/smb_composite/connect.c
+++ b/source4/libcli/smb_composite/connect.c
@@ -26,7 +26,6 @@
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
#include "lib/events/events.h"
-#include "libcli/nbt/libnbt.h"
/* the stages of this call */
enum connect_stage {CONNECT_RESOLVE,
diff --git a/source4/libcli/smb_composite/fetchfile.c b/source4/libcli/smb_composite/fetchfile.c
index a885aaa911f..5783a3258f7 100644
--- a/source4/libcli/smb_composite/fetchfile.c
+++ b/source4/libcli/smb_composite/fetchfile.c
@@ -22,7 +22,6 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
diff --git a/source4/libcli/smb_composite/fsinfo.c b/source4/libcli/smb_composite/fsinfo.c
index 1d3860e5c62..e81e3a20858 100644
--- a/source4/libcli/smb_composite/fsinfo.c
+++ b/source4/libcli/smb_composite/fsinfo.c
@@ -6,7 +6,6 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
-#include "librpc/gen_ndr/ndr_security.h"
/* the stages of this call */
enum fsinfo_stage {FSINFO_CONNECT, FSINFO_QUERY};
diff --git a/source4/libcli/smb_composite/loadfile.c b/source4/libcli/smb_composite/loadfile.c
index 93122e287ff..2551b6da9e6 100644
--- a/source4/libcli/smb_composite/loadfile.c
+++ b/source4/libcli/smb_composite/loadfile.c
@@ -25,7 +25,6 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
-#include "librpc/gen_ndr/ndr_security.h"
/* the stages of this call */
enum loadfile_stage {LOADFILE_OPEN, LOADFILE_READ, LOADFILE_CLOSE};
diff --git a/source4/libcli/smb_composite/savefile.c b/source4/libcli/smb_composite/savefile.c
index 0e11031dab9..9600af97d2e 100644
--- a/source4/libcli/smb_composite/savefile.c
+++ b/source4/libcli/smb_composite/savefile.c
@@ -25,7 +25,6 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
-#include "librpc/gen_ndr/ndr_security.h"
/* the stages of this call */
enum savefile_stage {SAVEFILE_OPEN, SAVEFILE_WRITE, SAVEFILE_CLOSE};
diff --git a/source4/libcli/util/smbdes.c b/source4/libcli/util/smbdes.c
index d02cae602f2..d392109b1e5 100644
--- a/source4/libcli/util/smbdes.c
+++ b/source4/libcli/util/smbdes.c
@@ -22,7 +22,6 @@
*/
#include "includes.h"
-#include "lib/crypto/crypto.h"
/* NOTES:
diff --git a/source4/libnet/domain.c b/source4/libnet/domain.c
index 3a5aecb92e8..342b92f4038 100644
--- a/source4/libnet/domain.c
+++ b/source4/libnet/domain.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "libcli/composite/composite.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/composite.h"
static void domain_open_handler(struct rpc_request*);
diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c
index af15d817975..a1aa00c5c2e 100644
--- a/source4/libnet/libnet_join.c
+++ b/source4/libnet/libnet_join.c
@@ -22,14 +22,11 @@
#include "includes.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_samr.h"
-#include "librpc/gen_ndr/ndr_lsa.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
#include "lib/ldb/include/ldb.h"
#include "lib/ldb/include/ldb_errors.h"
#include "libcli/cldap/cldap.h"
#include "include/secrets.h"
-#include "librpc/gen_ndr/drsuapi.h"
#include "dsdb/samdb/samdb.h"
/*
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index 67c102a3e2e..e64ab6a291f 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -23,12 +23,9 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "lib/events/events.h"
#include "libnet/libnet.h"
#include "libcli/composite/composite.h"
-#include "libnet/composite.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
struct lookup_state {
diff --git a/source4/libnet/libnet_passwd.c b/source4/libnet/libnet_passwd.c
index db54935a78f..ec97eea8385 100644
--- a/source4/libnet/libnet_passwd.c
+++ b/source4/libnet/libnet_passwd.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "lib/crypto/crypto.h"
/*
diff --git a/source4/libnet/libnet_samdump.c b/source4/libnet/libnet_samdump.c
index 89364079728..a5d060c5eb4 100644
--- a/source4/libnet/libnet_samdump.c
+++ b/source4/libnet/libnet_samdump.c
@@ -23,8 +23,6 @@
#include "includes.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "dlinklist.h"
diff --git a/source4/libnet/libnet_samdump_keytab.c b/source4/libnet/libnet_samdump_keytab.c
index deaa2828014..e267cfdc2ed 100644
--- a/source4/libnet/libnet_samdump_keytab.c
+++ b/source4/libnet/libnet_samdump_keytab.c
@@ -23,10 +23,7 @@
#include "includes.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "system/kerberos.h"
-#include "auth/kerberos/kerberos.h"
static NTSTATUS samdump_keytab_handle_user(TALLOC_CTX *mem_ctx,
const char *keytab_name,
diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c
index c97d9013c9c..d07002691fb 100644
--- a/source4/libnet/libnet_samsync_ldb.c
+++ b/source4/libnet/libnet_samsync_ldb.c
@@ -25,11 +25,7 @@
#include "includes.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "librpc/gen_ndr/ndr_samr.h"
-#include "dlinklist.h"
#include "libcli/ldap/ldap.h"
-#include "lib/ldb/include/ldb.h"
#include "dsdb/samdb/samdb.h"
#include "auth/auth.h"
diff --git a/source4/libnet/libnet_share.c b/source4/libnet/libnet_share.c
index 0473658da81..9422cdd3061 100644
--- a/source4/libnet/libnet_share.c
+++ b/source4/libnet/libnet_share.c
@@ -20,7 +20,6 @@
#include "includes.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_srvsvc.h"
NTSTATUS libnet_ListShares(struct libnet_context *ctx,
diff --git a/source4/libnet/libnet_time.c b/source4/libnet/libnet_time.c
index 655a4755038..7d480a53482 100644
--- a/source4/libnet/libnet_time.c
+++ b/source4/libnet/libnet_time.c
@@ -20,7 +20,6 @@
#include "includes.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_srvsvc.h"
#include "system/time.h"
/*
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index d0b7722c08c..d9c25d053ec 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -23,8 +23,6 @@
#include "includes.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "librpc/gen_ndr/ndr_samr.h"
/**
diff --git a/source4/libnet/userinfo.c b/source4/libnet/userinfo.c
index 65781cd1b37..ff5f08c6c10 100644
--- a/source4/libnet/userinfo.c
+++ b/source4/libnet/userinfo.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "libcli/composite/composite.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/composite.h"
#include "libnet/userinfo.h"
diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c
index 9c9884831ec..8d46f3fde84 100644
--- a/source4/libnet/userman.c
+++ b/source4/libnet/userman.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "libcli/composite/composite.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/composite.h"
#include "libnet/userman.h"
#include "libnet/userinfo.h"
diff --git a/source4/librpc/ndr/ndr_sec.c b/source4/librpc/ndr/ndr_sec.c
index fb18d48909d..ee01536ede5 100644
--- a/source4/librpc/ndr/ndr_sec.c
+++ b/source4/librpc/ndr/ndr_sec.c
@@ -23,7 +23,6 @@
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
/*
parse a dom_sid2 - this is a dom_sid but with an extra copy of the num_auths field
diff --git a/source4/librpc/ndr/ndr_sec_helper.c b/source4/librpc/ndr/ndr_sec_helper.c
index 8325aef93d1..a6cd0fc62ed 100644
--- a/source4/librpc/ndr/ndr_sec_helper.c
+++ b/source4/librpc/ndr/ndr_sec_helper.c
@@ -22,7 +22,6 @@
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
/*
return the wire size of a dom_sid
diff --git a/source4/librpc/ndr/ndr_string.c b/source4/librpc/ndr/ndr_string.c
index fcc529cbd10..3f7eb9f630a 100644
--- a/source4/librpc/ndr/ndr_string.c
+++ b/source4/librpc/ndr/ndr_string.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "system/network.h"
/*
pull a general string from the wire
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 37f7d82ef5c..df71be76513 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "dlinklist.h"
#include "lib/events/events.h"
-#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_dcerpc.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "libcli/composite/composite.h"
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index 7ab90fbbf71..4fbb74dd6be 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -25,11 +25,6 @@
#include "includes.h"
-#include "system/network.h"
-#include "librpc/gen_ndr/ndr_epmapper.h"
-#include "librpc/gen_ndr/ndr_dcerpc.h"
-#include "librpc/gen_ndr/ndr_misc.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
#include "libcli/smb2/smb2.h"
diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c
index d6971612f23..108b6781881 100644
--- a/source4/librpc/rpc/dcerpc_schannel.c
+++ b/source4/librpc/rpc/dcerpc_schannel.c
@@ -22,7 +22,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_schannel.h"
#include "auth/auth.h"
/*
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c
index 8a3e88e9dc3..c0716a1af89 100644
--- a/source4/librpc/rpc/dcerpc_smb.c
+++ b/source4/librpc/rpc/dcerpc_smb.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/composite/composite.h"
/* transport private information used by SMB pipe transport */
diff --git a/source4/librpc/rpc/dcerpc_smb2.c b/source4/librpc/rpc/dcerpc_smb2.c
index 46e11d4edd9..90882bd95ea 100644
--- a/source4/librpc/rpc/dcerpc_smb2.c
+++ b/source4/librpc/rpc/dcerpc_smb2.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/composite/composite.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c
index da48ae0f7d9..2867a8eaccb 100644
--- a/source4/librpc/rpc/dcerpc_sock.c
+++ b/source4/librpc/rpc/dcerpc_sock.c
@@ -22,9 +22,7 @@
*/
#include "includes.h"
-#include "dlinklist.h"
#include "lib/events/events.h"
-#include "librpc/gen_ndr/ndr_epmapper.h"
#include "lib/socket/socket.h"
#include "lib/stream/packet.h"
#include "libcli/composite/composite.h"
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 6e814bce3f9..15a45ed3f08 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -23,7 +23,6 @@
*/
#include "includes.h"
-#include "system/network.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_dcerpc.h"
#include "librpc/gen_ndr/ndr_misc.h"
diff --git a/source4/nbt_server/dgram/browse.c b/source4/nbt_server/dgram/browse.c
index 84f5a5b4ffb..49e43eeb685 100644
--- a/source4/nbt_server/dgram/browse.c
+++ b/source4/nbt_server/dgram/browse.c
@@ -21,10 +21,7 @@
*/
#include "includes.h"
-#include "dlinklist.h"
#include "nbt_server/nbt_server.h"
-#include "smbd/service_task.h"
-#include "lib/socket/socket.h"
/*
handle incoming browse mailslot requests
diff --git a/source4/nbt_server/dgram/netlogon.c b/source4/nbt_server/dgram/netlogon.c
index 4b620258755..858b2909573 100644
--- a/source4/nbt_server/dgram/netlogon.c
+++ b/source4/nbt_server/dgram/netlogon.c
@@ -21,9 +21,7 @@
*/
#include "includes.h"
-#include "dlinklist.h"
#include "nbt_server/nbt_server.h"
-#include "smbd/service_task.h"
#include "lib/socket/socket.h"
#include "lib/ldb/include/ldb.h"
#include "dsdb/samdb/samdb.h"
diff --git a/source4/nbt_server/dgram/ntlogon.c b/source4/nbt_server/dgram/ntlogon.c
index 0a2d9491c6b..191bac8a54a 100644
--- a/source4/nbt_server/dgram/ntlogon.c
+++ b/source4/nbt_server/dgram/ntlogon.c
@@ -21,10 +21,7 @@
*/
#include "includes.h"
-#include "dlinklist.h"
#include "nbt_server/nbt_server.h"
-#include "smbd/service_task.h"
-#include "lib/socket/socket.h"
/*
diff --git a/source4/nbt_server/dgram/request.c b/source4/nbt_server/dgram/request.c
index 9517ab23877..25b08eb5cf9 100644
--- a/source4/nbt_server/dgram/request.c
+++ b/source4/nbt_server/dgram/request.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "dlinklist.h"
#include "nbt_server/nbt_server.h"
#include "smbd/service_task.h"
#include "lib/socket/socket.h"
diff --git a/source4/nbt_server/nbt_server.c b/source4/nbt_server/nbt_server.c
index 5e8d8fb073c..ceeb565ffbe 100644
--- a/source4/nbt_server/nbt_server.c
+++ b/source4/nbt_server/nbt_server.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
#include "smbd/service_task.h"
#include "nbt_server/nbt_server.h"
#include "nbt_server/wins/winsserver.h"
diff --git a/source4/nbt_server/packet.c b/source4/nbt_server/packet.c
index 9c9983b63c6..d7211c8ca4d 100644
--- a/source4/nbt_server/packet.c
+++ b/source4/nbt_server/packet.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "dlinklist.h"
#include "nbt_server/nbt_server.h"
/*
diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c
index 55e2522f25c..5fcad32903b 100644
--- a/source4/nbt_server/wins/winsdb.c
+++ b/source4/nbt_server/wins/winsdb.c
@@ -26,7 +26,6 @@
#include "nbt_server/wins/winsdb.h"
#include "lib/ldb/include/ldb.h"
#include "lib/ldb/include/ldb_errors.h"
-#include "db_wrap.h"
#include "system/time.h"
#include "auth/auth.h"
diff --git a/source4/ntptr/ntptr_base.c b/source4/ntptr/ntptr_base.c
index b78efd05851..51f16ec9543 100644
--- a/source4/ntptr/ntptr_base.c
+++ b/source4/ntptr/ntptr_base.c
@@ -25,7 +25,6 @@
#include "includes.h"
#include "ntptr/ntptr.h"
-#include "dlinklist.h"
#include "smb_build.h"
/* the list of currently registered NTPTR backends */
diff --git a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
index 60aa6299a63..8135625734c 100644
--- a/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
+++ b/source4/ntptr/simple_ldb/ntptr_simple_ldb.c
@@ -32,7 +32,6 @@
#include "ntptr/ntptr.h"
#include "librpc/gen_ndr/ndr_spoolss.h"
#include "lib/ldb/include/ldb.h"
-#include "db_wrap.h"
#include "auth/auth.h"
#include "dsdb/samdb/samdb.h"
diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c
index 16a472104b7..412af07aa2e 100644
--- a/source4/ntvfs/cifs/vfs_cifs.c
+++ b/source4/ntvfs/cifs/vfs_cifs.c
@@ -26,9 +26,7 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
#include "libcli/raw/libcliraw.h"
-#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
#include "smb_server/smb_server.h"
#include "smbd/service_stream.h"
diff --git a/source4/ntvfs/common/sidmap.c b/source4/ntvfs/common/sidmap.c
index 1f19ba171d2..b2408d42bd2 100644
--- a/source4/ntvfs/common/sidmap.c
+++ b/source4/ntvfs/common/sidmap.c
@@ -21,9 +21,7 @@
*/
#include "includes.h"
-#include "system/filesys.h"
#include "system/passwd.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "ads.h"
#include "dsdb/samdb/samdb.h"
#include "auth/auth.h"
diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c
index 415d09a7295..7eb9250eb21 100644
--- a/source4/ntvfs/ipc/vfs_ipc.c
+++ b/source4/ntvfs/ipc/vfs_ipc.c
@@ -26,7 +26,6 @@
#include "includes.h"
-#include "system/filesys.h"
#include "dlinklist.h"
#include "smb_server/smb_server.h"
#include "ntvfs/ntvfs.h"
diff --git a/source4/ntvfs/unixuid/vfs_unixuid.c b/source4/ntvfs/unixuid/vfs_unixuid.c
index 8bdf732735c..886ace819e2 100644
--- a/source4/ntvfs/unixuid/vfs_unixuid.c
+++ b/source4/ntvfs/unixuid/vfs_unixuid.c
@@ -25,7 +25,6 @@
#include "system/filesys.h"
#include "system/passwd.h"
#include "auth/auth.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "smb_server/smb_server.h"
#include "ntvfs/ntvfs.h"
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 290dd361e81..a87e5897e34 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -58,11 +58,8 @@
#include "pstring.h"
#include "system/time.h"
#include "system/iconv.h"
-#include "system/network.h"
-#include "system/printing.h"
#include "librpc/gen_ndr/ndr_svcctl.h"
#include "librpc/gen_ndr/ndr_samr.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
#include "dlinklist.h"
#include "param/loadparm.h"
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 246f6a72744..bd8c40e6fde 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -22,9 +22,7 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_epmapper.h"
#include "librpc/gen_ndr/ndr_dcerpc.h"
-#include "librpc/gen_ndr/ndr_oxidresolver.h"
#include "auth/auth.h"
#include "dlinklist.h"
#include "rpc_server/dcerpc_server.h"
diff --git a/source4/rpc_server/dcerpc_sock.c b/source4/rpc_server/dcerpc_sock.c
index e7ef621d391..d8dd8b26209 100644
--- a/source4/rpc_server/dcerpc_sock.c
+++ b/source4/rpc_server/dcerpc_sock.c
@@ -24,8 +24,6 @@
#include "includes.h"
#include "lib/socket/socket.h"
-#include "system/dir.h"
-#include "system/filesys.h"
#include "lib/events/events.h"
#include "rpc_server/dcerpc_server.h"
#include "smbd/service_stream.h"
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
index 68bac0f2ce9..6bfcfb20170 100644
--- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
+++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
@@ -25,7 +25,6 @@
#include "rpc_server/dcerpc_server.h"
#include "rpc_server/common/common.h"
#include "rpc_server/drsuapi/dcesrv_drsuapi.h"
-#include "auth/auth.h"
#include "dsdb/samdb/samdb.h"
/*
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index 2171ac48b0b..c02536fc0b7 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -22,13 +22,8 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_lsa.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "rpc_server/dcerpc_server.h"
#include "rpc_server/common/common.h"
-#include "lib/ldb/include/ldb.h"
-#include "system/time.h"
-#include "db_wrap.h"
#include "auth/auth.h"
#include "dsdb/samdb/samdb.h"
#include "libcli/ldap/ldap.h"
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index cc5937060ae..f3ef74641da 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -22,10 +22,8 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
#include "rpc_server/dcerpc_server.h"
#include "rpc_server/common/common.h"
-#include "librpc/gen_ndr/ndr_dcom.h"
#include "lib/ldb/include/ldb.h"
#include "auth/auth.h"
#include "dsdb/samdb/samdb.h"
diff --git a/source4/rpc_server/samr/samr_password.c b/source4/rpc_server/samr/samr_password.c
index e8bb8cc66ab..5845c7ad1bd 100644
--- a/source4/rpc_server/samr/samr_password.c
+++ b/source4/rpc_server/samr/samr_password.c
@@ -22,13 +22,11 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "rpc_server/dcerpc_server.h"
#include "rpc_server/common/common.h"
#include "rpc_server/samr/dcesrv_samr.h"
#include "system/time.h"
#include "lib/crypto/crypto.h"
-#include "lib/ldb/include/ldb.h"
#include "ads.h"
#include "libcli/ldap/ldap.h"
#include "dsdb/samdb/samdb.h"
diff --git a/source4/scripting/ejs/smbcalls_options.c b/source4/scripting/ejs/smbcalls_options.c
index 2e94b7d72bd..d24d689cf3c 100644
--- a/source4/scripting/ejs/smbcalls_options.c
+++ b/source4/scripting/ejs/smbcalls_options.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "lib/cmdline/popt_common.h"
#include "scripting/ejs/smbcalls.h"
-#include "lib/appweb/ejs/ejs.h"
/*
diff --git a/source4/smb_server/smb/nttrans.c b/source4/smb_server/smb/nttrans.c
index 1ade18d6943..51369b06369 100644
--- a/source4/smb_server/smb/nttrans.c
+++ b/source4/smb_server/smb/nttrans.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "smb_server/smb_server.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "ntvfs/ntvfs.h"
#include "libcli/raw/libcliraw.h"
diff --git a/source4/smb_server/smb/receive.c b/source4/smb_server/smb/receive.c
index a7dde2163fc..03eb5087d6b 100644
--- a/source4/smb_server/smb/receive.c
+++ b/source4/smb_server/smb/receive.c
@@ -24,7 +24,6 @@
#include "system/time.h"
#include "smbd/service_stream.h"
#include "smb_server/smb_server.h"
-#include "lib/stream/packet.h"
#include "ntvfs/ntvfs.h"
diff --git a/source4/smb_server/smb/reply.c b/source4/smb_server/smb/reply.c
index 644a5dd1a4d..08ec0e74031 100644
--- a/source4/smb_server/smb/reply.c
+++ b/source4/smb_server/smb/reply.c
@@ -25,7 +25,6 @@
#include "includes.h"
#include "smb_server/smb_server.h"
-#include "libcli/nbt/libnbt.h"
#include "ntvfs/ntvfs.h"
diff --git a/source4/smb_server/smb/request.c b/source4/smb_server/smb/request.c
index 08e3eb74a55..3879cadebe2 100644
--- a/source4/smb_server/smb/request.c
+++ b/source4/smb_server/smb/request.c
@@ -23,8 +23,6 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
-#include "dlinklist.h"
#include "smb_server/smb_server.h"
#include "smbd/service_stream.h"
#include "lib/stream/packet.h"
diff --git a/source4/smb_server/smb/sesssetup.c b/source4/smb_server/smb/sesssetup.c
index 2532a2f78fb..4bafc6cbf4f 100644
--- a/source4/smb_server/smb/sesssetup.c
+++ b/source4/smb_server/smb/sesssetup.c
@@ -27,7 +27,6 @@
#include "auth/auth.h"
#include "smb_server/smb_server.h"
#include "smbd/service_stream.h"
-#include "libcli/nbt/libnbt.h"
/*
setup the OS, Lanman and domain portions of a session setup reply
diff --git a/source4/smb_server/smb2/fileio.c b/source4/smb_server/smb2/fileio.c
index ea09c3ce9bd..b9f36fdc7af 100644
--- a/source4/smb_server/smb2/fileio.c
+++ b/source4/smb_server/smb2/fileio.c
@@ -20,7 +20,6 @@
#include "includes.h"
#include "libcli/smb2/smb2.h"
-#include "libcli/smb2/smb2_calls.h"
#include "smb_server/smb2/smb2_server.h"
void smb2srv_create_recv(struct smb2srv_request *req)
diff --git a/source4/smb_server/smb2/keepalive.c b/source4/smb_server/smb2/keepalive.c
index a5ebab57d9d..65d21babd9b 100644
--- a/source4/smb_server/smb2/keepalive.c
+++ b/source4/smb_server/smb2/keepalive.c
@@ -19,12 +19,9 @@
*/
#include "includes.h"
-#include "auth/auth.h"
#include "libcli/smb2/smb2.h"
-#include "libcli/smb2/smb2_calls.h"
#include "smb_server/smb_server.h"
#include "smb_server/smb2/smb2_server.h"
-#include "smbd/service_stream.h"
static NTSTATUS smb2srv_keepalive_backend(struct smb2srv_request *req)
{
diff --git a/source4/smb_server/smb2/receive.c b/source4/smb_server/smb2/receive.c
index 310ded53557..f0e21473bad 100644
--- a/source4/smb_server/smb2/receive.c
+++ b/source4/smb_server/smb2/receive.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "system/time.h"
-#include "smbd/service_stream.h"
#include "libcli/smb2/smb2.h"
#include "smb_server/smb_server.h"
#include "smb_server/smb2/smb2_server.h"
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c
index e4b9a227d48..6740db4923a 100644
--- a/source4/smb_server/smb_server.c
+++ b/source4/smb_server/smb_server.c
@@ -20,9 +20,6 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
-#include "system/time.h"
-#include "dlinklist.h"
#include "smbd/service_stream.h"
#include "smb_server/smb_server.h"
#include "lib/messaging/irpc.h"
diff --git a/source4/smb_server/tcon.c b/source4/smb_server/tcon.c
index 01194d1ea10..1c934baf8c6 100644
--- a/source4/smb_server/tcon.c
+++ b/source4/smb_server/tcon.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "system/filesys.h"
#include "dlinklist.h"
#include "smb_server/smb_server.h"
#include "smbd/service_stream.h"
diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c
index f9846826571..8fdf5cc2f59 100644
--- a/source4/smbd/process_model.c
+++ b/source4/smbd/process_model.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
#include "smb_server/smb_server.h"
#include "smb_build.h"
diff --git a/source4/smbd/process_single.c b/source4/smbd/process_single.c
index d46ee487185..94fd7259469 100644
--- a/source4/smbd/process_single.c
+++ b/source4/smbd/process_single.c
@@ -23,10 +23,7 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
-#include "dlinklist.h"
#include "smb_server/smb_server.h"
-#include "system/filesys.h"
/* For sepecifiying event context to GSSAPI below */
#include "heimdal/lib/gssapi/gssapi_locl.h"
diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c
index 5149ab55b67..b2276a2e548 100644
--- a/source4/smbd/process_standard.c
+++ b/source4/smbd/process_standard.c
@@ -25,9 +25,7 @@
#include "includes.h"
#include "lib/events/events.h"
#include "lib/tdb/include/tdb.h"
-#include "dlinklist.h"
#include "smb_server/smb_server.h"
-#include "system/filesys.h"
/* For sepecifiying event context to GSSAPI below */
#include "heimdal/lib/gssapi/gssapi_locl.h"
diff --git a/source4/smbd/service.c b/source4/smbd/service.c
index 09f7a63fe73..2057fc811a6 100644
--- a/source4/smbd/service.c
+++ b/source4/smbd/service.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "dlinklist.h"
-#include "process_model.h"
/*
a linked list of registered servers
diff --git a/source4/torture/auth/pac.c b/source4/torture/auth/pac.c
index 7cf2c390c4a..0ea31a24d10 100644
--- a/source4/torture/auth/pac.c
+++ b/source4/torture/auth/pac.c
@@ -26,7 +26,6 @@
#include "auth/auth.h"
#include "auth/kerberos/kerberos.h"
#include "librpc/gen_ndr/ndr_krb5pac.h"
-#include "librpc/gen_ndr/ndr_samr.h"
static BOOL torture_pac_self_check(void)
{
diff --git a/source4/torture/basic/attr.c b/source4/torture/basic/attr.c
index daa0f98d609..c37cb2596c5 100644
--- a/source4/torture/basic/attr.c
+++ b/source4/torture/basic/attr.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
extern int torture_failures;
diff --git a/source4/torture/basic/charset.c b/source4/torture/basic/charset.c
index a216ebc05a2..2b49690d51a 100644
--- a/source4/torture/basic/charset.c
+++ b/source4/torture/basic/charset.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/raw/libcliraw.h"
#define BASEDIR "\\chartest\\"
diff --git a/source4/torture/basic/delete.c b/source4/torture/basic/delete.c
index d1ee98941c6..81c3f3f1d16 100644
--- a/source4/torture/basic/delete.c
+++ b/source4/torture/basic/delete.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "system/filesys.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/raw/libcliraw.h"
static BOOL check_delete_on_close(struct smbcli_state *cli, int fnum,
diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c
index 9f559b7c766..1963f866e30 100644
--- a/source4/torture/basic/denytest.c
+++ b/source4/torture/basic/denytest.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
extern BOOL torture_showall;
extern int torture_failures;
diff --git a/source4/torture/basic/dir.c b/source4/torture/basic/dir.c
index 59cd21f06d1..f98c0732e74 100644
--- a/source4/torture/basic/dir.c
+++ b/source4/torture/basic/dir.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "system/filesys.h"
-#include "librpc/gen_ndr/ndr_security.h"
static void list_fn(struct clilist_file_info *finfo, const char *name, void *state)
{
diff --git a/source4/torture/basic/disconnect.c b/source4/torture/basic/disconnect.c
index 423135008ed..b585b40bc41 100644
--- a/source4/torture/basic/disconnect.c
+++ b/source4/torture/basic/disconnect.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
#define BASEDIR "\\test_disconnect"
diff --git a/source4/torture/basic/rename.c b/source4/torture/basic/rename.c
index 3f7be04a8eb..219dd72b6d2 100644
--- a/source4/torture/basic/rename.c
+++ b/source4/torture/basic/rename.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
/*
Test rename on files open with share delete and no share delete.
diff --git a/source4/torture/basic/scanner.c b/source4/torture/basic/scanner.c
index 06dff7e72c6..6d78464ef19 100644
--- a/source4/torture/basic/scanner.c
+++ b/source4/torture/basic/scanner.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
#include "system/filesys.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "pstring.h"
#define VERBOSE 0
diff --git a/source4/torture/basic/secleak.c b/source4/torture/basic/secleak.c
index f77b3998748..5eae5192111 100644
--- a/source4/torture/basic/secleak.c
+++ b/source4/torture/basic/secleak.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
#include "system/time.h"
-#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
static BOOL try_failed_login(struct smbcli_state *cli)
diff --git a/source4/torture/basic/unlink.c b/source4/torture/basic/unlink.c
index 40a486f93f9..f046d68b6ed 100644
--- a/source4/torture/basic/unlink.c
+++ b/source4/torture/basic/unlink.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
#define BASEDIR "\\unlinktest"
diff --git a/source4/torture/basic/utable.c b/source4/torture/basic/utable.c
index cf3b07886ae..ebe9cd91568 100644
--- a/source4/torture/basic/utable.c
+++ b/source4/torture/basic/utable.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "system/iconv.h"
#include "system/filesys.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "pstring.h"
BOOL torture_utable(void)
diff --git a/source4/torture/ldap/basic.c b/source4/torture/ldap/basic.c
index 7dfc81b692e..64c4dbfdf01 100644
--- a/source4/torture/ldap/basic.c
+++ b/source4/torture/ldap/basic.c
@@ -22,8 +22,6 @@
*/
#include "includes.h"
-#include "lib/ldb/include/ldb.h"
-#include "libcli/ldap/ldap.h"
#include "libcli/ldap/ldap_client.h"
#include "lib/cmdline/popt_common.h"
diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c
index d6c56dbd346..e6952174f6b 100644
--- a/source4/torture/ldap/cldap.c
+++ b/source4/torture/ldap/cldap.c
@@ -23,8 +23,6 @@
#include "includes.h"
#include "libcli/cldap/cldap.h"
-#include "libcli/ldap/ldap.h"
-#include "lib/events/events.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
diff --git a/source4/torture/ldap/common.c b/source4/torture/ldap/common.c
index 55356b24476..58944b27683 100644
--- a/source4/torture/ldap/common.c
+++ b/source4/torture/ldap/common.c
@@ -22,7 +22,6 @@
*/
#include "includes.h"
-#include "asn_1.h"
#include "libcli/ldap/ldap.h"
NTSTATUS torture_ldap_bind(struct ldap_connection *conn, const char *userdn, const char *password)
diff --git a/source4/torture/libnet/domain.c b/source4/torture/libnet/domain.c
index de1dfad6fff..98fb6101102 100644
--- a/source4/torture/libnet/domain.c
+++ b/source4/torture/libnet/domain.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/composite.h"
#include "libnet/libnet.h"
diff --git a/source4/torture/libnet/libnet_lookup.c b/source4/torture/libnet/libnet_lookup.c
index b0cdc8c93e0..b6f23fd58c0 100644
--- a/source4/torture/libnet/libnet_lookup.c
+++ b/source4/torture/libnet/libnet_lookup.c
@@ -22,8 +22,6 @@
#include "includes.h"
#include "lib/cmdline/popt_common.h"
#include "libnet/libnet.h"
-#include "libnet/composite.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
BOOL torture_lookup(void)
diff --git a/source4/torture/libnet/libnet_rpc.c b/source4/torture/libnet/libnet_rpc.c
index 071fe990043..9c43fef24ae 100644
--- a/source4/torture/libnet/libnet_rpc.c
+++ b/source4/torture/libnet/libnet_rpc.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "lib/cmdline/popt_common.h"
#include "libnet/libnet.h"
-#include "libnet/composite.h"
BOOL test_lsa_connect(struct libnet_context *ctx)
diff --git a/source4/torture/libnet/libnet_user.c b/source4/torture/libnet/libnet_user.c
index 60c8bce9357..207645c6d5b 100644
--- a/source4/torture/libnet/libnet_user.c
+++ b/source4/torture/libnet/libnet_user.c
@@ -20,10 +20,8 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "lib/cmdline/popt_common.h"
#include "libnet/libnet.h"
-#include "libnet/composite.h"
#define TEST_USERNAME "libnetusertest"
diff --git a/source4/torture/libnet/userinfo.c b/source4/torture/libnet/userinfo.c
index 1334763c125..3791cfbda71 100644
--- a/source4/torture/libnet/userinfo.c
+++ b/source4/torture/libnet/userinfo.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/libnet.h"
#include "libnet/composite.h"
#include "libnet/userinfo.h"
diff --git a/source4/torture/libnet/userman.c b/source4/torture/libnet/userman.c
index 6a450e8b78b..1b5960c3014 100644
--- a/source4/torture/libnet/userman.c
+++ b/source4/torture/libnet/userman.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "libnet/composite.h"
#include "libnet/userman.h"
#include "libnet/libnet.h"
diff --git a/source4/torture/local/messaging.c b/source4/torture/local/messaging.c
index c9aef1b01df..faba8304d7a 100644
--- a/source4/torture/local/messaging.c
+++ b/source4/torture/local/messaging.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "system/filesys.h"
#include "lib/events/events.h"
#include "lib/messaging/irpc.h"
diff --git a/source4/torture/local/registry.c b/source4/torture/local/registry.c
index 21b42d6129f..b1582a4e9e4 100644
--- a/source4/torture/local/registry.c
+++ b/source4/torture/local/registry.c
@@ -21,8 +21,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/security.h"
-#include "librpc/gen_ndr/ndr_epmapper.h"
#include "lib/registry/registry.h"
static BOOL test_hive(TALLOC_CTX *mem_ctx, const char *backend, const char *location)
diff --git a/source4/torture/local/resolve.c b/source4/torture/local/resolve.c
index 9087f42a72a..f86b4b726b3 100644
--- a/source4/torture/local/resolve.c
+++ b/source4/torture/local/resolve.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "lib/events/events.h"
-#include "librpc/gen_ndr/nbt.h"
static BOOL test_async_resolve(TALLOC_CTX *mem_ctx)
{
diff --git a/source4/torture/local/sddl.c b/source4/torture/local/sddl.c
index 01f4d839d97..30ce4247412 100644
--- a/source4/torture/local/sddl.c
+++ b/source4/torture/local/sddl.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
/*
diff --git a/source4/torture/nbench/nbio.c b/source4/torture/nbench/nbio.c
index 540f7092116..f12fbbcb6fd 100644
--- a/source4/torture/nbench/nbio.c
+++ b/source4/torture/nbench/nbio.c
@@ -24,7 +24,6 @@
#include "system/time.h"
#include "system/filesys.h"
#include "dlinklist.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/raw/libcliraw.h"
#define MAX_FILES 100
diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c
index 82cb62dd748..64d4825edcd 100644
--- a/source4/torture/nbt/dgram.c
+++ b/source4/torture/nbt/dgram.c
@@ -21,9 +21,7 @@
*/
#include "includes.h"
-#include "libcli/nbt/libnbt.h"
#include "libcli/dgram/libdgram.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "lib/socket/socket.h"
#include "lib/events/events.h"
diff --git a/source4/torture/nbt/query.c b/source4/torture/nbt/query.c
index f0522d52ae0..fbb4224b284 100644
--- a/source4/torture/nbt/query.c
+++ b/source4/torture/nbt/query.c
@@ -22,8 +22,6 @@
#include "includes.h"
#include "lib/events/events.h"
-#include "libcli/nbt/libnbt.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
struct result_struct {
int num_pass;
diff --git a/source4/torture/nbt/register.c b/source4/torture/nbt/register.c
index 4b5931d3414..8cbceb8e307 100644
--- a/source4/torture/nbt/register.c
+++ b/source4/torture/nbt/register.c
@@ -21,8 +21,6 @@
*/
#include "includes.h"
-#include "libcli/nbt/libnbt.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
#include "lib/socket/socket.h"
#define CHECK_VALUE(v, correct) do { \
diff --git a/source4/torture/nbt/wins.c b/source4/torture/nbt/wins.c
index 8eb8d48f9f7..76f26ac1c03 100644
--- a/source4/torture/nbt/wins.c
+++ b/source4/torture/nbt/wins.c
@@ -21,8 +21,6 @@
*/
#include "includes.h"
-#include "libcli/nbt/libnbt.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
#include "lib/socket/socket.h"
#define CHECK_VALUE(v, correct) do { \
diff --git a/source4/torture/nbt/winsbench.c b/source4/torture/nbt/winsbench.c
index 1bfc6f196cf..65f494184f6 100644
--- a/source4/torture/nbt/winsbench.c
+++ b/source4/torture/nbt/winsbench.c
@@ -22,8 +22,6 @@
#include "includes.h"
#include "lib/events/events.h"
-#include "libcli/nbt/libnbt.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
#include "lib/socket/socket.h"
struct wins_state {
diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c
index 2f024878d60..f7f9665a6de 100644
--- a/source4/torture/nbt/winsreplication.c
+++ b/source4/torture/nbt/winsreplication.c
@@ -22,11 +22,9 @@
*/
#include "includes.h"
-#include "libcli/nbt/libnbt.h"
#include "libcli/wrepl/winsrepl.h"
#include "lib/events/events.h"
#include "lib/socket/socket.h"
-#include "system/time.h"
#define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
diff --git a/source4/torture/raw/acls.c b/source4/torture/raw/acls.c
index 2a435039682..fe939f6b63f 100644
--- a/source4/torture/raw/acls.c
+++ b/source4/torture/raw/acls.c
@@ -21,9 +21,7 @@
*/
#include "includes.h"
-#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
#define BASEDIR "\\testsd"
diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c
index 44dbe97e004..a4cf1ae071a 100644
--- a/source4/torture/raw/chkpath.c
+++ b/source4/torture/raw/chkpath.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/raw/libcliraw.h"
#define BASEDIR "\\rawchkpath"
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 0fe2c894af4..7fb697ea365 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -20,7 +20,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
#include "lib/cmdline/popt_common.h"
diff --git a/source4/torture/raw/eas.c b/source4/torture/raw/eas.c
index 14f00599d91..5616d7554ee 100644
--- a/source4/torture/raw/eas.c
+++ b/source4/torture/raw/eas.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
#define BASEDIR "\\testeas"
diff --git a/source4/torture/raw/mux.c b/source4/torture/raw/mux.c
index 379e455b2b5..13a54c326f8 100644
--- a/source4/torture/raw/mux.c
+++ b/source4/torture/raw/mux.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
#define BASEDIR "\\test_mux"
diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c
index 6f115adc9e8..77c7cb30d2c 100644
--- a/source4/torture/raw/notify.c
+++ b/source4/torture/raw/notify.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/raw/libcliraw.h"
#define BASEDIR "\\test_notify"
diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c
index 5f628fd9c84..eb4066f6857 100644
--- a/source4/torture/raw/qfileinfo.c
+++ b/source4/torture/raw/qfileinfo.c
@@ -20,7 +20,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
static struct {
const char *name;
diff --git a/source4/torture/raw/rename.c b/source4/torture/raw/rename.c
index 921e7f574f6..f599e1a6c78 100644
--- a/source4/torture/raw/rename.c
+++ b/source4/torture/raw/rename.c
@@ -19,7 +19,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/raw/libcliraw.h"
#define CHECK_STATUS(status, correct) do { \
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index 2e80c438b09..7958df00d15 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "system/filesys.h"
#define BASEDIR "\\teststreams"
diff --git a/source4/torture/raw/unlink.c b/source4/torture/raw/unlink.c
index 9ff9496cd47..5a501e6a722 100644
--- a/source4/torture/raw/unlink.c
+++ b/source4/torture/raw/unlink.c
@@ -20,7 +20,6 @@
#include "includes.h"
#include "system/filesys.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/raw/libcliraw.h"
#define CHECK_STATUS(status, correct) do { \
diff --git a/source4/torture/rpc/dcom.c b/source4/torture/rpc/dcom.c
index 92559b95bf0..6328d3bd7f4 100644
--- a/source4/torture/rpc/dcom.c
+++ b/source4/torture/rpc/dcom.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_dcom.h"
#include "librpc/gen_ndr/ndr_oxidresolver.h"
BOOL torture_rpc_dcom(void)
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index e28ff798a8b..4079afba15e 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -23,12 +23,8 @@
#include "includes.h"
#include "lib/cmdline/popt_common.h"
-#include "libnet/libnet.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
-#include "librpc/gen_ndr/ndr_samr.h"
-#include "libcli/ldap/ldap.h"
#include "libcli/cldap/cldap.h"
-#include "ads.h"
struct DsSyncBindInfo {
struct dcerpc_pipe *pipe;
diff --git a/source4/torture/rpc/epmapper.c b/source4/torture/rpc/epmapper.c
index 0085751cb7d..bb4fbb41bcd 100644
--- a/source4/torture/rpc/epmapper.c
+++ b/source4/torture/rpc/epmapper.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "system/network.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
diff --git a/source4/torture/rpc/join.c b/source4/torture/rpc/join.c
index 7aed76abf46..8ea94279be6 100644
--- a/source4/torture/rpc/join.c
+++ b/source4/torture/rpc/join.c
@@ -1,7 +1,5 @@
#include "includes.h"
-#include "lib/cmdline/popt_common.h"
#include "libnet/libnet.h"
-#include "lib/ldb/include/ldb.h"
#define TORTURE_NETBIOS_NAME "smbtorturejoin"
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 1958b9cdfd6..7893661e83f 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -24,7 +24,6 @@
#include "includes.h"
#include "lib/events/events.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
#include "auth/auth.h"
#include "lib/cmdline/popt_common.h"
diff --git a/source4/torture/rpc/oxidresolve.c b/source4/torture/rpc/oxidresolve.c
index fbdd9ad2655..ffc73074822 100644
--- a/source4/torture/rpc/oxidresolve.c
+++ b/source4/torture/rpc/oxidresolve.c
@@ -23,7 +23,6 @@
#include "librpc/gen_ndr/ndr_oxidresolver.h"
#include "librpc/gen_ndr/ndr_remact.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
-#include "librpc/gen_ndr/com_dcom.h"
#define CLSID_IMAGEDOC "02B01C80-E03D-101A-B294-00DD010F2BF9"
diff --git a/source4/torture/rpc/remact.c b/source4/torture/rpc/remact.c
index 84d0a2e35c6..1d1eeae53e0 100644
--- a/source4/torture/rpc/remact.c
+++ b/source4/torture/rpc/remact.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_remact.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
-#include "librpc/gen_ndr/com_dcom.h"
#define CLSID_IMAGEDOC "02B01C80-E03D-101A-B294-00DD010F2BF9"
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index 98fea05a1d1..afcd17555ad 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -23,7 +23,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
#include "auth/auth.h"
#include "dlinklist.h"
#include "lib/crypto/crypto.h"
diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c
index 97761b6b0ed..bab0ffc4e8c 100644
--- a/source4/torture/rpc/schannel.c
+++ b/source4/torture/rpc/schannel.c
@@ -21,9 +21,7 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "lib/cmdline/popt_common.h"
#define TEST_MACHINE_NAME "schannel"
diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c
index 102e3bad910..fc582e7cc97 100644
--- a/source4/torture/rpc/svcctl.c
+++ b/source4/torture/rpc/svcctl.c
@@ -21,7 +21,6 @@
#include "includes.h"
#include "librpc/gen_ndr/ndr_svcctl.h"
-#include "librpc/gen_ndr/ndr_security.h"
static BOOL test_EnumServicesStatus(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct policy_handle *h)
{
diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c
index 80342fa8bc2..198f4fdb5b1 100644
--- a/source4/torture/rpc/testjoin.c
+++ b/source4/torture/rpc/testjoin.c
@@ -26,7 +26,6 @@
*/
#include "includes.h"
-#include "librpc/gen_ndr/ndr_samr.h"
#include "system/time.h"
#include "lib/crypto/crypto.h"
#include "libnet/libnet.h"
diff --git a/source4/torture/rpc/unixinfo.c b/source4/torture/rpc/unixinfo.c
index 24d6a30d55e..4403079862d 100644
--- a/source4/torture/rpc/unixinfo.c
+++ b/source4/torture/rpc/unixinfo.c
@@ -20,7 +20,6 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
#include "librpc/gen_ndr/ndr_unixinfo.h"
diff --git a/source4/torture/smb2/connect.c b/source4/torture/smb2/connect.c
index fe5febdf079..2077bb02276 100644
--- a/source4/torture/smb2/connect.c
+++ b/source4/torture/smb2/connect.c
@@ -21,11 +21,8 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
-#include "lib/cmdline/popt_common.h"
-#include "lib/events/events.h"
/*
send a close
diff --git a/source4/torture/smb2/find.c b/source4/torture/smb2/find.c
index 37e8db65bfd..aae8f8042f4 100644
--- a/source4/torture/smb2/find.c
+++ b/source4/torture/smb2/find.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
-#include "librpc/gen_ndr/security.h"
static struct {
const char *name;
diff --git a/source4/torture/smb2/getinfo.c b/source4/torture/smb2/getinfo.c
index 209c220e600..faf889f8ff9 100644
--- a/source4/torture/smb2/getinfo.c
+++ b/source4/torture/smb2/getinfo.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
-#include "librpc/gen_ndr/security.h"
static struct {
const char *name;
diff --git a/source4/torture/smb2/scan.c b/source4/torture/smb2/scan.c
index 03aa6dca49f..646f790e181 100644
--- a/source4/torture/smb2/scan.c
+++ b/source4/torture/smb2/scan.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
#include "lib/cmdline/popt_common.h"
diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c
index a3d6ed8d660..953ef448d94 100644
--- a/source4/torture/smb2/util.c
+++ b/source4/torture/smb2/util.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h"
#include "lib/cmdline/popt_common.h"
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 61a0af34f52..149ee78065c 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -19,16 +19,13 @@
*/
#include "includes.h"
-#include "clilist.h"
#include "lib/cmdline/popt_common.h"
#include "libcli/raw/libcliraw.h"
#include "system/time.h"
#include "system/wait.h"
#include "system/filesys.h"
#include "ioctl.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "smb_build.h"
-#include "libcli/nbt/libnbt.h"
int torture_nprocs=4;
int torture_numops=10;
diff --git a/source4/torture/torture_util.c b/source4/torture/torture_util.c
index cdc0155eccc..ce457582d3e 100644
--- a/source4/torture/torture_util.c
+++ b/source4/torture/torture_util.c
@@ -22,7 +22,6 @@
#include "libcli/raw/libcliraw.h"
#include "system/shmem.h"
#include "system/time.h"
-#include "librpc/gen_ndr/ndr_security.h"
/*
diff --git a/source4/utils/net/net_join.c b/source4/utils/net/net_join.c
index 8140108ceb7..eaa53f4c7bd 100644
--- a/source4/utils/net/net_join.c
+++ b/source4/utils/net/net_join.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "utils/net/net.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_samr.h"
int net_join(struct net_context *ctx, int argc, const char **argv)
{
diff --git a/source4/utils/net/net_password.c b/source4/utils/net/net_password.c
index 1912beeb41b..8f6b989a5da 100644
--- a/source4/utils/net/net_password.c
+++ b/source4/utils/net/net_password.c
@@ -23,7 +23,6 @@
#include "utils/net/net.h"
#include "libnet/libnet.h"
#include "system/filesys.h"
-#include "system/passwd.h"
/*
* Code for Changing and setting a password
diff --git a/source4/utils/net/net_user.c b/source4/utils/net/net_user.c
index dabb4a0d61d..82ee2085342 100644
--- a/source4/utils/net/net_user.c
+++ b/source4/utils/net/net_user.c
@@ -22,7 +22,6 @@
#include "includes.h"
#include "utils/net/net.h"
#include "libnet/libnet.h"
-#include "librpc/gen_ndr/ndr_samr.h"
static int net_user_add(struct net_context *ctx, int argc, const char **argv)
{
diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c
index 9742440efe0..eaad3203e55 100644
--- a/source4/utils/nmblookup.c
+++ b/source4/utils/nmblookup.c
@@ -23,7 +23,6 @@
*/
#include "includes.h"
-#include "libcli/nbt/libnbt.h"
#include "lib/cmdline/popt_common.h"
#include "system/iconv.h"
#include "lib/socket/socket.h"
diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c
index 54920664ec8..ffdbd2f2f68 100644
--- a/source4/utils/ntlm_auth.c
+++ b/source4/utils/ntlm_auth.c
@@ -24,10 +24,8 @@
#include "includes.h"
#include "system/filesys.h"
-#include "system/passwd.h"
#include "lib/cmdline/popt_common.h"
#include "auth/auth.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "pstring.h"
#include "smb_build.h"
diff --git a/source4/utils/setntacl.c b/source4/utils/setntacl.c
index d7fe2f0a68d..fd7cb31b6d4 100644
--- a/source4/utils/setntacl.c
+++ b/source4/utils/setntacl.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "system/filesys.h"
int main(int argc, char **argv)
{
diff --git a/source4/utils/setnttoken.c b/source4/utils/setnttoken.c
index d7fe2f0a68d..fd7cb31b6d4 100644
--- a/source4/utils/setnttoken.c
+++ b/source4/utils/setnttoken.c
@@ -21,7 +21,6 @@
*/
#include "includes.h"
-#include "system/filesys.h"
int main(int argc, char **argv)
{
diff --git a/source4/web_server/http.c b/source4/web_server/http.c
index dc8f236567d..18a1f61c1cc 100644
--- a/source4/web_server/http.c
+++ b/source4/web_server/http.c
@@ -25,8 +25,6 @@
#include "web_server/web_server.h"
#include "smbd/service_stream.h"
#include "lib/events/events.h"
-#include "system/filesys.h"
-#include "system/iconv.h"
#include "system/time.h"
#include "lib/appweb/esp/esp.h"
#include "lib/appweb/ejs/ejsInternal.h"
diff --git a/source4/winbind/wb_async_helpers.c b/source4/winbind/wb_async_helpers.c
index 330a6b4534c..e89c27000bd 100644
--- a/source4/winbind/wb_async_helpers.c
+++ b/source4/winbind/wb_async_helpers.c
@@ -23,19 +23,10 @@
#include "includes.h"
#include "libcli/composite/composite.h"
-#include "libcli/smb_composite/smb_composite.h"
#include "winbind/wb_async_helpers.h"
-#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
-#include "librpc/gen_ndr/nbt.h"
-#include "librpc/gen_ndr/samr.h"
#include "lib/messaging/irpc.h"
-#include "librpc/gen_ndr/irpc.h"
#include "librpc/gen_ndr/ndr_irpc.h"
-#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "librpc/gen_ndr/ndr_lsa.h"
#include "libcli/auth/credentials.h"
struct finddcs_state {
diff --git a/source4/winbind/wb_cmd_getdcname.c b/source4/winbind/wb_cmd_getdcname.c
index 8cca3197a19..2952ffc976a 100644
--- a/source4/winbind/wb_cmd_getdcname.c
+++ b/source4/winbind/wb_cmd_getdcname.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "libcli/composite/composite.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
diff --git a/source4/winbind/wb_cmd_list_trustdom.c b/source4/winbind/wb_cmd_list_trustdom.c
index c96da487122..cfe71faf746 100644
--- a/source4/winbind/wb_cmd_list_trustdom.c
+++ b/source4/winbind/wb_cmd_list_trustdom.c
@@ -22,9 +22,7 @@
#include "includes.h"
#include "libcli/composite/composite.h"
-#include "winbind/wb_async_helpers.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
#include "librpc/gen_ndr/ndr_lsa.h"
diff --git a/source4/winbind/wb_cmd_lookupname.c b/source4/winbind/wb_cmd_lookupname.c
index 6a7c565f91d..3d894c00648 100644
--- a/source4/winbind/wb_cmd_lookupname.c
+++ b/source4/winbind/wb_cmd_lookupname.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "libcli/composite/composite.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
struct cmd_lookupname_state {
diff --git a/source4/winbind/wb_cmd_lookupsid.c b/source4/winbind/wb_cmd_lookupsid.c
index 450fc86aaed..4733702583b 100644
--- a/source4/winbind/wb_cmd_lookupsid.c
+++ b/source4/winbind/wb_cmd_lookupsid.c
@@ -23,7 +23,6 @@
#include "includes.h"
#include "libcli/composite/composite.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
struct cmd_lookupsid_state {
diff --git a/source4/winbind/wb_cmd_userdomgroups.c b/source4/winbind/wb_cmd_userdomgroups.c
index 6021412e21e..a0ac939a1e9 100644
--- a/source4/winbind/wb_cmd_userdomgroups.c
+++ b/source4/winbind/wb_cmd_userdomgroups.c
@@ -23,10 +23,7 @@
#include "includes.h"
#include "libcli/composite/composite.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
-#include "lib/events/events.h"
-#include "librpc/gen_ndr/ndr_security.h"
struct cmd_userdomgroups_state {
struct composite_context *ctx;
diff --git a/source4/winbind/wb_cmd_usersids.c b/source4/winbind/wb_cmd_usersids.c
index 8b38ba56f42..4c107824fbe 100644
--- a/source4/winbind/wb_cmd_usersids.c
+++ b/source4/winbind/wb_cmd_usersids.c
@@ -23,10 +23,7 @@
#include "includes.h"
#include "libcli/composite/composite.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
-#include "lib/events/events.h"
-#include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/ndr_samr.h"
/* Calculate the token in two steps: Go the user's originating domain, ask for
diff --git a/source4/winbind/wb_dom_info.c b/source4/winbind/wb_dom_info.c
index 4f27243511d..1b327883389 100644
--- a/source4/winbind/wb_dom_info.c
+++ b/source4/winbind/wb_dom_info.c
@@ -23,12 +23,8 @@
#include "includes.h"
#include "libcli/composite/composite.h"
-#include "libcli/smb_composite/smb_composite.h"
-#include "winbind/wb_async_helpers.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
-#include "librpc/gen_ndr/nbt.h"
#include "librpc/gen_ndr/ndr_irpc.h"
#include "librpc/gen_ndr/samr.h"
#include "lib/messaging/irpc.h"
diff --git a/source4/winbind/wb_dom_info_trusted.c b/source4/winbind/wb_dom_info_trusted.c
index ce9e5b9c477..7c2ff0232c4 100644
--- a/source4/winbind/wb_dom_info_trusted.c
+++ b/source4/winbind/wb_dom_info_trusted.c
@@ -22,12 +22,8 @@
#include "includes.h"
#include "libcli/composite/composite.h"
-#include "libcli/smb_composite/smb_composite.h"
-#include "winbind/wb_async_helpers.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
-#include "librpc/gen_ndr/nbt.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
struct trusted_dom_info_state {
diff --git a/source4/winbind/wb_init_domain.c b/source4/winbind/wb_init_domain.c
index 8b49ed73977..c9d99ff0b97 100644
--- a/source4/winbind/wb_init_domain.c
+++ b/source4/winbind/wb_init_domain.c
@@ -23,20 +23,9 @@
#include "includes.h"
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
-#include "winbind/wb_async_helpers.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
-#include "dlinklist.h"
-
-#include "librpc/gen_ndr/nbt.h"
-#include "librpc/gen_ndr/samr.h"
-#include "lib/messaging/irpc.h"
-#include "librpc/gen_ndr/irpc.h"
-#include "librpc/gen_ndr/ndr_irpc.h"
-#include "libcli/raw/libcliraw.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
-#include "librpc/gen_ndr/ndr_lsa.h"
+
#include "libcli/auth/credentials.h"
#include "libcli/ldap/ldap_client.h"
diff --git a/source4/winbind/wb_pam_auth.c b/source4/winbind/wb_pam_auth.c
index 856d621a174..593cd22291d 100644
--- a/source4/winbind/wb_pam_auth.c
+++ b/source4/winbind/wb_pam_auth.c
@@ -23,9 +23,7 @@
#include "includes.h"
#include "libcli/composite/composite.h"
-#include "winbind/wb_async_helpers.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
#include "libcli/auth/credentials.h"
diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c
index d7496c22632..101a1d857d9 100644
--- a/source4/winbind/wb_samba3_cmd.c
+++ b/source4/winbind/wb_samba3_cmd.c
@@ -22,18 +22,12 @@
*/
#include "includes.h"
-#include "smbd/service_stream.h"
-#include "nsswitch/winbind_nss_config.h"
#include "nsswitch/winbindd_nss.h"
#include "winbind/wb_server.h"
#include "winbind/wb_samba3_protocol.h"
#include "winbind/wb_async_helpers.h"
-#include "librpc/gen_ndr/nbt.h"
-#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
-#include "libcli/smb_composite/smb_composite.h"
#include "include/version.h"
-#include "lib/events/events.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
/*
diff --git a/source4/winbind/wb_samba3_protocol.c b/source4/winbind/wb_samba3_protocol.c
index d335e1f74d2..8fffdbd0a70 100644
--- a/source4/winbind/wb_samba3_protocol.c
+++ b/source4/winbind/wb_samba3_protocol.c
@@ -21,8 +21,6 @@
*/
#include "includes.h"
-#include "smbd/service_stream.h"
-#include "nsswitch/winbind_nss_config.h"
#include "nsswitch/winbindd_nss.h"
#include "winbind/wb_server.h"
#include "winbind/wb_samba3_protocol.h"
diff --git a/source4/winbind/wb_server.c b/source4/winbind/wb_server.c
index a66bc0832f1..6bd60d209ea 100644
--- a/source4/winbind/wb_server.c
+++ b/source4/winbind/wb_server.c
@@ -22,14 +22,11 @@
#include "includes.h"
#include "lib/socket/socket.h"
-#include "system/dir.h"
-#include "system/filesys.h"
#include "dlinklist.h"
#include "lib/events/events.h"
#include "smbd/service_task.h"
#include "smbd/service_stream.h"
#include "nsswitch/winbind_nss_config.h"
-#include "nsswitch/winbindd_nss.h"
#include "winbind/wb_server.h"
void wbsrv_terminate_connection(struct wbsrv_connection *wbconn, const char *reason)
diff --git a/source4/winbind/wb_sid2domain.c b/source4/winbind/wb_sid2domain.c
index 2c19ef858f4..837e491722b 100644
--- a/source4/winbind/wb_sid2domain.c
+++ b/source4/winbind/wb_sid2domain.c
@@ -23,11 +23,7 @@
#include "includes.h"
#include "libcli/composite/composite.h"
#include "winbind/wb_server.h"
-#include "smbd/service_stream.h"
#include "smbd/service_task.h"
-#include "lib/events/events.h"
-#include "librpc/gen_ndr/nbt.h"
-#include "librpc/gen_ndr/ndr_netlogon.h"
#include "winbind/wb_async_helpers.h"
#include "include/dlinklist.h"
diff --git a/source4/wrepl_server/wrepl_apply_records.c b/source4/wrepl_server/wrepl_apply_records.c
index 9c65446942d..7fb73728e5d 100644
--- a/source4/wrepl_server/wrepl_apply_records.c
+++ b/source4/wrepl_server/wrepl_apply_records.c
@@ -21,22 +21,15 @@
*/
#include "includes.h"
-#include "dlinklist.h"
-#include "lib/events/events.h"
-#include "lib/socket/socket.h"
#include "smbd/service_task.h"
-#include "smbd/service_stream.h"
#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_irpc.h"
#include "librpc/gen_ndr/ndr_winsrepl.h"
#include "wrepl_server/wrepl_server.h"
#include "wrepl_server/wrepl_out_helpers.h"
#include "nbt_server/wins/winsdb.h"
-#include "ldb/include/ldb.h"
-#include "libcli/composite/composite.h"
#include "libcli/wrepl/winsrepl.h"
#include "system/time.h"
-#include "libcli/nbt/libnbt.h"
enum _R_ACTION {
R_INVALID,
diff --git a/source4/wrepl_server/wrepl_in_call.c b/source4/wrepl_server/wrepl_in_call.c
index b518adf920d..ebcd4f5d83f 100644
--- a/source4/wrepl_server/wrepl_in_call.c
+++ b/source4/wrepl_server/wrepl_in_call.c
@@ -21,14 +21,9 @@
*/
#include "includes.h"
-#include "dlinklist.h"
#include "lib/events/events.h"
#include "lib/socket/socket.h"
-#include "smbd/service_task.h"
#include "smbd/service_stream.h"
-#include "lib/messaging/irpc.h"
-#include "librpc/gen_ndr/ndr_winsrepl.h"
-#include "librpc/gen_ndr/ndr_nbt.h"
#include "libcli/wrepl/winsrepl.h"
#include "wrepl_server/wrepl_server.h"
#include "wrepl_server/wrepl_out_helpers.h"
diff --git a/source4/wrepl_server/wrepl_in_connection.c b/source4/wrepl_server/wrepl_in_connection.c
index a6abf99e411..f3bb5544e34 100644
--- a/source4/wrepl_server/wrepl_in_connection.c
+++ b/source4/wrepl_server/wrepl_in_connection.c
@@ -21,8 +21,6 @@
*/
#include "includes.h"
-#include "dlinklist.h"
-#include "lib/events/events.h"
#include "lib/socket/socket.h"
#include "lib/stream/packet.h"
#include "smbd/service_task.h"
@@ -30,8 +28,6 @@
#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_winsrepl.h"
#include "wrepl_server/wrepl_server.h"
-#include "nbt_server/wins/winsdb.h"
-#include "ldb/include/ldb.h"
void wreplsrv_terminate_in_connection(struct wreplsrv_in_connection *wreplconn, const char *reason)
{
diff --git a/source4/wrepl_server/wrepl_out_helpers.c b/source4/wrepl_server/wrepl_out_helpers.c
index b990880fffb..3b69b40fa07 100644
--- a/source4/wrepl_server/wrepl_out_helpers.c
+++ b/source4/wrepl_server/wrepl_out_helpers.c
@@ -21,17 +21,13 @@
*/
#include "includes.h"
-#include "dlinklist.h"
#include "lib/events/events.h"
#include "lib/socket/socket.h"
#include "smbd/service_task.h"
#include "smbd/service_stream.h"
-#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_winsrepl.h"
#include "wrepl_server/wrepl_server.h"
#include "wrepl_server/wrepl_out_helpers.h"
-#include "nbt_server/wins/winsdb.h"
-#include "ldb/include/ldb.h"
#include "libcli/composite/composite.h"
#include "libcli/wrepl/winsrepl.h"
diff --git a/source4/wrepl_server/wrepl_out_pull.c b/source4/wrepl_server/wrepl_out_pull.c
index dc2605f11b4..88b251a5a13 100644
--- a/source4/wrepl_server/wrepl_out_pull.c
+++ b/source4/wrepl_server/wrepl_out_pull.c
@@ -21,18 +21,9 @@
*/
#include "includes.h"
-#include "dlinklist.h"
-#include "lib/events/events.h"
-#include "lib/socket/socket.h"
-#include "smbd/service_task.h"
-#include "smbd/service_stream.h"
-#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_winsrepl.h"
#include "wrepl_server/wrepl_server.h"
-#include "nbt_server/wins/winsdb.h"
-#include "ldb/include/ldb.h"
#include "libcli/composite/composite.h"
-#include "libcli/wrepl/winsrepl.h"
#include "wrepl_server/wrepl_out_helpers.h"
static void wreplsrv_out_pull_reschedule(struct wreplsrv_partner *partner, uint32_t interval)
diff --git a/source4/wrepl_server/wrepl_out_push.c b/source4/wrepl_server/wrepl_out_push.c
index 10036b83435..6ac04d9f126 100644
--- a/source4/wrepl_server/wrepl_out_push.c
+++ b/source4/wrepl_server/wrepl_out_push.c
@@ -21,18 +21,9 @@
*/
#include "includes.h"
-#include "dlinklist.h"
-#include "lib/events/events.h"
-#include "lib/socket/socket.h"
-#include "smbd/service_task.h"
-#include "smbd/service_stream.h"
-#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_winsrepl.h"
#include "wrepl_server/wrepl_server.h"
-#include "nbt_server/wins/winsdb.h"
-#include "ldb/include/ldb.h"
#include "libcli/composite/composite.h"
-#include "libcli/wrepl/winsrepl.h"
#include "wrepl_server/wrepl_out_helpers.h"
static void wreplsrv_out_partner_push(struct wreplsrv_partner *partner, BOOL propagate);
diff --git a/source4/wrepl_server/wrepl_periodic.c b/source4/wrepl_server/wrepl_periodic.c
index 09554d1659a..a541d614e69 100644
--- a/source4/wrepl_server/wrepl_periodic.c
+++ b/source4/wrepl_server/wrepl_periodic.c
@@ -21,19 +21,10 @@
*/
#include "includes.h"
-#include "dlinklist.h"
#include "lib/events/events.h"
-#include "lib/socket/socket.h"
#include "smbd/service_task.h"
-#include "smbd/service_stream.h"
-#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_winsrepl.h"
#include "wrepl_server/wrepl_server.h"
-#include "nbt_server/wins/winsdb.h"
-#include "ldb/include/ldb.h"
-#include "libcli/composite/composite.h"
-#include "libcli/wrepl/winsrepl.h"
-#include "wrepl_server/wrepl_out_helpers.h"
static NTSTATUS wreplsrv_periodic_run(struct wreplsrv_service *service)
{
diff --git a/source4/wrepl_server/wrepl_scavenging.c b/source4/wrepl_server/wrepl_scavenging.c
index c0bbb41dae7..e450b66ed84 100644
--- a/source4/wrepl_server/wrepl_scavenging.c
+++ b/source4/wrepl_server/wrepl_scavenging.c
@@ -21,22 +21,12 @@
*/
#include "includes.h"
-#include "dlinklist.h"
-#include "lib/events/events.h"
-#include "lib/socket/socket.h"
-#include "smbd/service_task.h"
-#include "smbd/service_stream.h"
-#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_winsrepl.h"
#include "wrepl_server/wrepl_server.h"
#include "nbt_server/wins/winsdb.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
-#include "libcli/composite/composite.h"
-#include "libcli/wrepl/winsrepl.h"
-#include "wrepl_server/wrepl_out_helpers.h"
#include "system/time.h"
-#include "libcli/nbt/libnbt.h"
static NTSTATUS wreplsrv_scavenging_owned_records(struct wreplsrv_service *service, TALLOC_CTX *tmp_mem)
{
diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c
index aead6a19979..5f182cd5133 100644
--- a/source4/wrepl_server/wrepl_server.c
+++ b/source4/wrepl_server/wrepl_server.c
@@ -22,10 +22,7 @@
#include "includes.h"
#include "dlinklist.h"
-#include "lib/events/events.h"
-#include "lib/socket/socket.h"
#include "smbd/service_task.h"
-#include "smbd/service_stream.h"
#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_winsrepl.h"
#include "wrepl_server/wrepl_server.h"