summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/crypto/crc32.c1
-rw-r--r--lib/crypto/md4.c1
-rw-r--r--lib/replace/crypt.m42
-rw-r--r--lib/util/debug.h4
-rw-r--r--lib/util/memory.h25
-rw-r--r--lib/util/time.h7
-rw-r--r--lib/util/unix_privs.c1
-rw-r--r--lib/util/util.c1
-rw-r--r--lib/util/util.h38
-rw-r--r--lib/util/xfile.h2
-rw-r--r--libcli/nbt/nbtsocket.c1
-rw-r--r--librpc/ndr/ndr_misc.c9
-rw-r--r--librpc/ndr/ndr_orpc.c (renamed from source4/librpc/ndr/ndr_orpc.c)0
-rw-r--r--librpc/ndr/ndr_table.c2
-rw-r--r--librpc/ndr/ndr_table.h1
-rw-r--r--librpc/ndr/ndr_wmi.c (renamed from source4/librpc/ndr/ndr_wmi.c)30
-rw-r--r--librpc/ndr/ndr_wmi.h (renamed from source4/librpc/ndr/ndr_wmi.h)0
-rw-r--r--librpc/tools/ndrdump.c5
-rw-r--r--source3/Makefile.in2
-rw-r--r--source3/include/includes.h5
-rw-r--r--source3/include/proto.h250
-rw-r--r--source4/auth/auth_sam_reply.c1
-rw-r--r--source4/auth/credentials/credentials.c1
-rw-r--r--source4/auth/credentials/credentials_files.c1
-rw-r--r--source4/auth/gensec/cyrus_sasl.c2
-rw-r--r--source4/auth/gensec/gensec_gssapi.c2
-rw-r--r--source4/auth/gensec/schannel_state.c1
-rw-r--r--source4/auth/kerberos/gssapi_parse.c2
-rw-r--r--source4/auth/kerberos/kerberos.c1
-rw-r--r--source4/auth/kerberos/kerberos_heimdal.c1
-rw-r--r--source4/auth/ntlm/auth_util.c1
-rw-r--r--source4/auth/ntlm/pam_errors.c1
-rw-r--r--source4/auth/ntlm/pam_errors.h13
-rw-r--r--source4/auth/ntlmssp/ntlmssp_parse.c2
-rw-r--r--source4/auth/sam.c1
-rw-r--r--source4/cluster/ctdb/ctdb_cluster.c1
-rw-r--r--source4/dsdb/common/flag_mapping.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/anr.c4
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition.c2
-rw-r--r--source4/dsdb/samdb/ldb_modules/samldb.c4
-rw-r--r--source4/dsdb/samdb/ldb_modules/update_keytab.c4
-rw-r--r--source4/heimdal/lib/hdb/keys.c6
-rw-r--r--source4/heimdal_build/gssapi-glue.c3
-rw-r--r--source4/lib/charset/charset.h4
-rw-r--r--source4/lib/cmdline/credentials.c1
-rw-r--r--source4/lib/cmdline/popt_common.h2
-rw-r--r--source4/lib/events/events_util.c1
-rw-r--r--source4/lib/ldb/include/ldb_private.h7
-rw-r--r--source4/lib/ldb/ldb_map/ldb_map_private.h2
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c2
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c4
-rw-r--r--source4/lib/ldb/modules/paged_results.c2
-rw-r--r--source4/lib/registry/registry.h12
-rw-r--r--source4/lib/smbreadline/smbreadline.c2
-rw-r--r--source4/lib/tls/tls.c1
-rw-r--r--source4/lib/tls/tlscert.c4
-rw-r--r--source4/lib/torture/torture.c13
-rw-r--r--source4/libcli/auth/smbdes.c1
-rw-r--r--source4/libcli/ldap/ldap_controls.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/clierror.c1
-rw-r--r--source4/libcli/raw/clisocket.c1
-rw-r--r--source4/libcli/raw/rawdate.c1
-rw-r--r--source4/libcli/raw/raweas.c1
-rw-r--r--source4/libcli/raw/rawlpq.c1
-rw-r--r--source4/libcli/resolve/nbtlist.c1
-rw-r--r--source4/libnet/groupinfo.c1
-rw-r--r--source4/libnet/groupman.c1
-rw-r--r--source4/libnet/py_net.c2
-rw-r--r--source4/libnet/userinfo.c1
-rw-r--r--source4/libnet/userman.c1
-rw-r--r--source4/librpc/config.mk6
-rw-r--r--source4/librpc/idl/dcerpc.idl40
-rw-r--r--source4/librpc/idl/srvsvc.idl10
-rw-r--r--source4/nbt_server/dgram/browse.c1
-rw-r--r--source4/nbt_server/dgram/netlogon.c1
-rw-r--r--source4/ntvfs/cifs_posix_cli/svfs_util.c1
-rw-r--r--source4/ntvfs/ipc/rap_server.c2
-rw-r--r--source4/ntvfs/simple/svfs_util.c1
-rw-r--r--source4/param/share_ldb.c6
-rw-r--r--source4/rpc_server/common/server_info.c2
-rw-r--r--source4/rpc_server/common/share_info.c2
-rw-r--r--source4/rpc_server/drsuapi/dcesrv_drsuapi.c4
-rw-r--r--source4/scripting/python/modules.c1
-rw-r--r--source4/smbd/process_model.c1
-rw-r--r--source4/torture/libnet/utils.c1
-rw-r--r--source4/torture/smbtorture.c2
-rw-r--r--source4/torture/torture.c1
89 files changed, 225 insertions, 373 deletions
diff --git a/lib/crypto/crc32.c b/lib/crypto/crc32.c
index 5b9d9b108d..e6cc529767 100644
--- a/lib/crypto/crc32.c
+++ b/lib/crypto/crc32.c
@@ -41,6 +41,7 @@
*/
#include "includes.h"
+#include "../lib/crypto/crc32.h"
static const uint32_t crc32_tab[] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,
diff --git a/lib/crypto/md4.c b/lib/crypto/md4.c
index 7ad93ce786..aea2c821c5 100644
--- a/lib/crypto/md4.c
+++ b/lib/crypto/md4.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "../lib/crypto/md4.h"
/* NOTE: This code makes no attempt to be fast!
diff --git a/lib/replace/crypt.m4 b/lib/replace/crypt.m4
index 047766d470..4e90866205 100644
--- a/lib/replace/crypt.m4
+++ b/lib/replace/crypt.m4
@@ -2,6 +2,6 @@
# test for where we get crypt() from
AC_CHECK_HEADERS(crypt.h)
AC_SEARCH_LIBS_EXT(crypt, [crypt],
- [test "$ac_cv_search_crypt" = "none required" || CRYPT_LIBS="-lcrypt"
+ [test "$ac_cv_search_ext_crypt" = "none required" || CRYPT_LIBS="-lcrypt"
AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])],
[ LIBREPLACEOBJ="${LIBREPLACEOBJ} crypt.o" ])
diff --git a/lib/util/debug.h b/lib/util/debug.h
index 8f4fa2a8fc..8c634f910a 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -80,6 +80,8 @@ enum debug_logtype {DEBUG_STDOUT = 0, DEBUG_FILE = 1, DEBUG_STDERR = 2};
*/
_PUBLIC_ void dbghdr(int level, const char *location, const char *func);
+_PUBLIC_ void dbghdrclass(int level, int class, const char *location, const char *func);
+
/**
reopen the log file (usually called because the log file name might have changed)
*/
@@ -127,3 +129,5 @@ _PUBLIC_ void register_debug_handlers(const char *name, struct debug_ops *ops);
macro instead.
*/
_PUBLIC_ void dbgtext(const char *format, ...) PRINTF_ATTRIBUTE(1,2);
+
+extern XFILE *dbf;
diff --git a/lib/util/memory.h b/lib/util/memory.h
index de01492aa2..cfc13ab836 100644
--- a/lib/util/memory.h
+++ b/lib/util/memory.h
@@ -88,6 +88,31 @@
#define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2)))
#endif
+/**
+ this is a warning hack. The idea is to use this everywhere that we
+ get the "discarding const" warning from gcc. That doesn't actually
+ fix the problem of course, but it means that when we do get to
+ cleaning them up we can do it by searching the code for
+ discard_const.
+
+ It also means that other error types aren't as swamped by the noise
+ of hundreds of const warnings, so we are more likely to notice when
+ we get new errors.
+ Please only add more uses of this macro when you find it
+ _really_ hard to fix const warnings. Our aim is to eventually use
+ this function in only a very few places.
+
+ Also, please call this via the discard_const_p() macro interface, as that
+ makes the return type safe.
+*/
+#ifndef discard_const
+#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
+#endif
+
+/** Type-safe version of discard_const */
+#ifndef discard_const_p
+#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+#endif
#endif /* _SAMBA_MEMORY_H_ */
diff --git a/lib/util/time.h b/lib/util/time.h
index 1a1fcc999c..42644a3954 100644
--- a/lib/util/time.h
+++ b/lib/util/time.h
@@ -231,7 +231,12 @@ bool nt_time_equal(NTTIME *t1, NTTIME *t2);
void interpret_dos_date(uint32_t date,int *year,int *month,int *day,int *hour,int *minute,int *second);
-
struct timespec nt_time_to_unix_timespec(NTTIME *nt);
+time_t convert_timespec_to_time_t(struct timespec ts);
+
+struct timespec convert_time_t_to_timespec(time_t t);
+
+bool null_timespec(struct timespec ts);
+
#endif /* _SAMBA_TIME_H_ */
diff --git a/lib/util/unix_privs.c b/lib/util/unix_privs.c
index 47c172dcfa..f55e739a9b 100644
--- a/lib/util/unix_privs.c
+++ b/lib/util/unix_privs.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "system/filesys.h"
+#include "../lib/util/unix_privs.h"
/**
* @file
diff --git a/lib/util/util.c b/lib/util/util.c
index 1e7991dbf1..4e2a5aab09 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -283,7 +283,6 @@ _PUBLIC_ bool fcntl_lock(int fd, int op, off_t offset, off_t count, int type)
return true;
}
-
void print_asc(int level, const uint8_t *buf,int len)
{
int i;
diff --git a/lib/util/util.h b/lib/util/util.h
index 4c9a223093..fc651d58af 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -46,33 +46,6 @@ extern const char *panic_action;
#include "../lib/util/byteorder.h"
/**
- this is a warning hack. The idea is to use this everywhere that we
- get the "discarding const" warning from gcc. That doesn't actually
- fix the problem of course, but it means that when we do get to
- cleaning them up we can do it by searching the code for
- discard_const.
-
- It also means that other error types aren't as swamped by the noise
- of hundreds of const warnings, so we are more likely to notice when
- we get new errors.
-
- Please only add more uses of this macro when you find it
- _really_ hard to fix const warnings. Our aim is to eventually use
- this function in only a very few places.
-
- Also, please call this via the discard_const_p() macro interface, as that
- makes the return type safe.
-*/
-#ifndef discard_const
-#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
-#endif
-
-/** Type-safe version of discard_const */
-#ifndef discard_const_p
-#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
-#endif
-
-/**
* assert macros
*/
#define SMB_ASSERT(b) do { if (!(b)) { \
@@ -458,6 +431,9 @@ load a file into memory from a fd.
**/
_PUBLIC_ char *fd_load(int fd, size_t *size, size_t maxsize, TALLOC_CTX *mem_ctx);
+
+char **file_lines_parse(char *p, size_t size, int *numlines, TALLOC_CTX *mem_ctx);
+
/**
load a file into memory
**/
@@ -612,6 +588,8 @@ _PUBLIC_ void *smb_xmemdup(const void *p, size_t size);
**/
_PUBLIC_ char *smb_xstrdup(const char *s);
+char *smb_xstrndup(const char *s, size_t n);
+
/**
Like strdup but for memory.
**/
@@ -636,6 +614,8 @@ _PUBLIC_ bool all_zero(const uint8_t *ptr, size_t size);
*/
_PUBLIC_ void *realloc_array(void *ptr, size_t el_size, unsigned count, bool free_on_fail);
+void *malloc_array(size_t el_size, unsigned int count);
+
/* The following definitions come from lib/util/fsusage.c */
@@ -742,4 +722,8 @@ _PUBLIC_ void *talloc_check_name_abort(const void *ptr, const char *name);
#define talloc_get_type_abort(ptr, type) \
(type *)talloc_check_name_abort(ptr, #type)
+bool unmap_file(void *start, size_t size);
+
+void print_asc(int level, const uint8_t *buf,int len);
+
#endif /* _SAMBA_UTIL_H_ */
diff --git a/lib/util/xfile.h b/lib/util/xfile.h
index aa14b7c30a..af90f3f55c 100644
--- a/lib/util/xfile.h
+++ b/lib/util/xfile.h
@@ -96,4 +96,6 @@ char *x_fgets(char *s, int size, XFILE *stream) ;
* set then an error is returned */
off_t x_tseek(XFILE *f, off_t offset, int whence);
+XFILE *x_fdup(const XFILE *f);
+
#endif /* _XFILE_H_ */
diff --git a/libcli/nbt/nbtsocket.c b/libcli/nbt/nbtsocket.c
index 520e9d978a..dbbdc1b02a 100644
--- a/libcli/nbt/nbtsocket.c
+++ b/libcli/nbt/nbtsocket.c
@@ -23,6 +23,7 @@
#include "lib/events/events.h"
#include "../lib/util/dlinklist.h"
#include "../libcli/nbt/libnbt.h"
+#include "../libcli/nbt/nbt_proto.h"
#include "lib/socket/socket.h"
#include "librpc/gen_ndr/ndr_nbt.h"
#include "param/param.h"
diff --git a/librpc/ndr/ndr_misc.c b/librpc/ndr/ndr_misc.c
index 2e5ecbac6d..c4a1adb3ea 100644
--- a/librpc/ndr/ndr_misc.c
+++ b/librpc/ndr/ndr_misc.c
@@ -24,15 +24,6 @@
#include "system/network.h"
#include "librpc/ndr/libndr.h"
-_PUBLIC_ void ndr_print_in_addr(struct ndr_print *ndr, const char *name, const struct in_addr *_ip)
-{
- struct in_addr ip;
-
- ip.s_addr = htonl(_ip->s_addr);
-
- ndr->print(ndr, "%-25s: %s", name, inet_ntoa(ip));
-}
-
_PUBLIC_ void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid)
{
ndr->print(ndr, "%-25s: %s", name, GUID_string(ndr, guid));
diff --git a/source4/librpc/ndr/ndr_orpc.c b/librpc/ndr/ndr_orpc.c
index 6a55048e43..6a55048e43 100644
--- a/source4/librpc/ndr/ndr_orpc.c
+++ b/librpc/ndr/ndr_orpc.c
diff --git a/librpc/ndr/ndr_table.c b/librpc/ndr/ndr_table.c
index f7c381f22e..7ca04173f7 100644
--- a/librpc/ndr/ndr_table.c
+++ b/librpc/ndr/ndr_table.c
@@ -120,8 +120,6 @@ const struct ndr_interface_list *ndr_table_list(void)
}
-NTSTATUS ndr_table_register_builtin_tables(void);
-
NTSTATUS ndr_table_init(void)
{
static bool initialized = false;
diff --git a/librpc/ndr/ndr_table.h b/librpc/ndr/ndr_table.h
index 905c2e5e43..9e8fea1db6 100644
--- a/librpc/ndr/ndr_table.h
+++ b/librpc/ndr/ndr_table.h
@@ -8,6 +8,7 @@ const struct ndr_interface_table *ndr_table_by_name(const char *name);
const struct ndr_interface_table *ndr_table_by_uuid(const struct GUID *uuid);
const struct ndr_interface_list *ndr_table_list(void);
NTSTATUS ndr_table_init(void);
+NTSTATUS ndr_table_register_builtin_tables(void);
#endif /* _NDR_TABLE_PROTO_H_ */
diff --git a/source4/librpc/ndr/ndr_wmi.c b/librpc/ndr/ndr_wmi.c
index 6cf42471f8..2c122decf4 100644
--- a/source4/librpc/ndr/ndr_wmi.c
+++ b/librpc/ndr/ndr_wmi.c
@@ -29,36 +29,6 @@
int NDR_CHECK_depth = 0;
int NDR_CHECK_shift = 0x18;
-int get_CIMTYPE_size(int t)
-{
- if (t & CIM_FLAG_ARRAY) return 4;
- t &= 0x1FF;
- switch (t) {
- case CIM_SINT8:
- case CIM_UINT8:
- return 1;
- case CIM_SINT16:
- case CIM_UINT16:
- case CIM_BOOLEAN:
- return 2;
- case CIM_SINT32:
- case CIM_UINT32:
- case CIM_REAL32:
- case CIM_STRING:
- case CIM_DATETIME:
- case CIM_REFERENCE:
- case CIM_OBJECT:
- return 4;
- case CIM_SINT64:
- case CIM_UINT64:
- case CIM_REAL64:
- return 8;
- default:
- DEBUG(0, ("Unknown CIMTYPE size for %04X", t));
- return 4;
- }
-}
-
enum ndr_err_code ndr_push_BSTR(struct ndr_push *ndr, int ndr_flags, const struct BSTR *r)
{
uint32_t len;
diff --git a/source4/librpc/ndr/ndr_wmi.h b/librpc/ndr/ndr_wmi.h
index 539b9e882b..539b9e882b 100644
--- a/source4/librpc/ndr/ndr_wmi.h
+++ b/librpc/ndr/ndr_wmi.h
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index 3d7c644902..69b304dc9c 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -171,7 +171,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
};
ndr_table_init();
-#if (_SAMBA_BUILD_ >= 3)
+
/* Initialise samba stuff */
load_case_tables();
@@ -179,8 +179,7 @@ static void ndrdump_data(uint8_t *d, uint32_t l, bool force)
dbf = x_stderr;
- setup_logging(argv[0],True);
-#endif
+ setup_logging(argv[0], true);
pc = poptGetContext("ndrdump", argc, argv, long_options, 0);
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 56a640106c..0e1d17f29e 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -152,7 +152,7 @@ CODEPAGEDIR = @codepagedir@
# the directory where pid files go
PIDDIR = @piddir@
-FLAGS = -I. -I$(srcdir) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS) -I$(CTDBDIR)/include $(ISA) -I$(srcdir)/lib -I.. -D_SAMBA_BUILD_=3
+FLAGS = -I. -I$(srcdir) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS) -I$(CTDBDIR)/include $(ISA) -I$(srcdir)/lib -I.. -D_SAMBA_BUILD_=3 -I../source4
PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
-DPRIVATE_DIR=\"$(PRIVATE_DIR)\" \
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 9b45c408c5..c164d285c1 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -805,10 +805,6 @@ enum flush_reason_enum {
#define SYNC_DNS 1
#endif
-#ifndef HAVE_CRYPT
-#define crypt ufc_crypt
-#endif
-
#if defined(HAVE_CRYPT16) && defined(HAVE_GETAUTHUID)
#define ULTRIX_AUTH 1
#endif
@@ -1071,7 +1067,6 @@ ssize_t readahead(int fd, off64_t offset, size_t count);
#endif
#define CONST_DISCARD(type, ptr) ((type) ((void *) (ptr)))
-#define CONST_ADD(type, ptr) ((type) ((const void *) (ptr)))
void smb_panic( const char *why ) _NORETURN_;
void dump_core(void) _NORETURN_;
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 0833e5eec0..9b3950229e 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1191,6 +1191,7 @@ struct passwd *Get_Pwnam_alloc(TALLOC_CTX *mem_ctx, const char *user);
/* The following definitions come from lib/util.c */
+bool all_zero(const uint8_t *ptr, size_t size);
bool set_global_myname(const char *myname);
const char *global_myname(void);
bool set_global_myworkgroup(const char *myworkgroup);
@@ -2379,190 +2380,48 @@ ADS_STATUS gp_get_machine_token(ADS_STRUCT *ads,
const char *dn,
struct nt_user_token **token);
-/* The following definitions come from librpc/ndr/ndr.c */
-
-_PUBLIC_ size_t ndr_align_size(uint32_t offset, size_t n);
-_PUBLIC_ struct ndr_pull *ndr_pull_init_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience);
-_PUBLIC_ enum ndr_err_code ndr_pull_advance(struct ndr_pull *ndr, uint32_t size);
-_PUBLIC_ struct ndr_push *ndr_push_init_ctx(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience);
-_PUBLIC_ DATA_BLOB ndr_push_blob(struct ndr_push *ndr);
-_PUBLIC_ enum ndr_err_code ndr_push_expand(struct ndr_push *ndr, uint32_t extra_size);
-_PUBLIC_ void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, ...) _PRINTF_ATTRIBUTE(2,3);
-_PUBLIC_ void ndr_print_string_helper(struct ndr_print *ndr, const char *format, ...) _PRINTF_ATTRIBUTE(2,3);
-_PUBLIC_ void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr);
-_PUBLIC_ void ndr_print_union_debug(ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr);
-_PUBLIC_ void ndr_print_function_debug(ndr_print_function_t fn, const char *name, int flags, void *ptr);
-_PUBLIC_ char *ndr_print_struct_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, const char *name, void *ptr);
-_PUBLIC_ char *ndr_print_union_string(TALLOC_CTX *mem_ctx, ndr_print_fn_t fn, const char *name, uint32_t level, void *ptr);
-_PUBLIC_ char *ndr_print_function_string(TALLOC_CTX *mem_ctx,
- ndr_print_function_t fn, const char *name,
- int flags, void *ptr);
-_PUBLIC_ void ndr_set_flags(uint32_t *pflags, uint32_t new_flags);
-NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err);
-const char *ndr_errstr(enum ndr_err_code err);
-_PUBLIC_ enum ndr_err_code ndr_pull_error(struct ndr_pull *ndr,
- enum ndr_err_code ndr_err,
- const char *format, ...) _PRINTF_ATTRIBUTE(3,4);
-_PUBLIC_ enum ndr_err_code ndr_push_error(struct ndr_push *ndr,
- enum ndr_err_code ndr_err,
- const char *format, ...) _PRINTF_ATTRIBUTE(3,4);
-_PUBLIC_ enum ndr_err_code ndr_pull_subcontext_start(struct ndr_pull *ndr,
- struct ndr_pull **_subndr,
- size_t header_size,
- ssize_t size_is);
-_PUBLIC_ enum ndr_err_code ndr_pull_subcontext_end(struct ndr_pull *ndr,
- struct ndr_pull *subndr,
- size_t header_size,
- ssize_t size_is);
-_PUBLIC_ enum ndr_err_code ndr_push_subcontext_start(struct ndr_push *ndr,
- struct ndr_push **_subndr,
- size_t header_size,
- ssize_t size_is);
-_PUBLIC_ enum ndr_err_code ndr_push_subcontext_end(struct ndr_push *ndr,
- struct ndr_push *subndr,
- size_t header_size,
- ssize_t size_is);
-_PUBLIC_ enum ndr_err_code ndr_token_store(TALLOC_CTX *mem_ctx,
- struct ndr_token_list **list,
- const void *key,
- uint32_t value);
-_PUBLIC_ enum ndr_err_code ndr_token_retrieve_cmp_fn(struct ndr_token_list **list, const void *key, uint32_t *v,
- comparison_fn_t _cmp_fn, bool _remove_tok);
-_PUBLIC_ enum ndr_err_code ndr_token_retrieve(struct ndr_token_list **list, const void *key, uint32_t *v);
-_PUBLIC_ uint32_t ndr_token_peek(struct ndr_token_list **list, const void *key);
-_PUBLIC_ enum ndr_err_code ndr_pull_array_size(struct ndr_pull *ndr, const void *p);
-_PUBLIC_ uint32_t ndr_get_array_size(struct ndr_pull *ndr, const void *p);
-_PUBLIC_ enum ndr_err_code ndr_check_array_size(struct ndr_pull *ndr, void *p, uint32_t size);
-_PUBLIC_ enum ndr_err_code ndr_pull_array_length(struct ndr_pull *ndr, const void *p);
-_PUBLIC_ uint32_t ndr_get_array_length(struct ndr_pull *ndr, const void *p);
-_PUBLIC_ enum ndr_err_code ndr_check_array_length(struct ndr_pull *ndr, void *p, uint32_t length);
-_PUBLIC_ enum ndr_err_code ndr_push_set_switch_value(struct ndr_push *ndr, const void *p, uint32_t val);
-_PUBLIC_ enum ndr_err_code ndr_pull_set_switch_value(struct ndr_pull *ndr, const void *p, uint32_t val);
-_PUBLIC_ enum ndr_err_code ndr_print_set_switch_value(struct ndr_print *ndr, const void *p, uint32_t val);
-_PUBLIC_ uint32_t ndr_push_get_switch_value(struct ndr_push *ndr, const void *p);
-_PUBLIC_ uint32_t ndr_pull_get_switch_value(struct ndr_pull *ndr, const void *p);
-_PUBLIC_ uint32_t ndr_print_get_switch_value(struct ndr_print *ndr, const void *p);
-_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, void *p, ndr_pull_flags_fn_t fn);
-_PUBLIC_ enum ndr_err_code ndr_pull_struct_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx,
- struct smb_iconv_convenience *iconv_convenience,
- void *p, ndr_pull_flags_fn_t fn);
-_PUBLIC_ enum ndr_err_code ndr_push_struct_blob(DATA_BLOB *blob, TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, const void *p, ndr_push_flags_fn_t fn);
-_PUBLIC_ size_t ndr_size_struct(const void *p, int flags, ndr_push_flags_fn_t push);
-_PUBLIC_ size_t ndr_size_union(const void *p, int flags, uint32_t level, ndr_push_flags_fn_t push);
-_PUBLIC_ uint32_t ndr_push_get_relative_base_offset(struct ndr_push *ndr);
-_PUBLIC_ void ndr_push_restore_relative_base_offset(struct ndr_push *ndr, uint32_t offset);
-_PUBLIC_ enum ndr_err_code ndr_push_setup_relative_base_offset1(struct ndr_push *ndr, const void *p, uint32_t offset);
-_PUBLIC_ enum ndr_err_code ndr_push_setup_relative_base_offset2(struct ndr_push *ndr, const void *p);
-_PUBLIC_ enum ndr_err_code ndr_push_relative_ptr1(struct ndr_push *ndr, const void *p);
-_PUBLIC_ enum ndr_err_code ndr_push_relative_ptr2(struct ndr_push *ndr, const void *p);
-_PUBLIC_ uint32_t ndr_pull_get_relative_base_offset(struct ndr_pull *ndr);
-_PUBLIC_ void ndr_pull_restore_relative_base_offset(struct ndr_pull *ndr, uint32_t offset);
-_PUBLIC_ enum ndr_err_code ndr_pull_setup_relative_base_offset1(struct ndr_pull *ndr, const void *p, uint32_t offset);
-_PUBLIC_ enum ndr_err_code ndr_pull_setup_relative_base_offset2(struct ndr_pull *ndr, const void *p);
-_PUBLIC_ enum ndr_err_code ndr_pull_relative_ptr1(struct ndr_pull *ndr, const void *p, uint32_t rel_offset);
-_PUBLIC_ enum ndr_err_code ndr_pull_relative_ptr2(struct ndr_pull *ndr, const void *p);
-
-/* The following definitions come from librpc/ndr/ndr_basic.c */
-
-_PUBLIC_ void ndr_check_padding(struct ndr_pull *ndr, size_t n);
-_PUBLIC_ enum ndr_err_code ndr_pull_int8(struct ndr_pull *ndr, int ndr_flags, int8_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_uint8(struct ndr_pull *ndr, int ndr_flags, uint8_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_int16(struct ndr_pull *ndr, int ndr_flags, int16_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_uint16(struct ndr_pull *ndr, int ndr_flags, uint16_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_int32(struct ndr_pull *ndr, int ndr_flags, int32_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_uint32(struct ndr_pull *ndr, int ndr_flags, uint32_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_generic_ptr(struct ndr_pull *ndr, uint32_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_ref_ptr(struct ndr_pull *ndr, uint32_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_udlong(struct ndr_pull *ndr, int ndr_flags, uint64_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_udlongr(struct ndr_pull *ndr, int ndr_flags, uint64_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_dlong(struct ndr_pull *ndr, int ndr_flags, int64_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_hyper(struct ndr_pull *ndr, int ndr_flags, uint64_t *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_pointer(struct ndr_pull *ndr, int ndr_flags, void* *v);
-_PUBLIC_ enum ndr_err_code ndr_pull_NTSTATUS(struct ndr_pull *ndr, int ndr_flags, NTSTATUS *status);
-_PUBLIC_ enum ndr_err_code ndr_push_NTSTATUS(struct ndr_push *ndr, int ndr_flags, NTSTATUS status);
-_PUBLIC_ void ndr_print_NTSTATUS(struct ndr_print *ndr, const char *name, NTSTATUS r);
-_PUBLIC_ enum ndr_err_code ndr_pull_WERROR(struct ndr_pull *ndr, int ndr_flags, WERROR *status);
-_PUBLIC_ enum ndr_err_code ndr_push_WERROR(struct ndr_push *ndr, int ndr_flags, WERROR status);
-_PUBLIC_ void ndr_print_WERROR(struct ndr_print *ndr, const char *name, WERROR r);
-_PUBLIC_ enum ndr_err_code ndr_pull_bytes(struct ndr_pull *ndr, uint8_t *data, uint32_t n);
-_PUBLIC_ enum ndr_err_code ndr_pull_array_uint8(struct ndr_pull *ndr, int ndr_flags, uint8_t *data, uint32_t n);
-_PUBLIC_ enum ndr_err_code ndr_push_int8(struct ndr_push *ndr, int ndr_flags, int8_t v);
-_PUBLIC_ enum ndr_err_code ndr_push_uint8(struct ndr_push *ndr, int ndr_flags, uint8_t v);
-_PUBLIC_ enum ndr_err_code ndr_push_int16(struct ndr_push *ndr, int ndr_flags, int16_t v);
-_PUBLIC_ enum ndr_err_code ndr_push_uint16(struct ndr_push *ndr, int ndr_flags, uint16_t v);
-_PUBLIC_ enum ndr_err_code ndr_push_int32(struct ndr_push *ndr, int ndr_flags, int32_t v);
-_PUBLIC_ enum ndr_err_code ndr_push_uint32(struct ndr_push *ndr, int ndr_flags, uint32_t v);
-_PUBLIC_ enum ndr_err_code ndr_push_udlong(struct ndr_push *ndr, int ndr_flags, uint64_t v);
-_PUBLIC_ enum ndr_err_code ndr_push_udlongr(struct ndr_push *ndr, int ndr_flags, uint64_t v);
-_PUBLIC_ enum ndr_err_code ndr_push_dlong(struct ndr_push *ndr, int ndr_flags, int64_t v);
-_PUBLIC_ enum ndr_err_code ndr_push_hyper(struct ndr_push *ndr, int ndr_flags, uint64_t v);
-_PUBLIC_ enum ndr_err_code ndr_push_pointer(struct ndr_push *ndr, int ndr_flags, void* v);
-_PUBLIC_ enum ndr_err_code ndr_push_align(struct ndr_push *ndr, size_t size);
-_PUBLIC_ enum ndr_err_code ndr_pull_align(struct ndr_pull *ndr, size_t size);
-_PUBLIC_ enum ndr_err_code ndr_push_bytes(struct ndr_push *ndr, const uint8_t *data, uint32_t n);
-_PUBLIC_ enum ndr_err_code ndr_push_zero(struct ndr_push *ndr, uint32_t n);
-_PUBLIC_ enum ndr_err_code ndr_push_array_uint8(struct ndr_push *ndr, int ndr_flags, const uint8_t *data, uint32_t n);
-_PUBLIC_ enum ndr_err_code ndr_push_unique_ptr(struct ndr_push *ndr, const void *p);
-_PUBLIC_ enum ndr_err_code ndr_push_full_ptr(struct ndr_push *ndr, const void *p);
-_PUBLIC_ enum ndr_err_code ndr_push_ref_ptr(struct ndr_push *ndr);
-_PUBLIC_ enum ndr_err_code ndr_push_NTTIME(struct ndr_push *ndr, int ndr_flags, NTTIME t);
-_PUBLIC_ enum ndr_err_code ndr_pull_NTTIME(struct ndr_pull *ndr, int ndr_flags, NTTIME *t);
-_PUBLIC_ enum ndr_err_code ndr_push_NTTIME_1sec(struct ndr_push *ndr, int ndr_flags, NTTIME t);
-_PUBLIC_ enum ndr_err_code ndr_pull_NTTIME_1sec(struct ndr_pull *ndr, int ndr_flags, NTTIME *t);
-_PUBLIC_ enum ndr_err_code ndr_pull_NTTIME_hyper(struct ndr_pull *ndr, int ndr_flags, NTTIME *t);
-_PUBLIC_ enum ndr_err_code ndr_push_NTTIME_hyper(struct ndr_push *ndr, int ndr_flags, NTTIME t);
-_PUBLIC_ enum ndr_err_code ndr_push_time_t(struct ndr_push *ndr, int ndr_flags, time_t t);
-_PUBLIC_ enum ndr_err_code ndr_pull_time_t(struct ndr_pull *ndr, int ndr_flags, time_t *t);
-_PUBLIC_ enum ndr_err_code ndr_pull_ipv4address(struct ndr_pull *ndr, int ndr_flags, const char **address);
-_PUBLIC_ enum ndr_err_code ndr_push_ipv4address(struct ndr_push *ndr, int ndr_flags, const char *address);
-_PUBLIC_ void ndr_print_ipv4address(struct ndr_print *ndr, const char *name,
- const char *address);
-_PUBLIC_ void ndr_print_struct(struct ndr_print *ndr, const char *name, const char *type);
-_PUBLIC_ void ndr_print_enum(struct ndr_print *ndr, const char *name, const char *type,
- const char *val, uint32_t value);
-_PUBLIC_ void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint32_t flag, uint32_t value);
-_PUBLIC_ void ndr_print_int8(struct ndr_print *ndr, const char *name, int8_t v);
-_PUBLIC_ void ndr_print_uint8(struct ndr_print *ndr, const char *name, uint8_t v);
-_PUBLIC_ void ndr_print_int16(struct ndr_print *ndr, const char *name, int16_t v);
-_PUBLIC_ void ndr_print_uint16(struct ndr_print *ndr, const char *name, uint16_t v);
-_PUBLIC_ void ndr_print_int32(struct ndr_print *ndr, const char *name, int32_t v);
-_PUBLIC_ void ndr_print_uint32(struct ndr_print *ndr, const char *name, uint32_t v);
-_PUBLIC_ void ndr_print_udlong(struct ndr_print *ndr, const char *name, uint64_t v);
-_PUBLIC_ void ndr_print_udlongr(struct ndr_print *ndr, const char *name, uint64_t v);
-_PUBLIC_ void ndr_print_dlong(struct ndr_print *ndr, const char *name, int64_t v);
-_PUBLIC_ void ndr_print_hyper(struct ndr_print *ndr, const char *name, uint64_t v);
-_PUBLIC_ void ndr_print_pointer(struct ndr_print *ndr, const char *name, void *v);
-_PUBLIC_ void ndr_print_ptr(struct ndr_print *ndr, const char *name, const void *p);
-_PUBLIC_ void ndr_print_NTTIME(struct ndr_print *ndr, const char *name, NTTIME t);
-_PUBLIC_ void ndr_print_NTTIME_1sec(struct ndr_print *ndr, const char *name, NTTIME t);
-_PUBLIC_ void ndr_print_NTTIME_hyper(struct ndr_print *ndr, const char *name, NTTIME t);
-_PUBLIC_ void ndr_print_time_t(struct ndr_print *ndr, const char *name, time_t t);
-_PUBLIC_ void ndr_print_union(struct ndr_print *ndr, const char *name, int level, const char *type);
-_PUBLIC_ void ndr_print_bad_level(struct ndr_print *ndr, const char *name, uint16_t level);
-_PUBLIC_ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name,
- const uint8_t *data, uint32_t count);
-_PUBLIC_ void ndr_print_DATA_BLOB(struct ndr_print *ndr, const char *name, DATA_BLOB r);
-_PUBLIC_ enum ndr_err_code ndr_push_DATA_BLOB(struct ndr_push *ndr, int ndr_flags, DATA_BLOB blob);
-_PUBLIC_ enum ndr_err_code ndr_pull_DATA_BLOB(struct ndr_pull *ndr, int ndr_flags, DATA_BLOB *blob);
-_PUBLIC_ uint32_t ndr_size_DATA_BLOB(int ret, const DATA_BLOB *data, int flags);
-_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b);
-_PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss);
+#include "librpc/gen_ndr/ndr_dfs.h"
+#include "librpc/gen_ndr/ndr_dssetup.h"
+#include "librpc/gen_ndr/ndr_echo.h"
+#include "librpc/gen_ndr/ndr_eventlog.h"
+#include "librpc/gen_ndr/ndr_krb5pac.h"
+#include "librpc/gen_ndr/ndr_lsa.h"
+#include "librpc/gen_ndr/ndr_misc.h"
+#include "librpc/gen_ndr/ndr_netlogon.h"
+#include "librpc/gen_ndr/ndr_notify.h"
+#include "librpc/gen_ndr/ndr_ntsvcs.h"
+#include "librpc/gen_ndr/ndr_samr.h"
+#include "librpc/gen_ndr/ndr_security.h"
+#include "librpc/gen_ndr/ndr_srvsvc.h"
+#include "librpc/gen_ndr/ndr_svcctl.h"
+#include "librpc/gen_ndr/ndr_winreg.h"
+#include "librpc/gen_ndr/ndr_wkssvc.h"
+
+#include "librpc/gen_ndr/srv_dfs.h"
+#include "librpc/gen_ndr/srv_dssetup.h"
+#include "librpc/gen_ndr/srv_echo.h"
+#include "librpc/gen_ndr/srv_eventlog.h"
+#include "librpc/gen_ndr/srv_initshutdown.h"
+#include "librpc/gen_ndr/srv_lsa.h"
+#include "librpc/gen_ndr/srv_netlogon.h"
+#include "librpc/gen_ndr/srv_ntsvcs.h"
+#include "librpc/gen_ndr/srv_samr.h"
+#include "librpc/gen_ndr/srv_srvsvc.h"
+#include "librpc/gen_ndr/srv_svcctl.h"
+#include "librpc/gen_ndr/srv_winreg.h"
+#include "librpc/gen_ndr/srv_wkssvc.h"
+
+#include "librpc/ndr/libndr.h"
+
+/* The following definitions come from librpc/ndr/util.c */
-/* The following definitions come from librpc/ndr/ndr_krb5pac.c */
-
-enum ndr_err_code ndr_push_PAC_BUFFER(struct ndr_push *ndr, int ndr_flags, const struct PAC_BUFFER *r);
-enum ndr_err_code ndr_pull_PAC_BUFFER(struct ndr_pull *ndr, int ndr_flags, struct PAC_BUFFER *r);
-void ndr_print_PAC_BUFFER(struct ndr_print *ndr, const char *name, const struct PAC_BUFFER *r);
-
-/* The following definitions come from librpc/ndr/ndr_misc.c */
-
-bool all_zero(const uint8_t *ptr, size_t size);
-void ndr_print_GUID(struct ndr_print *ndr, const char *name, const struct GUID *guid);
-bool ndr_syntax_id_equal(const struct ndr_syntax_id *i1,
- const struct ndr_syntax_id *i2);
+NTSTATUS ndr_map_error2ntstatus(enum ndr_err_code ndr_err);
enum ndr_err_code ndr_push_server_id(struct ndr_push *ndr, int ndr_flags, const struct server_id *r);
enum ndr_err_code ndr_pull_server_id(struct ndr_pull *ndr, int ndr_flags, struct server_id *r);
void ndr_print_server_id(struct ndr_print *ndr, const char *name, const struct server_id *r);
+_PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b);
+_PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss);
+const char *ndr_errstr(enum ndr_err_code err);
/* The following definitions come from librpc/ndr/ndr_sec_helper.c */
@@ -2577,22 +2436,6 @@ void ndr_print_dom_sid2(struct ndr_print *ndr, const char *name, const struct do
void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, const struct dom_sid *sid);
void ndr_print_dom_sid0(struct ndr_print *ndr, const char *name, const struct dom_sid *sid);
-/* The following definitions come from librpc/ndr/ndr_string.c */
-
-_PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s);
-_PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s);
-_PUBLIC_ size_t ndr_string_array_size(struct ndr_push *ndr, const char *s);
-_PUBLIC_ void ndr_print_string(struct ndr_print *ndr, const char *name, const char *s);
-_PUBLIC_ uint32_t ndr_size_string(int ret, const char * const* string, int flags) ;
-_PUBLIC_ enum ndr_err_code ndr_pull_string_array(struct ndr_pull *ndr, int ndr_flags, const char ***_a);
-_PUBLIC_ enum ndr_err_code ndr_push_string_array(struct ndr_push *ndr, int ndr_flags, const char **a);
-_PUBLIC_ void ndr_print_string_array(struct ndr_print *ndr, const char *name, const char **a);
-_PUBLIC_ uint32_t ndr_string_length(const void *_var, uint32_t element_size);
-_PUBLIC_ enum ndr_err_code ndr_check_string_terminator(struct ndr_pull *ndr, uint32_t count, uint32_t element_size);
-_PUBLIC_ enum ndr_err_code ndr_pull_charset(struct ndr_pull *ndr, int ndr_flags, const char **var, uint32_t length, uint8_t byte_mul, charset_t chset);
-_PUBLIC_ enum ndr_err_code ndr_push_charset(struct ndr_push *ndr, int ndr_flags, const char *var, uint32_t length, uint8_t byte_mul, charset_t chset);
-_PUBLIC_ uint32_t ndr_charset_length(const void *var, charset_t chset);
-
/* The following definitions come from librpc/ndr/sid.c */
enum ndr_err_code ndr_push_dom_sid(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *r);
@@ -2605,20 +2448,6 @@ enum ndr_err_code ndr_push_dom_sid28(struct ndr_push *ndr, int ndr_flags, const
enum ndr_err_code ndr_pull_dom_sid0(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid);
enum ndr_err_code ndr_push_dom_sid0(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid);
-/* The following definitions come from librpc/ndr/uuid.c */
-
-_PUBLIC_ NTSTATUS GUID_from_string(const char *s, struct GUID *guid);
-_PUBLIC_ NTSTATUS NS_GUID_from_string(const char *s, struct GUID *guid);
-struct GUID GUID_random(void);
-_PUBLIC_ struct GUID GUID_zero(void);
-_PUBLIC_ bool GUID_all_zero(const struct GUID *u);
-_PUBLIC_ bool GUID_equal(const struct GUID *u1, const struct GUID *u2);
-_PUBLIC_ int GUID_compare(const struct GUID *u1, const struct GUID *u2);
-_PUBLIC_ char *GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid);
-_PUBLIC_ char *GUID_string2(TALLOC_CTX *mem_ctx, const struct GUID *guid);
-_PUBLIC_ char *NS_GUID_string(TALLOC_CTX *mem_ctx, const struct GUID *guid);
-_PUBLIC_ bool policy_handle_empty(struct policy_handle *h) ;
-
/* The following definitions come from librpc/rpc/binding.c */
const char *epm_floor_string(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor);
@@ -2925,7 +2754,6 @@ NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli,
const char *pass,
const char *domain);
NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli);
-NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli);
NTSTATUS cli_force_encryption(struct cli_state *c,
const char *username,
const char *password,
diff --git a/source4/auth/auth_sam_reply.c b/source4/auth/auth_sam_reply.c
index ea6f0a1f60..839553632e 100644
--- a/source4/auth/auth_sam_reply.c
+++ b/source4/auth/auth_sam_reply.c
@@ -24,6 +24,7 @@
#include "auth/auth.h"
#include "libcli/security/security.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
+#include "auth/auth_sam_reply.h"
NTSTATUS auth_convert_server_info_sambaseinfo(TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info *server_info,
diff --git a/source4/auth/credentials/credentials.c b/source4/auth/credentials/credentials.c
index adabe49cb4..5fb180d7b1 100644
--- a/source4/auth/credentials/credentials.c
+++ b/source4/auth/credentials/credentials.c
@@ -25,6 +25,7 @@
#include "librpc/gen_ndr/samr.h" /* for struct samrPassword */
#include "auth/credentials/credentials.h"
#include "auth/credentials/credentials_krb5.h"
+#include "auth/credentials/credentials_proto.h"
#include "libcli/auth/libcli_auth.h"
#include "lib/events/events.h"
#include "param/param.h"
diff --git a/source4/auth/credentials/credentials_files.c b/source4/auth/credentials/credentials_files.c
index 8f4f8c9561..17c555d25b 100644
--- a/source4/auth/credentials/credentials_files.c
+++ b/source4/auth/credentials/credentials_files.c
@@ -30,6 +30,7 @@
#include "../lib/util/util_ldb.h"
#include "auth/credentials/credentials.h"
#include "auth/credentials/credentials_krb5.h"
+#include "auth/credentials/credentials_proto.h"
#include "param/param.h"
#include "lib/events/events.h"
diff --git a/source4/auth/gensec/cyrus_sasl.c b/source4/auth/gensec/cyrus_sasl.c
index e8918ef66d..54d53965cc 100644
--- a/source4/auth/gensec/cyrus_sasl.c
+++ b/source4/auth/gensec/cyrus_sasl.c
@@ -319,7 +319,7 @@ static const struct gensec_security_ops gensec_sasl_security_ops = {
.priority = GENSEC_SASL
};
-int gensec_sasl_log(void *context,
+static int gensec_sasl_log(void *context,
int sasl_log_level,
const char *message)
{
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index e791226cf6..e307dbb5cb 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -1361,7 +1361,7 @@ static NTSTATUS gensec_gssapi_session_info(struct gensec_security *gensec_securi
return NT_STATUS_OK;
}
-size_t gensec_gssapi_sig_size(struct gensec_security *gensec_security, size_t data_size)
+static size_t gensec_gssapi_sig_size(struct gensec_security *gensec_security, size_t data_size)
{
struct gensec_gssapi_state *gensec_gssapi_state
= talloc_get_type(gensec_security->private_data, struct gensec_gssapi_state);
diff --git a/source4/auth/gensec/schannel_state.c b/source4/auth/gensec/schannel_state.c
index 76636bf89d..c73313f9c8 100644
--- a/source4/auth/gensec/schannel_state.c
+++ b/source4/auth/gensec/schannel_state.c
@@ -29,6 +29,7 @@
#include "libcli/auth/libcli_auth.h"
#include "auth/auth.h"
#include "param/param.h"
+#include "auth/gensec/schannel_state.h"
/**
connect to the schannel ldb
diff --git a/source4/auth/kerberos/gssapi_parse.c b/source4/auth/kerberos/gssapi_parse.c
index e5b13fc70d..489ebcaa83 100644
--- a/source4/auth/kerberos/gssapi_parse.c
+++ b/source4/auth/kerberos/gssapi_parse.c
@@ -24,6 +24,8 @@
#include "includes.h"
#include "../lib/util/asn1.h"
#include "auth/gensec/gensec.h"
+#include "system/kerberos.h"
+#include "auth/kerberos/kerberos.h"
/*
generate a krb5 GSS-API wrapper packet given a ticket
diff --git a/source4/auth/kerberos/kerberos.c b/source4/auth/kerberos/kerberos.c
index d54664fe66..1889dcab4d 100644
--- a/source4/auth/kerberos/kerberos.c
+++ b/source4/auth/kerberos/kerberos.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "system/kerberos.h"
+#include "auth/kerberos/kerberos.h"
#ifdef HAVE_KRB5
diff --git a/source4/auth/kerberos/kerberos_heimdal.c b/source4/auth/kerberos/kerberos_heimdal.c
index f669d0f2f4..44cb39c518 100644
--- a/source4/auth/kerberos/kerberos_heimdal.c
+++ b/source4/auth/kerberos/kerberos_heimdal.c
@@ -36,6 +36,7 @@
#include "includes.h"
#include "system/kerberos.h"
+#include "auth/kerberos/kerberos.h"
/* Taken from accept_sec_context.c,v 1.65 */
krb5_error_code smb_rd_req_return_stuff(krb5_context context,
diff --git a/source4/auth/ntlm/auth_util.c b/source4/auth/ntlm/auth_util.c
index 1d86b858cf..64ceb437ad 100644
--- a/source4/auth/ntlm/auth_util.c
+++ b/source4/auth/ntlm/auth_util.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "auth/auth.h"
+#include "auth/auth_proto.h"
#include "libcli/security/security.h"
#include "libcli/auth/libcli_auth.h"
#include "dsdb/samdb/samdb.h"
diff --git a/source4/auth/ntlm/pam_errors.c b/source4/auth/ntlm/pam_errors.c
index 9774ad8727..29fa4a8133 100644
--- a/source4/auth/ntlm/pam_errors.c
+++ b/source4/auth/ntlm/pam_errors.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "auth/ntlm/pam_errors.h"
#ifdef WITH_HAVE_SECURITY_PAM_APPL_H
#include <security/pam_appl.h>
diff --git a/source4/auth/ntlm/pam_errors.h b/source4/auth/ntlm/pam_errors.h
index 959e1f3517..2dfe085b77 100644
--- a/source4/auth/ntlm/pam_errors.h
+++ b/source4/auth/ntlm/pam_errors.h
@@ -20,19 +20,6 @@
#ifndef __AUTH_NTLM_PAM_ERRORS_H__
#define __AUTH_NTLM_PAM_ERRORS_H__
-/* The following definitions come from auth/pam_errors.c */
-
-
-/*****************************************************************************
-convert a PAM error to a NT status32 code
- *****************************************************************************/
-NTSTATUS pam_to_nt_status(int pam_error);
-
-/*****************************************************************************
-convert an NT status32 code to a PAM error
- *****************************************************************************/
-int nt_status_to_pam(NTSTATUS nt_status);
-
/*****************************************************************************
convert a PAM error to a NT status32 code
*****************************************************************************/
diff --git a/source4/auth/ntlmssp/ntlmssp_parse.c b/source4/auth/ntlmssp/ntlmssp_parse.c
index e1c1e7cbb3..9256872036 100644
--- a/source4/auth/ntlmssp/ntlmssp_parse.c
+++ b/source4/auth/ntlmssp/ntlmssp_parse.c
@@ -20,8 +20,8 @@
*/
#include "includes.h"
-#include "pstring.h"
#include "param/param.h"
+#include "auth/ntlmssp/msrpc_parse.h"
/*
this is a tiny msrpc packet generator. I am only using this to
diff --git a/source4/auth/sam.c b/source4/auth/sam.c
index d04a254d6c..4255a6432a 100644
--- a/source4/auth/sam.c
+++ b/source4/auth/sam.c
@@ -29,6 +29,7 @@
#include "libcli/ldap/ldap.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "param/param.h"
+#include "auth/auth_sam.h"
const char *user_attrs[] = {
/* required for the krb5 kdc */
diff --git a/source4/cluster/ctdb/ctdb_cluster.c b/source4/cluster/ctdb/ctdb_cluster.c
index 51f6d984e7..d0ceef4ad1 100644
--- a/source4/cluster/ctdb/ctdb_cluster.c
+++ b/source4/cluster/ctdb/ctdb_cluster.c
@@ -30,6 +30,7 @@
#include "../lib/util/dlinklist.h"
#include "param/param.h"
#include "librpc/gen_ndr/security.h"
+#include "cluster/ctdb/ctdb_cluster.h"
/* a linked list of messaging handlers, allowing incoming messages
to be directed to the right messaging context */
diff --git a/source4/dsdb/common/flag_mapping.c b/source4/dsdb/common/flag_mapping.c
index 4a2a079e45..dceb41be67 100644
--- a/source4/dsdb/common/flag_mapping.c
+++ b/source4/dsdb/common/flag_mapping.c
@@ -22,6 +22,8 @@
#include "includes.h"
#include "librpc/gen_ndr/samr.h"
#include "dsdb/common/flags.h"
+#include "lib/ldb/include/ldb.h"
+#include "dsdb/common/proto.h"
/*
translated the ACB_CTRL Flags to UserFlags (userAccountControl)
diff --git a/source4/dsdb/samdb/ldb_modules/anr.c b/source4/dsdb/samdb/ldb_modules/anr.c
index 028df588d6..da23030ed3 100644
--- a/source4/dsdb/samdb/ldb_modules/anr.c
+++ b/source4/dsdb/samdb/ldb_modules/anr.c
@@ -36,7 +36,7 @@
/**
* Make a and 'and' or 'or' tree from the two supplied elements
*/
-struct ldb_parse_tree *make_parse_list(struct ldb_module *module,
+static struct ldb_parse_tree *make_parse_list(struct ldb_module *module,
TALLOC_CTX *mem_ctx, enum ldb_parse_op op,
struct ldb_parse_tree *first_arm, struct ldb_parse_tree *second_arm)
{
@@ -63,7 +63,7 @@ struct ldb_parse_tree *make_parse_list(struct ldb_module *module,
/**
* Make an equality or prefix match tree, from the attribute, operation and matching value supplied
*/
-struct ldb_parse_tree *make_match_tree(struct ldb_module *module,
+static struct ldb_parse_tree *make_match_tree(struct ldb_module *module,
TALLOC_CTX *mem_ctx, enum ldb_parse_op op,
const char *attr, const DATA_BLOB *match)
{
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c
index b4a7a47a23..2a321e29c5 100644
--- a/source4/dsdb/samdb/ldb_modules/partition.c
+++ b/source4/dsdb/samdb/ldb_modules/partition.c
@@ -87,7 +87,7 @@ static struct partition_context *partition_init_ctx(struct ldb_module *module, s
* helper functions to call the next module in chain
* */
-int partition_request(struct ldb_module *module, struct ldb_request *request)
+static int partition_request(struct ldb_module *module, struct ldb_request *request)
{
int ret;
switch (request->operation) {
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index f6e735df79..95a16b5527 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -80,8 +80,8 @@ struct samldb_ctx {
struct samldb_step *curstep;
};
-struct samldb_ctx *samldb_ctx_init(struct ldb_module *module,
- struct ldb_request *req)
+static struct samldb_ctx *samldb_ctx_init(struct ldb_module *module,
+ struct ldb_request *req)
{
struct samldb_ctx *ac;
diff --git a/source4/dsdb/samdb/ldb_modules/update_keytab.c b/source4/dsdb/samdb/ldb_modules/update_keytab.c
index 2c6cb102d9..8eb49b5792 100644
--- a/source4/dsdb/samdb/ldb_modules/update_keytab.c
+++ b/source4/dsdb/samdb/ldb_modules/update_keytab.c
@@ -54,8 +54,8 @@ struct update_kt_ctx {
bool found;
};
-struct update_kt_ctx *update_kt_ctx_init(struct ldb_module *module,
- struct ldb_request *req)
+static struct update_kt_ctx *update_kt_ctx_init(struct ldb_module *module,
+ struct ldb_request *req)
{
struct update_kt_ctx *ac;
diff --git a/source4/heimdal/lib/hdb/keys.c b/source4/heimdal/lib/hdb/keys.c
index e649f445e0..a2637eb0b9 100644
--- a/source4/heimdal/lib/hdb/keys.c
+++ b/source4/heimdal/lib/hdb/keys.c
@@ -39,7 +39,7 @@ RCSID("$Id$");
* free all the memory used by (len, keys)
*/
-void
+static void
hdb_free_keys (krb5_context context, int len, Key *keys)
{
int i;
@@ -250,7 +250,7 @@ add_enctype_to_key_set(Key **key_set, size_t *nkeyset,
* it's random keys that is going to be created.
*/
-krb5_error_code
+static krb5_error_code
hdb_generate_key_set(krb5_context context, krb5_principal principal,
Key **ret_key_set, size_t *nkeyset, int no_salt)
{
@@ -362,7 +362,7 @@ hdb_generate_key_set(krb5_context context, krb5_principal principal,
}
-krb5_error_code
+static krb5_error_code
hdb_generate_key_set_password(krb5_context context,
krb5_principal principal,
const char *password,
diff --git a/source4/heimdal_build/gssapi-glue.c b/source4/heimdal_build/gssapi-glue.c
index c71b69463c..0c27f5100f 100644
--- a/source4/heimdal_build/gssapi-glue.c
+++ b/source4/heimdal_build/gssapi-glue.c
@@ -20,8 +20,9 @@
*/
#include "../replace/replace.h"
+#include "heimdal/lib/gssapi/gssapi_mech.h"
-void *__gss_ntlm_initialize(void)
+gssapi_mech_interface __gss_ntlm_initialize(void)
{
return NULL;
}
diff --git a/source4/lib/charset/charset.h b/source4/lib/charset/charset.h
index d4dae4cdad..041eaeace7 100644
--- a/source4/lib/charset/charset.h
+++ b/source4/lib/charset/charset.h
@@ -147,4 +147,8 @@ struct smb_iconv_convenience *smb_iconv_convenience_init(TALLOC_CTX *mem_ctx,
const char *dos_charset,
const char *unix_charset,
bool native_iconv);
+
+void load_case_tables(void);
+bool charset_register_backend(const void *_funcs);
+
#endif /* __CHARSET_H__ */
diff --git a/source4/lib/cmdline/credentials.c b/source4/lib/cmdline/credentials.c
index 2e5c6fd94a..f919842e6a 100644
--- a/source4/lib/cmdline/credentials.c
+++ b/source4/lib/cmdline/credentials.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "auth/credentials/credentials.h"
+#include "lib/cmdline/credentials.h"
static const char *cmdline_get_userpassword(struct cli_credentials *credentials)
{
diff --git a/source4/lib/cmdline/popt_common.h b/source4/lib/cmdline/popt_common.h
index df432bb475..733d12a443 100644
--- a/source4/lib/cmdline/popt_common.h
+++ b/source4/lib/cmdline/popt_common.h
@@ -36,4 +36,6 @@ extern struct poptOption popt_common_credentials[];
extern struct cli_credentials *cmdline_credentials;
extern struct loadparm_context *cmdline_lp_ctx;
+void popt_common_dont_ask(void);
+
#endif /* _POPT_COMMON_H */
diff --git a/source4/lib/events/events_util.c b/source4/lib/events/events_util.c
index 93f6492560..9e7d758405 100644
--- a/source4/lib/events/events_util.c
+++ b/source4/lib/events/events_util.c
@@ -22,6 +22,7 @@
#include "talloc.h"
#include "events.h"
#include "events_internal.h"
+#include "events_util.h"
#include <fcntl.h>
/**
diff --git a/source4/lib/ldb/include/ldb_private.h b/source4/lib/ldb/include/ldb_private.h
index a92549d9ce..8f7e010bee 100644
--- a/source4/lib/ldb/include/ldb_private.h
+++ b/source4/lib/ldb/include/ldb_private.h
@@ -211,6 +211,10 @@ char *ldb_casefold_default(void *context, void *mem_ctx, const char *s, size_t n
void ldb_msg_remove_element(struct ldb_message *msg, struct ldb_message_element *el);
+int ldb_msg_element_compare_name(struct ldb_message_element *el1,
+ struct ldb_message_element *el2);
+void ldb_dump_results(struct ldb_context *ldb, struct ldb_result *result, FILE *f);
+
/**
Obtain current/next database sequence number
*/
@@ -273,4 +277,7 @@ int ldb_module_done(struct ldb_request *req,
int ldb_mod_register_control(struct ldb_module *module, const char *oid);
+
+struct ldb_val ldb_binary_decode(void *mem_ctx, const char *str);
+
#endif
diff --git a/source4/lib/ldb/ldb_map/ldb_map_private.h b/source4/lib/ldb/ldb_map/ldb_map_private.h
index 5522125344..0543ba71b9 100644
--- a/source4/lib/ldb/ldb_map/ldb_map_private.h
+++ b/source4/lib/ldb/ldb_map/ldb_map_private.h
@@ -86,3 +86,5 @@ int map_return_fatal_error(struct ldb_request *req,
int map_return_normal_error(struct ldb_request *req,
struct ldb_reply *ares,
int error);
+
+int map_return_entry(struct map_context *ac, struct ldb_reply *ares);
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index 1c76411db2..6ab06c4e48 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -205,7 +205,7 @@ static struct ldb_message *ltdb_pull_attrs(struct ldb_module *module,
return LDB_ERR_NO_SUCH_OBJECT on record-not-found
and LDB_SUCCESS on success
*/
-int ltdb_search_base(struct ldb_module *module, struct ldb_dn *dn)
+static int ltdb_search_base(struct ldb_module *module, struct ldb_dn *dn)
{
struct ltdb_private *ltdb = (struct ltdb_private *)module->private_data;
TDB_DATA tdb_key, tdb_data;
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 2282f61d47..34a4e03965 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -161,7 +161,7 @@ failed:
check special dn's have valid attributes
currently only @ATTRIBUTES is checked
*/
-int ltdb_check_special_dn(struct ldb_module *module,
+static int ltdb_check_special_dn(struct ldb_module *module,
const struct ldb_message *msg)
{
int i, j;
@@ -968,7 +968,7 @@ done:
return ret;
}
-void ltdb_request_done(struct ldb_request *req, int error)
+static void ltdb_request_done(struct ldb_request *req, int error)
{
struct ldb_reply *ares;
diff --git a/source4/lib/ldb/modules/paged_results.c b/source4/lib/ldb/modules/paged_results.c
index d3bb83bbcd..1a242f1be0 100644
--- a/source4/lib/ldb/modules/paged_results.c
+++ b/source4/lib/ldb/modules/paged_results.c
@@ -70,7 +70,7 @@ struct private_data {
};
-int store_destructor(struct results_store *del)
+static int store_destructor(struct results_store *del)
{
struct private_data *priv = del->priv;
struct results_store *loop;
diff --git a/source4/lib/registry/registry.h b/source4/lib/registry/registry.h
index fe2091dde8..e89d6fd55c 100644
--- a/source4/lib/registry/registry.h
+++ b/source4/lib/registry/registry.h
@@ -508,6 +508,18 @@ WERROR reg_diff_load(const char *filename,
const struct reg_diff_callbacks *callbacks,
void *callback_data);
+WERROR reg_dotreg_diff_load(int fd,
+ struct smb_iconv_convenience *iconv_convenience,
+ const struct reg_diff_callbacks *callbacks,
+ void *callback_data);
+
+WERROR reg_preg_diff_load(int fd,
+ struct smb_iconv_convenience *iconv_convenience,
+ const struct reg_diff_callbacks *callbacks,
+ void *callback_data);
+
+WERROR local_get_predefined_key(struct registry_context *ctx,
+ uint32_t key_id, struct registry_key **key);
#endif /* _REGISTRY_H */
diff --git a/source4/lib/smbreadline/smbreadline.c b/source4/lib/smbreadline/smbreadline.c
index 314fe13471..5fb3bf4fae 100644
--- a/source4/lib/smbreadline/smbreadline.c
+++ b/source4/lib/smbreadline/smbreadline.c
@@ -29,7 +29,7 @@
This is what sys_select() used to do in Samba.
********************************************************************/
-int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tval)
+static int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tval)
{
int ret;
fd_set *readfds2, readfds_buf, *writefds2, writefds_buf, *errorfds2, errorfds_buf;
diff --git a/source4/lib/tls/tls.c b/source4/lib/tls/tls.c
index 046c2b9036..f72aafe542 100644
--- a/source4/lib/tls/tls.c
+++ b/source4/lib/tls/tls.c
@@ -363,7 +363,6 @@ struct tls_params *tls_initialise(TALLOC_CTX *mem_ctx, struct loadparm_context *
const char *crlfile = private_path(tmp_ctx, lp_ctx, lp_tls_crlfile(lp_ctx));
const char *dhpfile = private_path(tmp_ctx, lp_ctx, lp_tls_dhpfile(lp_ctx));
void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *);
-
params = talloc(mem_ctx, struct tls_params);
if (params == NULL) {
talloc_free(tmp_ctx);
diff --git a/source4/lib/tls/tlscert.c b/source4/lib/tls/tlscert.c
index 240ae056c1..f2e79f2a89 100644
--- a/source4/lib/tls/tlscert.c
+++ b/source4/lib/tls/tlscert.c
@@ -31,6 +31,10 @@
#define LIFETIME 700*24*60*60
#define DH_BITS 1024
+void tls_cert_generate(TALLOC_CTX *mem_ctx,
+ const char *keyfile, const char *certfile,
+ const char *cafile);
+
/*
auto-generate a set of self signed certificates
*/
diff --git a/source4/lib/torture/torture.c b/source4/lib/torture/torture.c
index 166bb7eb84..ba7168f3fe 100644
--- a/source4/lib/torture/torture.c
+++ b/source4/lib/torture/torture.c
@@ -235,19 +235,6 @@ void torture_ui_test_start(struct torture_context *context,
context->ui_ops->test_start(context, tcase, test);
}
-int str_list_match(const char *name, char **list)
-{
- int i, ret = 0;
- if (list == NULL)
- return 0;
-
- for (i = 0; list[i]; i++) {
- if (gen_fnmatch(list[i], name) == 0)
- ret++;
- }
- return ret;
-}
-
void torture_ui_test_result(struct torture_context *context,
enum torture_result result,
const char *comment)
diff --git a/source4/libcli/auth/smbdes.c b/source4/libcli/auth/smbdes.c
index 7f998e512d..32e65e779d 100644
--- a/source4/libcli/auth/smbdes.c
+++ b/source4/libcli/auth/smbdes.c
@@ -21,6 +21,7 @@
*/
#include "includes.h"
+#include "libcli/auth/libcli_auth.h"
/* NOTES:
diff --git a/source4/libcli/ldap/ldap_controls.c b/source4/libcli/ldap/ldap_controls.c
index b34e026b18..930d97c40d 100644
--- a/source4/libcli/ldap/ldap_controls.c
+++ b/source4/libcli/ldap/ldap_controls.c
@@ -23,6 +23,7 @@
#include "../lib/util/asn1.h"
#include "libcli/ldap/ldap.h"
#include "lib/ldb/include/ldb.h"
+#include "libcli/ldap/ldap_proto.h"
struct control_handler {
const char *oid;
diff --git a/source4/libcli/ldap/ldap_msg.c b/source4/libcli/ldap/ldap_msg.c
index c712e1e654..e45213c004 100644
--- a/source4/libcli/ldap/ldap_msg.c
+++ b/source4/libcli/ldap/ldap_msg.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "libcli/ldap/ldap.h"
#include "libcli/ldap/ldap_client.h"
+#include "libcli/ldap/ldap_proto.h"
_PUBLIC_ struct ldap_message *new_ldap_message(TALLOC_CTX *mem_ctx)
diff --git a/source4/libcli/ldap/ldap_ndr.c b/source4/libcli/ldap/ldap_ndr.c
index a10f80ae2c..5e938ea148 100644
--- a/source4/libcli/ldap/ldap_ndr.c
+++ b/source4/libcli/ldap/ldap_ndr.c
@@ -25,6 +25,7 @@
#include "libcli/ldap/ldap.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "librpc/gen_ndr/ndr_misc.h"
+#include "libcli/ldap/ldap_ndr.h"
/*
encode a NDR uint32 as a ldap filter element
diff --git a/source4/libcli/raw/clierror.c b/source4/libcli/raw/clierror.c
index 157bd847d4..a41748640b 100644
--- a/source4/libcli/raw/clierror.c
+++ b/source4/libcli/raw/clierror.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
/***************************************************************************
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index 49838e8a1c..d51ffbaa74 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -27,6 +27,7 @@
#include "lib/socket/socket.h"
#include "libcli/resolve/resolve.h"
#include "param/param.h"
+#include "libcli/raw/raw_proto.h"
struct sock_connect_state {
struct composite_context *ctx;
diff --git a/source4/libcli/raw/rawdate.c b/source4/libcli/raw/rawdate.c
index 9a86c88697..5264653cc6 100644
--- a/source4/libcli/raw/rawdate.c
+++ b/source4/libcli/raw/rawdate.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
/*******************************************************************
put a dos date into a buffer (time/date format)
diff --git a/source4/libcli/raw/raweas.c b/source4/libcli/raw/raweas.c
index 6317c49fd7..09fd4aa412 100644
--- a/source4/libcli/raw/raweas.c
+++ b/source4/libcli/raw/raweas.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "smb.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
/*
work out how many bytes on the wire a ea list will consume.
diff --git a/source4/libcli/raw/rawlpq.c b/source4/libcli/raw/rawlpq.c
index 46e0efaaf5..eddb3e0843 100644
--- a/source4/libcli/raw/rawlpq.c
+++ b/source4/libcli/raw/rawlpq.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "smb.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
/****************************************************************************
lpq - async send
diff --git a/source4/libcli/resolve/nbtlist.c b/source4/libcli/resolve/nbtlist.c
index 7dafd130f8..531ce6098f 100644
--- a/source4/libcli/resolve/nbtlist.c
+++ b/source4/libcli/resolve/nbtlist.c
@@ -30,6 +30,7 @@
#include "librpc/gen_ndr/ndr_nbt.h"
#include "../libcli/nbt/libnbt.h"
#include "param/param.h"
+#include "libcli/resolve/resolve.h"
struct nbtlist_state {
struct nbt_name name;
diff --git a/source4/libnet/groupinfo.c b/source4/libnet/groupinfo.c
index 6c8580a662..1da6646702 100644
--- a/source4/libnet/groupinfo.c
+++ b/source4/libnet/groupinfo.c
@@ -30,6 +30,7 @@
#include "libnet/userman.h"
#include "libnet/groupinfo.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
+#include "libnet/libnet_proto.h"
struct groupinfo_state {
diff --git a/source4/libnet/groupman.c b/source4/libnet/groupman.c
index 1e12c87713..58d5742336 100644
--- a/source4/libnet/groupman.c
+++ b/source4/libnet/groupman.c
@@ -26,6 +26,7 @@
#include "libnet/composite.h"
#include "libnet/groupman.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
+#include "libnet/libnet_proto.h"
struct groupadd_state {
diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c
index 3736454fa0..d5495f1e72 100644
--- a/source4/libnet/py_net.c
+++ b/source4/libnet/py_net.c
@@ -24,7 +24,7 @@
#include "libcli/security/security.h"
#include "lib/events/events.h"
-struct libnet_context *py_net_ctx(PyObject *obj, struct event_context *ev)
+static struct libnet_context *py_net_ctx(PyObject *obj, struct event_context *ev)
{
/* FIXME: Use obj */
return libnet_context_init(ev, global_loadparm);
diff --git a/source4/libnet/userinfo.c b/source4/libnet/userinfo.c
index 847997fc12..e8b6b090c7 100644
--- a/source4/libnet/userinfo.c
+++ b/source4/libnet/userinfo.c
@@ -29,6 +29,7 @@
#include "libnet/userman.h"
#include "libnet/userinfo.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
+#include "libnet/libnet_proto.h"
struct userinfo_state {
diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c
index 25ed4775cb..398d9f2cb0 100644
--- a/source4/libnet/userman.c
+++ b/source4/libnet/userman.c
@@ -27,6 +27,7 @@
#include "libnet/userman.h"
#include "libnet/userinfo.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
+#include "libnet/libnet_proto.h"
/*
* Composite USER ADD functionality
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index 6a0cd00e11..a988dcf420 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -10,8 +10,6 @@ PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBTALLOC LIBSAMBA-UTIL CHARSET \
LIBNDR_OBJ_FILES = $(addprefix $(ndrsrcdir)/, ndr_string.o) ../librpc/ndr/ndr_basic.o ../librpc/ndr/uuid.o ../librpc/ndr/ndr.o
-$(eval $(call proto_header_template,$(ndrsrcdir)/libndr_proto.h,$(LIBNDR_OBJ_FILES:.o=.c)))
-
PC_FILES += ../librpc/ndr.pc
LIBNDR_VERSION = 0.0.1
LIBNDR_SOVERSION = 0
@@ -90,7 +88,7 @@ NDR_DCOM_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dcom.o
[SUBSYSTEM::NDR_WMI]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY NDR_DCOM
-NDR_WMI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wmi.o $(ndrsrcdir)/ndr_wmi.o
+NDR_WMI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wmi.o ../librpc/ndr/ndr_wmi.o
[SUBSYSTEM::NDR_DSBACKUP]
PUBLIC_DEPENDENCIES = LIBNDR
@@ -261,7 +259,7 @@ NDR_PROTECTED_STORAGE_OBJ_FILES = $(gen_ndrsrcdir)/ndr_protected_storage.o
[SUBSYSTEM::NDR_ORPC]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_ORPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_orpc.o $(ndrsrcdir)/ndr_orpc.o
+NDR_ORPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_orpc.o ../librpc/ndr/ndr_orpc.o
[SUBSYSTEM::NDR_OXIDRESOLVER]
PUBLIC_DEPENDENCIES = LIBNDR NDR_ORPC NDR_MISC
diff --git a/source4/librpc/idl/dcerpc.idl b/source4/librpc/idl/dcerpc.idl
index a78329d990..7c0abe6ab8 100644
--- a/source4/librpc/idl/dcerpc.idl
+++ b/source4/librpc/idl/dcerpc.idl
@@ -205,26 +205,26 @@ interface dcerpc
} dcerpc_working;
typedef [enum8bit] enum {
- DCERPC_PKT_REQUEST = 0,
- DCERPC_PKT_PING = 1,
- DCERPC_PKT_RESPONSE = 2,
- DCERPC_PKT_FAULT = 3,
- DCERPC_PKT_WORKING = 4,
- DCERPC_PKT_NOCALL = 5,
- DCERPC_PKT_REJECT = 6,
- DCERPC_PKT_ACK = 7,
- DCERPC_PKT_CL_CANCEL = 8,
- DCERPC_PKT_FACK = 9,
- DCERPC_PKT_CANCEL_ACK = 10,
- DCERPC_PKT_BIND = 11,
- DCERPC_PKT_BIND_ACK = 12,
- DCERPC_PKT_BIND_NAK = 13,
- DCERPC_PKT_ALTER = 14,
- DCERPC_PKT_ALTER_RESP = 15,
- DCERPC_PKT_AUTH3 = 16,
- DCERPC_PKT_SHUTDOWN = 17,
- DCERPC_PKT_CO_CANCEL = 18,
- DCERPC_PKT_ORPHANED = 19
+ DCERPC_PKT_REQUEST = 0, /* Ordinary request. */
+ DCERPC_PKT_PING = 1, /* Connectionless is server alive ? */
+ DCERPC_PKT_RESPONSE = 2, /* Ordinary reply. */
+ DCERPC_PKT_FAULT = 3, /* Fault in processing of call. */
+ DCERPC_PKT_WORKING = 4, /* Connectionless reply to a ping when server busy. */
+ DCERPC_PKT_NOCALL = 5, /* Connectionless reply to a ping when server has lost part of clients call. */
+ DCERPC_PKT_REJECT = 6, /* Refuse a request with a code. */
+ DCERPC_PKT_ACK = 7, /* Connectionless client to server code. */
+ DCERPC_PKT_CL_CANCEL = 8, /* Connectionless cancel. */
+ DCERPC_PKT_FACK = 9, /* Connectionless fragment ack. Both client and server send. */
+ DCERPC_PKT_CANCEL_ACK = 10, /* Server ACK to client cancel request. */
+ DCERPC_PKT_BIND = 11, /* Bind to interface. */
+ DCERPC_PKT_BIND_ACK = 12, /* Server ack of bind. */
+ DCERPC_PKT_BIND_NAK = 13, /* Server nack of bind. */
+ DCERPC_PKT_ALTER = 14, /* Alter auth. */
+ DCERPC_PKT_ALTER_RESP = 15, /* Reply to alter auth. */
+ DCERPC_PKT_AUTH3 = 16, /* not the real name! this is undocumented! */
+ DCERPC_PKT_SHUTDOWN = 17, /* Server to client request to shutdown. */
+ DCERPC_PKT_CO_CANCEL = 18, /* Connection-oriented cancel request. */
+ DCERPC_PKT_ORPHANED = 19 /* Client telling server it's aborting a partially sent request or telling server to stop sending replies. */
} dcerpc_pkt_type;
typedef [nodiscriminant] union {
diff --git a/source4/librpc/idl/srvsvc.idl b/source4/librpc/idl/srvsvc.idl
index 703f3281cf..10807cd6af 100644
--- a/source4/librpc/idl/srvsvc.idl
+++ b/source4/librpc/idl/srvsvc.idl
@@ -65,7 +65,7 @@ import "security.idl", "svcctl.idl";
/******************/
/* Function: 0x01 */
WERROR srvsvc_NetCharDevGetInfo(
- [in,unique] [string,charset(UTF16)] uint16 *server_unc,
+ [in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in] [string,charset(UTF16)] uint16 device_name[],
[in] uint32 level,
[out,switch_is(level)] srvsvc_NetCharDevInfo info
@@ -74,7 +74,7 @@ import "security.idl", "svcctl.idl";
/******************/
/* Function: 0x02 */
WERROR srvsvc_NetCharDevControl(
- [in,unique] [string,charset(UTF16)] uint16 *server_unc,
+ [in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in] [string,charset(UTF16)] uint16 device_name[],
[in] uint32 opcode
);
@@ -131,7 +131,7 @@ import "security.idl", "svcctl.idl";
/******************/
/* Function: 0x04 */
WERROR srvsvc_NetCharDevQGetInfo(
- [in,unique] [string,charset(UTF16)] uint16 *server_unc,
+ [in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in] [string,charset(UTF16)] uint16 queue_name[],
[in] [string,charset(UTF16)] uint16 user[],
[in] uint32 level,
@@ -151,14 +151,14 @@ import "security.idl", "svcctl.idl";
/******************/
/* Function: 0x06 */
WERROR srvsvc_NetCharDevQPurge(
- [in,unique] [string,charset(UTF16)] uint16 *server_unc,
+ [in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in] [string,charset(UTF16)] uint16 queue_name[]
);
/******************/
/* Function: 0x07 */
WERROR srvsvc_NetCharDevQPurgeSelf(
- [in,unique] [string,charset(UTF16)] uint16 *server_unc,
+ [in,unique] [string,charset(UTF16)] uint16 *server_unc,
[in] [string,charset(UTF16)] uint16 queue_name[],
[in] [string,charset(UTF16)] uint16 computer_name[]
);
diff --git a/source4/nbt_server/dgram/browse.c b/source4/nbt_server/dgram/browse.c
index 2e12fa114a..1ebc88fcd4 100644
--- a/source4/nbt_server/dgram/browse.c
+++ b/source4/nbt_server/dgram/browse.c
@@ -23,6 +23,7 @@
#include "nbt_server/nbt_server.h"
#include "lib/socket/socket.h"
#include "librpc/gen_ndr/ndr_nbt.h"
+#include "nbt_server/dgram/proto.h"
static const char *nbt_browse_opcode_string(enum nbt_browse_opcode r)
{
diff --git a/source4/nbt_server/dgram/netlogon.c b/source4/nbt_server/dgram/netlogon.c
index c5b16fbd75..a3a7552f6a 100644
--- a/source4/nbt_server/dgram/netlogon.c
+++ b/source4/nbt_server/dgram/netlogon.c
@@ -31,6 +31,7 @@
#include "smbd/service_task.h"
#include "cldap_server/cldap_server.h"
#include "libcli/security/security.h"
+#include "nbt_server/dgram/proto.h"
/*
reply to a GETDC request
diff --git a/source4/ntvfs/cifs_posix_cli/svfs_util.c b/source4/ntvfs/cifs_posix_cli/svfs_util.c
index 42d869209d..e502340229 100644
--- a/source4/ntvfs/cifs_posix_cli/svfs_util.c
+++ b/source4/ntvfs/cifs_posix_cli/svfs_util.c
@@ -31,6 +31,7 @@
#include "system/time.h"
#include "system/dir.h"
#include "ntvfs/ntvfs.h"
+#include "ntvfs/cifs_posix_cli/proto.h"
/*
convert a windows path to a unix path - don't do any manging or case sensitive handling
diff --git a/source4/ntvfs/ipc/rap_server.c b/source4/ntvfs/ipc/rap_server.c
index d9fb7e21b2..077ecaf79f 100644
--- a/source4/ntvfs/ipc/rap_server.c
+++ b/source4/ntvfs/ipc/rap_server.c
@@ -24,6 +24,8 @@
#include "librpc/gen_ndr/srvsvc.h"
#include "rpc_server/common/common.h"
#include "param/param.h"
+#include "ntvfs/ipc/ipc.h"
+#include "ntvfs/ipc/proto.h"
/* At this moment these are just dummy functions, but you might get the
* idea. */
diff --git a/source4/ntvfs/simple/svfs_util.c b/source4/ntvfs/simple/svfs_util.c
index 286c556e30..a0cdbe9c39 100644
--- a/source4/ntvfs/simple/svfs_util.c
+++ b/source4/ntvfs/simple/svfs_util.c
@@ -28,6 +28,7 @@
#include "system/time.h"
#include "system/dir.h"
#include "ntvfs/ntvfs.h"
+#include "ntvfs/simple/proto.h"
/*
convert a windows path to a unix path - don't do any manging or case sensitive handling
diff --git a/source4/param/share_ldb.c b/source4/param/share_ldb.c
index 4896a71048..29664c7177 100644
--- a/source4/param/share_ldb.c
+++ b/source4/param/share_ldb.c
@@ -287,7 +287,7 @@ static NTSTATUS sldb_get_config(TALLOC_CTX *mem_ctx,
goto done; \
} } while(0)
-NTSTATUS sldb_create(struct share_context *ctx, const char *name, struct share_info *info, int count)
+static NTSTATUS sldb_create(struct share_context *ctx, const char *name, struct share_info *info, int count)
{
struct ldb_context *ldb;
struct ldb_message *msg;
@@ -426,7 +426,7 @@ done:
goto done; \
} } while(0)
-NTSTATUS sldb_set(struct share_context *ctx, const char *name, struct share_info *info, int count)
+static NTSTATUS sldb_set(struct share_context *ctx, const char *name, struct share_info *info, int count)
{
struct ldb_context *ldb;
struct ldb_message *msg;
@@ -535,7 +535,7 @@ done:
return ret;
}
-NTSTATUS sldb_remove(struct share_context *ctx, const char *name)
+static NTSTATUS sldb_remove(struct share_context *ctx, const char *name)
{
struct ldb_context *ldb;
struct ldb_dn *dn;
diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c
index da034e85ea..ab04b3af1f 100644
--- a/source4/rpc_server/common/server_info.c
+++ b/source4/rpc_server/common/server_info.c
@@ -26,6 +26,8 @@
#include "dsdb/samdb/samdb.h"
#include "auth/auth.h"
#include "param/param.h"
+#include "rpc_server/common/common.h"
+#include "rpc_server/common/proto.h"
/*
Here are common server info functions used by some dcerpc server interfaces
diff --git a/source4/rpc_server/common/share_info.c b/source4/rpc_server/common/share_info.c
index b27dc37949..130babd175 100644
--- a/source4/rpc_server/common/share_info.c
+++ b/source4/rpc_server/common/share_info.c
@@ -23,6 +23,8 @@
#include "param/share.h"
#include "librpc/gen_ndr/srvsvc.h"
#include "rpc_server/dcerpc_server.h"
+#include "rpc_server/common/common.h"
+#include "rpc_server/common/proto.h"
/*
Here are common server info functions used by some dcerpc server interfaces
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
index a84f24a3e8..6af8ea50b5 100644
--- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
+++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
@@ -330,7 +330,7 @@ static WERROR dcesrv_drsuapi_DsGetNT4ChangeLog(struct dcesrv_call_state *dce_cal
/*
drsuapi_DsCrackNames
*/
-WERROR dcesrv_drsuapi_DsCrackNames(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
+static WERROR dcesrv_drsuapi_DsCrackNames(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct drsuapi_DsCrackNames *r)
{
WERROR status;
@@ -478,7 +478,7 @@ static WERROR dcesrv_DRSUAPI_REMOVE_DS_DOMAIN(struct dcesrv_call_state *dce_call
}
/* Obtain the site name from a server DN */
-const char *result_site_name(struct ldb_dn *site_dn)
+static const char *result_site_name(struct ldb_dn *site_dn)
{
/* Format is cn=<NETBIOS name>,cn=Servers,cn=<site>,cn=sites.... */
const struct ldb_val *val = ldb_dn_get_component_val(site_dn, 2);
diff --git a/source4/scripting/python/modules.c b/source4/scripting/python/modules.c
index 0fe15b2fda..e53f4cfaf2 100644
--- a/source4/scripting/python/modules.c
+++ b/source4/scripting/python/modules.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
+#include "scripting/python/modules.h"
#include <Python.h>
extern void init_ldb(void);
diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c
index d99d517d9f..d6346a06f9 100644
--- a/source4/smbd/process_model.c
+++ b/source4/smbd/process_model.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "smbd/process_model.h"
+#include "smbd/process_model_proto.h"
#include "param/param.h"
static const struct model_ops *process_model_byname(const char *name);
diff --git a/source4/torture/libnet/utils.c b/source4/torture/libnet/utils.c
index d4124cc823..4a55eaa56c 100644
--- a/source4/torture/libnet/utils.c
+++ b/source4/torture/libnet/utils.c
@@ -27,6 +27,7 @@
#include "libnet/libnet.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
#include "param/param.h"
+#include "torture/libnet/utils.h"
bool test_opendomain(struct torture_context *tctx,
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index 302fefcc88..8d195f1253 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -474,7 +474,7 @@ const static struct torture_ui_ops quiet_ui_ops = {
.test_result = quiet_test_result
};
-void run_shell(struct torture_context *tctx)
+static void run_shell(struct torture_context *tctx)
{
char *cline;
int argc;
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 6c49cf01cd..dc98c2cc9a 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -24,6 +24,7 @@
#include "../lib/util/dlinklist.h"
#include "param/param.h"
#include "lib/cmdline/popt_common.h"
+#include "torture/smbtorture.h"
_PUBLIC_ int torture_numops=10;
_PUBLIC_ int torture_entries=1000;