summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/SConstruct4
-rw-r--r--source4/build/m4/rewrite.m41
-rw-r--r--source4/client/client.c2
-rw-r--r--source4/gtk/common/credentials.c1
-rw-r--r--source4/heimdal_build/config.h4
-rw-r--r--source4/include/credentials.h2
-rw-r--r--source4/include/includes.h20
-rw-r--r--source4/include/local.h3
-rw-r--r--source4/include/smb_macros.h3
-rw-r--r--source4/include/structs.h4
-rw-r--r--source4/include/system/readline.h44
-rw-r--r--source4/lib/SConscript2
-rw-r--r--source4/lib/cmdline/popt_common.c1
-rw-r--r--source4/lib/cmdline/readline.c26
-rw-r--r--source4/lib/credentials.c1
-rw-r--r--source4/lib/replace/SConscript1
-rw-r--r--source4/lib/replace/config.m41
-rw-r--r--source4/lib/replace/win32/replace.h12
-rw-r--r--source4/lib/samba3/secrets.c1
-rw-r--r--source4/ntvfs/cifs/vfs_cifs.c1
-rw-r--r--source4/rpc_server/remote/dcesrv_remote.c1
-rw-r--r--source4/scripting/ejs/smbcalls_cli.c1
-rw-r--r--source4/scripting/ejs/smbcalls_creds.c1
-rw-r--r--source4/torture/basic/secleak.c1
-rw-r--r--source4/torture/gentest.c1
-rw-r--r--source4/torture/locktest.c1
-rw-r--r--source4/torture/masktest.c1
-rw-r--r--source4/torture/rpc/samlogon.c1
-rw-r--r--source4/torture/rpc/samsync.c1
-rw-r--r--source4/torture/rpc/schannel.c1
-rw-r--r--source4/utils/ntlm_auth.c1
31 files changed, 91 insertions, 54 deletions
diff --git a/source4/SConstruct b/source4/SConstruct
index 6e38428b56..297147fbe3 100644
--- a/source4/SConstruct
+++ b/source4/SConstruct
@@ -9,9 +9,9 @@
#
# TODO:
# - finish fallback code
-# - finish proto code
# - support for init functions
# - separate config file for lib/replace/
+# - Subsystem() ?
import cPickle, string, os
@@ -30,6 +30,8 @@ hostenv = Environment(
CPPDEFINES={'_SAMBA_BUILD_': None},
)
+hostenv.Help(opts.GenerateHelpText(hostenv))
+
# We don't care about NFS builds...
hostenv.SetOption('max_drift', 1)
diff --git a/source4/build/m4/rewrite.m4 b/source4/build/m4/rewrite.m4
index 9a61d2add0..846a9e2ceb 100644
--- a/source4/build/m4/rewrite.m4
+++ b/source4/build/m4/rewrite.m4
@@ -79,7 +79,6 @@ AC_DIRENT_D_OFF
AC_CHECK_TYPE(ino_t,unsigned)
AC_CHECK_TYPE(loff_t,off_t)
AC_CHECK_TYPE(offset_t,loff_t)
-AC_CHECK_TYPES(ssize_t)
AC_CHECK_TYPES(intptr_t)
AC_CHECK_TYPES(long long)
diff --git a/source4/client/client.c b/source4/client/client.c
index bd40c97efd..0bd4a4c98a 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -32,6 +32,8 @@
#include "system/dir.h"
#include "system/filesys.h"
#include "dlinklist.h"
+#include "credentials.h"
+#include "system/readline.h"
#ifndef REGISTER
#define REGISTER 0
diff --git a/source4/gtk/common/credentials.c b/source4/gtk/common/credentials.c
index 01132ec6bd..176fe08c21 100644
--- a/source4/gtk/common/credentials.c
+++ b/source4/gtk/common/credentials.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "gtk/common/gtk-smb.h"
+#include "include/credentials.h"
static void gtk_get_credentials(struct cli_credentials *credentials)
{
diff --git a/source4/heimdal_build/config.h b/source4/heimdal_build/config.h
index f185307b31..660739c73f 100644
--- a/source4/heimdal_build/config.h
+++ b/source4/heimdal_build/config.h
@@ -63,4 +63,8 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg }
#define HAVE_STRNDUP
#endif
+#ifndef HAVE_SSIZE_T
+#define HAVE_SSIZE_T
+#endif
+
#endif
diff --git a/source4/include/credentials.h b/source4/include/credentials.h
index 5dadbbd1c5..4b9c1363f9 100644
--- a/source4/include/credentials.h
+++ b/source4/include/credentials.h
@@ -21,6 +21,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+struct ccache_container;
+
/* In order of priority */
enum credentials_obtained {
CRED_UNINITIALISED = 0, /* We don't even have a guess yet */
diff --git a/source4/include/includes.h b/source4/include/includes.h
index 3636dec58d..882c8e6277 100644
--- a/source4/include/includes.h
+++ b/source4/include/includes.h
@@ -64,18 +64,6 @@
#include <varargs.h>
#endif
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
-
-#ifdef HAVE_WS2TCPIP_H
-#include <ws2tcpip.h>
-#endif
-
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
/* we support ADS if we want it and have krb5 and ldap libs */
#if defined(WITH_ADS) && defined(HAVE_KRB5) && defined(HAVE_LDAP)
#define HAVE_ADS
@@ -131,9 +119,6 @@ struct ipv4_addr {
#include "ntvfs/ntvfs.h"
#include "cli_context.h"
#include "lib/com/com.h"
-#include "credentials.h"
-
-
#define malloc_p(type) (type *)malloc(sizeof(type))
#define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count)
@@ -189,10 +174,6 @@ extern int DEBUGLEVEL;
#endif
#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
-#ifndef HAVE_SSIZE_T
-#define ssize_t int
-#endif
-
#ifndef UINT16_MAX
#define UINT16_MAX 65535
#endif
@@ -203,4 +184,3 @@ extern int DEBUGLEVEL;
#define smb_xmalloc_p(type) (type *)smb_xmalloc(sizeof(type))
#endif /* _INCLUDES_H */
-
diff --git a/source4/include/local.h b/source4/include/local.h
index ae17f576bd..9c42b9b9ff 100644
--- a/source4/include/local.h
+++ b/source4/include/local.h
@@ -109,9 +109,6 @@
/* the default netbios keepalive timeout */
#define DEFAULT_KEEPALIVE 300
-/* the directory to sit in when idle */
-/* #define IDLE_DIR "/" */
-
/* Timout (in seconds) to wait for an oplock break
message to return from the client. */
diff --git a/source4/include/smb_macros.h b/source4/include/smb_macros.h
index aee2adf38f..f5ac3ac96d 100644
--- a/source4/include/smb_macros.h
+++ b/source4/include/smb_macros.h
@@ -44,9 +44,6 @@
DEBUG(0,("PANIC: assert failed at %s(%d)\n", __FILE__, __LINE__)); \
smb_panic("assert failed"); }} while (0)
-/* REWRITE TODO: remove these smb_xxx macros */
-#define smb_buf(buf) (((char *)(buf)) + MIN_SMB_SIZE + CVAL(buf,HDR_WCT+4)*2)
-
#define smb_len(buf) (PVAL(buf,3)|(PVAL(buf,2)<<8)|(PVAL(buf,1)<<16))
#define _smb_setlen(buf,len) do {(buf)[0] = 0; (buf)[1] = ((len)&0x10000)>>16; \
(buf)[2] = ((len)&0xFF00)>>8; (buf)[3] = (len)&0xFF;} while (0)
diff --git a/source4/include/structs.h b/source4/include/structs.h
index ca28c1fc7a..e09d9bb242 100644
--- a/source4/include/structs.h
+++ b/source4/include/structs.h
@@ -297,3 +297,7 @@ struct ldb_map_objectclass;
struct param_context;
struct param_section;
struct param;
+
+enum credentials_obtained;
+struct cli_credentials;
+struct ccache_container;
diff --git a/source4/include/system/readline.h b/source4/include/system/readline.h
new file mode 100644
index 0000000000..c3e565399d
--- /dev/null
+++ b/source4/include/system/readline.h
@@ -0,0 +1,44 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ readline wrappers
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifdef HAVE_LIBREADLINE
+# ifdef HAVE_READLINE_READLINE_H
+# include <readline/readline.h>
+# ifdef HAVE_READLINE_HISTORY_H
+# include <readline/history.h>
+# endif
+# else
+# ifdef HAVE_READLINE_H
+# include <readline.h>
+# ifdef HAVE_HISTORY_H
+# include <history.h>
+# endif
+# else
+# undef HAVE_LIBREADLINE
+# endif
+# endif
+#endif
+
+#ifdef HAVE_NEW_LIBREADLINE
+# define RL_COMPLETION_CAST (rl_completion_func_t *)
+#else
+/* This type is missing from libreadline<4.0 (approximately) */
+# define RL_COMPLETION_CAST
+#endif /* HAVE_NEW_LIBREADLINE */
diff --git a/source4/lib/SConscript b/source4/lib/SConscript
index c41b6ea067..a184eecd10 100644
--- a/source4/lib/SConscript
+++ b/source4/lib/SConscript
@@ -13,7 +13,7 @@ basic_files = ['version.c', 'xfile.c', 'debug.c', 'fault.c',
proto_files = basic_files
-basic = hostenv.StaticLibrary('basic', [dynconfig,charset,talloc,basic_files])
+basic = hostenv.StaticLibrary('basic', [dynconfig,charset,talloc,basic_files,charset])
Export('basic')
hostenv.StaticLibrary('tdr', ['tdr/tdr.c'])
diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c
index 43ea203b78..76c8a537e3 100644
--- a/source4/lib/cmdline/popt_common.c
+++ b/source4/lib/cmdline/popt_common.c
@@ -25,6 +25,7 @@
#include "system/filesys.h"
#include "system/passwd.h"
#include "lib/cmdline/popt_common.h"
+#include "credentials.h"
/* Handle command line options:
* -d,--debuglevel
diff --git a/source4/lib/cmdline/readline.c b/source4/lib/cmdline/readline.c
index 7928b8db2e..52f45eb759 100644
--- a/source4/lib/cmdline/readline.c
+++ b/source4/lib/cmdline/readline.c
@@ -23,31 +23,7 @@
#include "pstring.h"
#include <unistd.h>
-
-#ifdef HAVE_LIBREADLINE
-# ifdef HAVE_READLINE_READLINE_H
-# include <readline/readline.h>
-# ifdef HAVE_READLINE_HISTORY_H
-# include <readline/history.h>
-# endif
-# else
-# ifdef HAVE_READLINE_H
-# include <readline.h>
-# ifdef HAVE_HISTORY_H
-# include <history.h>
-# endif
-# else
-# undef HAVE_LIBREADLINE
-# endif
-# endif
-#endif
-
-#ifdef HAVE_NEW_LIBREADLINE
-# define RL_COMPLETION_CAST (rl_completion_func_t *)
-#else
-/* This type is missing from libreadline<4.0 (approximately) */
-# define RL_COMPLETION_CAST
-#endif /* HAVE_NEW_LIBREADLINE */
+#include "system/readline.h"
/****************************************************************************
Display the prompt and wait for input. Call callback() regularly
diff --git a/source4/lib/credentials.c b/source4/lib/credentials.c
index 045047d358..166d60b00d 100644
--- a/source4/lib/credentials.c
+++ b/source4/lib/credentials.c
@@ -27,6 +27,7 @@
#include "librpc/gen_ndr/ndr_samr.h" /* for struct samrPassword */
#include "system/kerberos.h"
#include "auth/kerberos/kerberos.h"
+#include "include/credentials.h"
/**
diff --git a/source4/lib/replace/SConscript b/source4/lib/replace/SConscript
index 47bfa481f2..f45d0e7d5a 100644
--- a/source4/lib/replace/SConscript
+++ b/source4/lib/replace/SConscript
@@ -51,6 +51,7 @@ int main() {
'u_int32_t': 'unsigned long',
'int64_t': 'long long',
'uint64_t': 'unsigned long long',
+ 'ssize_t': 'int'
}
type_headers = """
diff --git a/source4/lib/replace/config.m4 b/source4/lib/replace/config.m4
index 2b8d4ca3d1..0b95079b24 100644
--- a/source4/lib/replace/config.m4
+++ b/source4/lib/replace/config.m4
@@ -10,6 +10,7 @@ AC_CHECK_TYPE(uint64_t, unsigned long long)
AC_CHECK_TYPE(u_int32_t, unsigned long)
AC_CHECK_TYPE(u_int16_t, unsigned short)
AC_CHECK_TYPE(u_int8_t, unsigned char)
+AC_CHECK_TYPE(ssize_t, int)
AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
AC_TRY_RUN([
diff --git a/source4/lib/replace/win32/replace.h b/source4/lib/replace/win32/replace.h
index 94fa140681..185d448d95 100644
--- a/source4/lib/replace/win32/replace.h
+++ b/source4/lib/replace/win32/replace.h
@@ -1,6 +1,18 @@
#ifndef _WIN32_REPLACE_H
#define _WIN32_REPLACE_H
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
/* Map BSD Socket errorcodes to the WSA errorcodes (if possible) */
#define EAFNOSUPPORT WSAEAFNOSUPPORT
diff --git a/source4/lib/samba3/secrets.c b/source4/lib/samba3/secrets.c
index 0f3cc0c581..0981a7a6ec 100644
--- a/source4/lib/samba3/secrets.c
+++ b/source4/lib/samba3/secrets.c
@@ -30,6 +30,7 @@
#include "system/filesys.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "lib/tdb/include/tdbutil.h"
+#include "credentials.h"
/**
* Unpack SID into a pointer
diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c
index 789f24259a..04ed1fd7d9 100644
--- a/source4/ntvfs/cifs/vfs_cifs.c
+++ b/source4/ntvfs/cifs/vfs_cifs.c
@@ -32,6 +32,7 @@
#include "libcli/smb_composite/smb_composite.h"
#include "smb_server/smb_server.h"
#include "smbd/service_stream.h"
+#include "credentials.h"
/* this is stored in ntvfs_private */
struct cvfs_private {
diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c
index 9e77347fa7..08734493ba 100644
--- a/source4/rpc_server/remote/dcesrv_remote.c
+++ b/source4/rpc_server/remote/dcesrv_remote.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "rpc_server/dcerpc_server.h"
+#include "credentials.h"
struct dcesrv_remote_private {
struct dcerpc_pipe *c_pipe;
diff --git a/source4/scripting/ejs/smbcalls_cli.c b/source4/scripting/ejs/smbcalls_cli.c
index d7ffea29fe..3b0905d7d3 100644
--- a/source4/scripting/ejs/smbcalls_cli.c
+++ b/source4/scripting/ejs/smbcalls_cli.c
@@ -26,6 +26,7 @@
#include "libcli/raw/libcliraw.h"
#include "libcli/composite/composite.h"
#include "clilist.h"
+#include "credentials.h"
#if 0
diff --git a/source4/scripting/ejs/smbcalls_creds.c b/source4/scripting/ejs/smbcalls_creds.c
index cc2ccf8c47..d615bcbed2 100644
--- a/source4/scripting/ejs/smbcalls_creds.c
+++ b/source4/scripting/ejs/smbcalls_creds.c
@@ -24,6 +24,7 @@
#include "scripting/ejs/smbcalls.h"
#include "lib/appweb/ejs/ejs.h"
#include "lib/cmdline/popt_common.h"
+#include "credentials.h"
/*
helper function to get the local objects credentials ptr
diff --git a/source4/torture/basic/secleak.c b/source4/torture/basic/secleak.c
index f77b399874..2a1c5b15d5 100644
--- a/source4/torture/basic/secleak.c
+++ b/source4/torture/basic/secleak.c
@@ -24,6 +24,7 @@
#include "libcli/raw/libcliraw.h"
#include "system/time.h"
#include "libcli/composite/composite.h"
+#include "credentials.h"
#include "libcli/smb_composite/smb_composite.h"
static BOOL try_failed_login(struct smbcli_state *cli)
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index 8a2bba8497..2765df35f0 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -24,6 +24,7 @@
#include "request.h"
#include "libcli/raw/libcliraw.h"
#include "librpc/gen_ndr/ndr_security.h"
+#include "credentials.h"
#define NSERVERS 2
#define NINSTANCES 2
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index be363d0cb3..980fc6287c 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -22,6 +22,7 @@
#include "system/filesys.h"
#include "system/time.h"
#include "pstring.h"
+#include "credentials.h"
static int numops = 1000;
static BOOL showall;
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index 0b1c58a2f2..b432c7129a 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -23,6 +23,7 @@
#include "clilist.h"
#include "libcli/raw/libcliraw.h"
#include "system/time.h"
+#include "credentials.h"
#include "pstring.h"
static struct cli_credentials *credentials;
diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c
index ef0ccd9037..8fa784c624 100644
--- a/source4/torture/rpc/samlogon.c
+++ b/source4/torture/rpc/samlogon.c
@@ -27,6 +27,7 @@
#include "auth/auth.h"
#include "lib/crypto/crypto.h"
#include "lib/cmdline/popt_common.h"
+#include "credentials.h"
#define TEST_MACHINE_NAME "samlogontest"
#define TEST_USER_NAME "samlogontestuser"
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index 9cd30ef019..1f526ff7bc 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -28,6 +28,7 @@
#include "dlinklist.h"
#include "lib/crypto/crypto.h"
#include "system/time.h"
+#include "credentials.h"
#define TEST_MACHINE_NAME "samsynctest"
#define TEST_WKSTA_MACHINE_NAME "samsynctest2"
diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c
index c10405354e..d5df777451 100644
--- a/source4/torture/rpc/schannel.c
+++ b/source4/torture/rpc/schannel.c
@@ -24,6 +24,7 @@
#include "librpc/gen_ndr/ndr_samr.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "lib/cmdline/popt_common.h"
+#include "credentials.h"
#define TEST_MACHINE_NAME "schanneltest"
diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c
index 5d46e9aad4..87cd16daaa 100644
--- a/source4/utils/ntlm_auth.c
+++ b/source4/utils/ntlm_auth.c
@@ -28,6 +28,7 @@
#include "lib/cmdline/popt_common.h"
#include "auth/auth.h"
#include "librpc/gen_ndr/ndr_security.h"
+#include "credentials.h"
#define SQUID_BUFFER_SIZE 2010