*/
#include "includes.h"
+#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
#ifndef _SAMBA_AUTH_H
#define _SAMBA_AUTH_H
+#include "libcli/auth/ntlmssp.h"
+#include "libcli/auth/credentials.h"
+#include "libcli/auth/gensec.h"
+#include "libcli/auth/spnego.h"
+
/* modules can use the following to determine if the interface has changed
* please increment the version number after each interface change
* with a comment and maybe update struct auth_critical_sizes.
*/
#include "includes.h"
+#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "system/time.h"
+#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
#include "includes.h"
#include "librpc/gen_ndr/ndr_samr.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
+#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
#include "includes.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
+#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
#include "librpc/gen_ndr/ndr_srvsvc.h"
#include "libcli/raw/libcliraw.h"
#include "system/time.h"
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
#include "gtk/common/select.h"
#include "gtk/common/gtk-smb.h"
/** Feel free to add definitions for other compilers here. */
#endif
-#include <unistd.h>
#include <sys/types.h>
-#include <unistd.h>
#include <stdio.h>
-#include <stddef.h>
#include <stdlib.h>
+#include <stddef.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#else
-#ifdef HAVE_SYS_FCNTL_H
-#include <sys/fcntl.h>
-#endif
-#endif
-
-#include <sys/stat.h>
-
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-
#include <signal.h>
-
#include <errno.h>
-#ifdef HAVE_SYS_MODE_H
-/* apparently AIX needs this for S_ISLNK */
-#ifndef S_ISLNK
-#include <sys/mode.h>
-#endif
-#endif
-
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#else
#include <varargs.h>
#endif
-#ifdef HAVE_STROPTS_H
-#include <stropts.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
#define UINT16_MAX 65535
#endif
-/*
- * Type for stat structure.
- */
-
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
#include "librpc/rpc/dcerpc.h"
#include "librpc/gen_ndr/tables.h"
-#include "libcli/auth/ntlmssp.h"
-#include "libcli/auth/credentials.h"
-#include "libcli/auth/gensec.h"
-#include "libcli/auth/spnego.h"
-#include "auth/auth.h"
-
#include "smb_interfaces.h"
#include "smbd/server.h"
#include "smbd/service.h"
#define MSG_WAITALL 0
#endif
-/* default socket options. Dave Miller thinks we should default to TCP_NODELAY
- given the socket IO pattern that Samba uses */
-#ifdef TCP_NODELAY
-#define DEFAULT_SOCKET_OPTIONS "TCP_NODELAY"
-#else
-#define DEFAULT_SOCKET_OPTIONS ""
-#endif
-
/* Load header file for dynamic linking stuff */
-
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
-/* dmalloc -- free heap debugger (dmalloc.org). This should be near
- * the *bottom* of include files so as not to conflict. */
-#ifdef ENABLE_DMALLOC
-# include <dmalloc.h>
-#endif
-
-
-/* Some POSIX definitions for those without */
-
-#ifndef S_IFDIR
-#define S_IFDIR 0x4000
-#endif
-#ifndef S_ISDIR
-#define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR)
-#endif
-#ifndef S_IRWXU
-#define S_IRWXU 00700 /* read, write, execute: owner */
-#endif
-#ifndef S_IRUSR
-#define S_IRUSR 00400 /* read permission: owner */
-#endif
-#ifndef S_IWUSR
-#define S_IWUSR 00200 /* write permission: owner */
-#endif
-#ifndef S_IXUSR
-#define S_IXUSR 00100 /* execute permission: owner */
-#endif
-#ifndef S_IRWXG
-#define S_IRWXG 00070 /* read, write, execute: group */
-#endif
-#ifndef S_IRGRP
-#define S_IRGRP 00040 /* read permission: group */
-#endif
-#ifndef S_IWGRP
-#define S_IWGRP 00020 /* write permission: group */
-#endif
-#ifndef S_IXGRP
-#define S_IXGRP 00010 /* execute permission: group */
-#endif
-#ifndef S_IRWXO
-#define S_IRWXO 00007 /* read, write, execute: other */
-#endif
-#ifndef S_IROTH
-#define S_IROTH 00004 /* read permission: other */
-#endif
-#ifndef S_IWOTH
-#define S_IWOTH 00002 /* write permission: other */
-#endif
-#ifndef S_IXOTH
-#define S_IXOTH 00001 /* execute permission: other */
-#endif
-
-/* For sys_adminlog(). */
-#ifndef LOG_EMERG
-#define LOG_EMERG 0 /* system is unusable */
-#endif
-
-#ifndef LOG_ALERT
-#define LOG_ALERT 1 /* action must be taken immediately */
-#endif
-
-#ifndef LOG_CRIT
-#define LOG_CRIT 2 /* critical conditions */
-#endif
-
-#ifndef LOG_ERR
-#define LOG_ERR 3 /* error conditions */
-#endif
-
-#ifndef LOG_WARNING
-#define LOG_WARNING 4 /* warning conditions */
-#endif
-
-#ifndef LOG_NOTICE
-#define LOG_NOTICE 5 /* normal but significant condition */
-#endif
-
-#ifndef LOG_INFO
-#define LOG_INFO 6 /* informational */
-#endif
-
-#ifndef LOG_DEBUG
-#define LOG_DEBUG 7 /* debug-level messages */
-#endif
-
extern int DEBUGLEVEL;
#ifndef RTLD_LAZY
#define strlen(x) valgrind_strlen(x)
#endif
-/*
- * Veritas File System. Often in addition to native.
- * Quotas different.
- */
-#if defined(HAVE_SYS_FS_VX_QUOTA_H)
-#define VXFS_QUOTA
-#endif
-
-#if HAVE_SYS_ATTRIBUTES_H
-#include <sys/attributes.h>
-#endif
-
-/* mutually exclusive (SuSE 8.2) */
-#if HAVE_ATTR_XATTR_H
-#include <attr/xattr.h>
-#elif HAVE_SYS_XATTR_H
-#include <sys/xattr.h>
-#endif
-
#define TALLOC_ABORT(reason) smb_panic(reason)
void *cd_direct, *cd_pull, *cd_push;
} *smb_iconv_t;
-#include "lib/cmdline/popt_common.h"
-
#endif /* _REWRITE_H */
struct samr_ChangePasswordUser2;
struct samr_CryptPassword;
struct samr_CryptPasswordEx;
+struct samr_LogonHours;
struct netr_SamInfo3;
struct netr_Authenticator;
struct tm;
struct utimbuf;
+
+
+struct auth_usersupplied_info;
+struct auth_serversupplied_info;
+struct creds_CredentialState;
+struct ntlmssp_state;
+struct auth_methods;
+struct schannel_state;
+struct spnego_data;
+typedef NTSTATUS (*gensec_password_callback)(struct gensec_security *gensec_security, TALLOC_CTX *mem_ctx,
+ char **password);
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <unistd.h>
+#include <sys/stat.h>
+
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#include <sys/file.h>
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#else
+#ifdef HAVE_SYS_FCNTL_H
+#include <sys/fcntl.h>
+#endif
+#endif
+
+#ifdef HAVE_SYS_MODE_H
+/* apparently AIX needs this for S_ISLNK */
+#ifndef S_ISLNK
+#include <sys/mode.h>
+#endif
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+/*
+ * Veritas File System. Often in addition to native.
+ * Quotas different.
+ */
+#if defined(HAVE_SYS_FS_VX_QUOTA_H)
+#define VXFS_QUOTA
+#endif
+
+#if HAVE_SYS_ATTRIBUTES_H
+#include <sys/attributes.h>
+#endif
+
+/* mutually exclusive (SuSE 8.2) */
+#if HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
+#elif HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#endif
+
+
+/* Some POSIX definitions for those without */
+
+#ifndef S_IFDIR
+#define S_IFDIR 0x4000
+#endif
+#ifndef S_ISDIR
+#define S_ISDIR(mode) ((mode & 0xF000) == S_IFDIR)
+#endif
+#ifndef S_IRWXU
+#define S_IRWXU 00700 /* read, write, execute: owner */
+#endif
+#ifndef S_IRUSR
+#define S_IRUSR 00400 /* read permission: owner */
+#endif
+#ifndef S_IWUSR
+#define S_IWUSR 00200 /* write permission: owner */
+#endif
+#ifndef S_IXUSR
+#define S_IXUSR 00100 /* execute permission: owner */
+#endif
+#ifndef S_IRWXG
+#define S_IRWXG 00070 /* read, write, execute: group */
+#endif
+#ifndef S_IRGRP
+#define S_IRGRP 00040 /* read permission: group */
+#endif
+#ifndef S_IWGRP
+#define S_IWGRP 00020 /* write permission: group */
+#endif
+#ifndef S_IXGRP
+#define S_IXGRP 00010 /* execute permission: group */
+#endif
+#ifndef S_IRWXO
+#define S_IRWXO 00007 /* read, write, execute: other */
+#endif
+#ifndef S_IROTH
+#define S_IROTH 00004 /* read permission: other */
+#endif
+#ifndef S_IWOTH
+#define S_IWOTH 00002 /* write permission: other */
+#endif
+#ifndef S_IXOTH
+#define S_IXOTH 00001 /* execute permission: other */
+#endif
+
#endif
#endif
+/* For sys_adminlog(). */
+#ifndef LOG_EMERG
+#define LOG_EMERG 0 /* system is unusable */
+#endif
+
+#ifndef LOG_ALERT
+#define LOG_ALERT 1 /* action must be taken immediately */
+#endif
+
+#ifndef LOG_CRIT
+#define LOG_CRIT 2 /* critical conditions */
+#endif
+
+#ifndef LOG_ERR
+#define LOG_ERR 3 /* error conditions */
+#endif
+
+#ifndef LOG_WARNING
+#define LOG_WARNING 4 /* warning conditions */
+#endif
+
+#ifndef LOG_NOTICE
+#define LOG_NOTICE 5 /* normal but significant condition */
+#endif
+
+#ifndef LOG_INFO
+#define LOG_INFO 6 /* informational */
+#endif
+
+#ifndef LOG_DEBUG
+#define LOG_DEBUG 7 /* debug-level messages */
+#endif
+
*/
#include "includes.h"
+#include "auth/auth.h"
/*
close the socket and shutdown a server_context
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
/* Handle command line options:
* -d,--debuglevel
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
static void writediff(struct registry_key *oldkey, struct registry_key *newkey, FILE *out)
{
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
/*
* Routines to parse a REGEDIT4 file
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
#include "system/time.h"
/*
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
static void print_tree(int l, struct registry_key *p, int fullpath, int novals)
{
#include "includes.h"
#include "system/time.h"
+#include "auth/auth.h"
/*
initialise the credentials state for old-style 64 bit session keys
*/
#include "includes.h"
+#include "auth/auth.h"
/* the list of currently registered GENSEC backends */
const static struct gensec_security_ops **generic_security_ops;
void (*end)(struct gensec_security *gensec_security);
};
-typedef NTSTATUS (*gensec_password_callback)(struct gensec_security *gensec_security, TALLOC_CTX *mem_ctx,
- char **password);
-
#define GENSEC_INTERFACE_VERSION 0
struct gensec_security {
#include "system/kerberos.h"
#include "libcli/auth/kerberos.h"
#include "librpc/gen_ndr/ndr_krb5pac.h"
+#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
*/
#include "includes.h"
+#include "auth/auth.h"
struct gensec_ntlmssp_state {
struct auth_context *auth_context;
*/
#include "includes.h"
+#include "auth/auth.h"
static NTSTATUS ntlmssp_client_initial(struct ntlmssp_state *ntlmssp_state,
TALLOC_CTX *out_mem_ctx,
*/
#include "includes.h"
+#include "auth/auth.h"
#define CLI_SIGN "session key to client-to-server signing key magic constant"
#define CLI_SEAL "session key to client-to-server sealing key magic constant"
*/
#include "includes.h"
+#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
*/
#include "includes.h"
+#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
*/
#include "includes.h"
+#include "system/filesys.h"
#include "libcli/raw/libcliraw.h"
/*
#include "includes.h"
#include "system/network.h"
#include "system/iconv.h"
+#include "auth/auth.h"
/****************************************************************************
*
#include "includes.h"
#include "libcli/raw/libcliraw.h"
+#include "auth/auth.h"
#define SETUP_REQUEST_SESSION(cmd, wct, buflen) do { \
req = smbcli_request_setup_session(session, cmd, wct, buflen); \
#include "includes.h"
#include "system/time.h"
-#include "byteorder.h"
+#include "auth/auth.h"
/*
This implements the X/Open SMB password encryption
GUID uuid;
} policy_handle;
- /* this is also used in samr and netlogon */
- typedef [public, flag(NDR_PAHEX)] struct {
- uint16 units_per_week;
- [size_is(1260), length_is(units_per_week/8)] uint8 *bitmap;
- } samr_LogonHours;
-
typedef [public, flag(NDR_PAHEX)] struct {
uint8 hash[16];
} samr_Password;
- typedef [public,flag(NDR_PAHEX)] struct {
- uint8 key[16];
- } netr_UserSessionKey;
-
- typedef [public,flag(NDR_PAHEX)] struct {
- uint8 key[8];
- } netr_LMSessionKey;
-
typedef [public, flag(NDR_PAHEX)] struct {
uint8 data[8];
} netr_Credential;
uint32 attributes;
} netr_GroupMembership;
+ typedef [public,flag(NDR_PAHEX)] struct {
+ uint8 key[16];
+ } netr_UserSessionKey;
+
+ typedef [public,flag(NDR_PAHEX)] struct {
+ uint8 key[8];
+ } netr_LMSessionKey;
+
typedef [public] struct {
NTTIME last_logon;
NTTIME last_logoff;
uint16 code_page;
} samr_UserInfo2;
+ /* this is also used in samr and netlogon */
+ typedef [public, flag(NDR_PAHEX)] struct {
+ uint16 units_per_week;
+ [size_is(1260), length_is(units_per_week/8)] uint8 *bitmap;
+ } samr_LogonHours;
+
typedef struct {
samr_Name account_name;
samr_Name full_name;
#include "includes.h"
#include "librpc/gen_ndr/ndr_schannel.h"
+#include "auth/auth.h"
enum schannel_position {
DCERPC_SCHANNEL_STATE_START = 0,
*/
#include "includes.h"
+#include "auth/auth.h"
struct unixuid_private {
void *samctx;
#include "includes.h"
#include "system/time.h"
#include "system/iconv.h"
+#include "system/network.h"
#include "librpc/gen_ndr/ndr_svcctl.h"
BOOL in_client = False; /* Not in the client by default */
/* options that can be set on the command line must be initialised via
the slower do_parameter() to ensure that FLAG_CMDLINE is obeyed */
- do_parameter("socket options", DEFAULT_SOCKET_OPTIONS);
+#ifdef TCP_NODELAY
+ do_parameter("socket options", "TCP_NODELAY");
+#endif
do_parameter("workgroup", DEFAULT_WORKGROUP);
do_parameter("netbios name", get_myname());
do_parameter("max protocol", "NT1");
#include "includes.h"
#include "librpc/gen_ndr/ndr_epmapper.h"
-#include "librpc/gen_ndr/ndr_dcom.h"
#include "librpc/gen_ndr/ndr_oxidresolver.h"
+#include "auth/auth.h"
/*
see if two endpoints match
#include "includes.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
#include "rpc_server/common/common.h"
+#include "librpc/gen_ndr/ndr_dcom.h"
+#include "auth/auth.h"
struct server_pipe_state {
struct netr_Credential client_challenge;
#include "includes.h"
#include "system/time.h"
+#include "auth/auth.h"
/* a reasonable amount of time to keep credentials live */
#define SCHANNEL_CREDENTIALS_EXPIRY 600
} while (0)
#define SET_LHOURS(msg, field, attr) do { \
- if (samdb_msg_add_logon_hours(a_state->sam_ctx, mem_ctx, msg, attr, r->in.info->field) != 0) { \
+ if (samdb_msg_add_logon_hours(a_state->sam_ctx, mem_ctx, msg, attr, &r->in.info->field) != 0) { \
return NT_STATUS_NO_MEMORY; \
} \
} while (0)
*/
#include "includes.h"
+#include "librpc/gen_ndr/ndr_netlogon.h"
/*
connect to the SAM database
add a logon_hours element to a message
*/
int samdb_msg_add_logon_hours(void *ctx, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
- const char *attr_name, struct samr_LogonHours hours)
+ const char *attr_name, struct samr_LogonHours *hours)
{
struct ldb_wrap *sam_ctx = ctx;
struct ldb_val val;
- val.length = hours.units_per_week / 8;
- val.data = hours.bitmap;
+ val.length = hours->units_per_week / 8;
+ val.data = hours->bitmap;
ldb_set_alloc(sam_ctx->ldb, talloc_realloc_fn, mem_ctx);
return ldb_msg_add_value(sam_ctx->ldb, msg, attr_name, &val);
}
*/
#include "includes.h"
+#include "auth/auth.h"
/* initialise the auth_context for this server and return the cryptkey */
static void get_challenge(struct smbsrv_connection *smb_conn, char buff[8])
*/
#include "includes.h"
+#include "auth/auth.h"
/*
setup the OS, Lanman and domain portions of a session setup reply
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
static void exit_server(const char *reason)
{
*/
#include "includes.h"
+#include "auth/auth.h"
BOOL torture_ntlmssp_self_check(void)
{
#include "includes.h"
#include "librpc/gen_ndr/ndr_netlogon.h"
+#include "auth/auth.h"
static const char *machine_password;
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
#include "libcli/raw/libcliraw.h"
#include "system/time.h"
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
#include "system/iconv.h"
static const struct dcerpc_interface_table *find_pipe(const char *pipe_name)
/*****************************************************/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
/*
run a function from a function table. If not found then
*/
#include "includes.h"
+#include "lib/cmdline/popt_common.h"
+#include "auth/auth.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND