summaryrefslogtreecommitdiff
path: root/source/include
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-08-15 17:52:55 +0000
committerGerald Carter <jerry@samba.org>2003-08-15 17:52:55 +0000
commit7139794cd0e68298e638929f35e7684a60fe5974 (patch)
tree2b40a989618bb9ece453fc995c645dfb1556af22 /source/include
parent34ec734381246665fb20225dc2e03b06fd7fcc90 (diff)
downloadsamba-7139794cd0e68298e638929f35e7684a60fe5974.tar.gz
syncing up to 3.0.0rc1
Diffstat (limited to 'source/include')
-rw-r--r--source/include/authdata.h2
-rw-r--r--source/include/byteorder.h2
-rw-r--r--source/include/charset.h6
-rw-r--r--source/include/client.h12
-rw-r--r--source/include/dynconfig.h2
-rw-r--r--source/include/idmap.h2
-rw-r--r--source/include/includes.h20
-rw-r--r--source/include/ntdomain.h20
-rw-r--r--source/include/ntioctl.h19
-rw-r--r--source/include/ntlmssp.h1
-rw-r--r--source/include/ntquotas.h2
-rw-r--r--source/include/popt_common.h1
-rw-r--r--source/include/rpc_dce.h8
-rw-r--r--source/include/rpc_ds.h75
-rw-r--r--source/include/rpc_lsa.h6
-rw-r--r--source/include/rpc_samr.h3
-rw-r--r--source/include/rpc_secdes.h20
-rwxr-xr-xsource/include/rpc_spoolss.h6
-rw-r--r--source/include/smb.h27
-rw-r--r--source/include/smb_macros.h6
-rw-r--r--source/include/smbldap.h3
-rw-r--r--source/include/spnego.h65
-rw-r--r--source/include/sysquotas.h16
-rw-r--r--source/include/version.h2
-rw-r--r--source/include/vfs.h12
-rw-r--r--source/include/vfs_macros.h3
26 files changed, 285 insertions, 56 deletions
diff --git a/source/include/authdata.h b/source/include/authdata.h
index 0798b72bdf9..9d80745fb06 100644
--- a/source/include/authdata.h
+++ b/source/include/authdata.h
@@ -1,7 +1,7 @@
/*
Unix SMB/CIFS implementation.
Kerberos authorization data
- Copyright (C) Jim McDonough 2003
+ Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
This program is free software; you can redistribute it and/or modify
diff --git a/source/include/byteorder.h b/source/include/byteorder.h
index c262dd2d337..0eef5573066 100644
--- a/source/include/byteorder.h
+++ b/source/include/byteorder.h
@@ -105,7 +105,7 @@ it also defines lots of intermediate macros, just ignore those :-)
#define CAREFUL_ALIGNMENT 1
#endif
-#define CVAL(buf,pos) (((const unsigned char *)(buf))[pos])
+#define CVAL(buf,pos) ((unsigned)(((const unsigned char *)(buf))[pos]))
#define CVAL_NC(buf,pos) (((unsigned char *)(buf))[pos]) /* Non-const version of CVAL */
#define PVAL(buf,pos) (CVAL(buf,pos))
#define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val))
diff --git a/source/include/charset.h b/source/include/charset.h
index c56984ca7b2..f999a9cf720 100644
--- a/source/include/charset.h
+++ b/source/include/charset.h
@@ -24,9 +24,9 @@ typedef enum {CH_UCS2=0, CH_UNIX=1, CH_DISPLAY=2, CH_DOS=3, CH_UTF8=4} charset_t
#define NUM_CHARSETS 5
-/*
- * for each charset we have a function that pulls from that charset to
- * a ucs2 buffer, and a function that pushes to a ucs2 buffer
+/*
+ * for each charset we have a function that pushes from that charset to a ucs2
+ * buffer, and a function that pulls from ucs2 buffer to that charset.
* */
struct charset_functions {
diff --git a/source/include/client.h b/source/include/client.h
index fad2c099b96..598e6c0bda5 100644
--- a/source/include/client.h
+++ b/source/include/client.h
@@ -57,18 +57,6 @@ struct print_job_info
time_t t;
};
-typedef struct smb_sign_info {
- void (*sign_outgoing_message)(struct cli_state *cli);
- BOOL (*check_incoming_message)(struct cli_state *cli);
- void (*free_signing_context)(struct cli_state *cli);
- void *signing_context;
-
- BOOL negotiated_smb_signing;
- BOOL allow_smb_signing;
- BOOL doing_signing;
- BOOL mandatory_signing;
-} smb_sign_info;
-
struct cli_state {
int port;
int fd;
diff --git a/source/include/dynconfig.h b/source/include/dynconfig.h
index ce256f06130..a74d77e41f7 100644
--- a/source/include/dynconfig.h
+++ b/source/include/dynconfig.h
@@ -1,7 +1,7 @@
/*
Unix SMB/CIFS implementation.
Copyright (C) 2001 by Martin Pool <mbp@samba.org>
- Copyright (C) 2003 by Anthony Liguori <aliguor@us.ibm.com>
+ Copyright (C) 2003 by Jim McDonough <jmcd@us.ibm.com>
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
diff --git a/source/include/idmap.h b/source/include/idmap.h
index ae7e4e5101b..20b1015285e 100644
--- a/source/include/idmap.h
+++ b/source/include/idmap.h
@@ -5,7 +5,7 @@
Idmap headers
- Copyright (C) Anthony Liguori 2003
+ Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
Copyright (C) Simo Sorce 2003
This library is free software; you can redistribute it and/or
diff --git a/source/include/includes.h b/source/include/includes.h
index edaeda3abed..0179064a6ad 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -437,6 +437,10 @@
#include <com_err.h>
#endif
+#if HAVE_SYS_ATTRIBUTES_H
+#include <sys/attributes.h>
+#endif
+
#if HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#endif
@@ -835,6 +839,8 @@ extern int errno;
#include "nsswitch/winbind_client.h"
+#include "spnego.h"
+
/*
* Type for wide character dirent structure.
* Only d_name is defined by POSIX.
@@ -956,10 +962,6 @@ struct smb_ldap_privates;
#define SYNC_DNS 1
#endif
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 256
-#endif
-
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
@@ -1232,6 +1234,14 @@ int snprintf(char *,size_t ,const char *, ...) PRINTF_ATTRIBUTE(3,4);
int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
#endif
+/* Fix prototype problem with non-C99 compliant snprintf implementations, esp
+ HPUX 11. Don't change the sense of this #if statement. Read the comments
+ in lib/snprint.c if you think you need to. See also bugzilla bug 174. */
+
+#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF)
+#define snprintf smb_snprintf
+#endif
+
void sys_adminlog(int priority, const char *format_str, ...) PRINTF_ATTRIBUTE(2,3);
int pstr_sprintf(pstring s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3);
@@ -1288,7 +1298,7 @@ krb5_const_principal get_principal_from_tkt(krb5_ticket *tkt);
krb5_error_code krb5_locate_kdc(krb5_context ctx, const krb5_data *realm, struct sockaddr **addr_pp, int *naddrs, int get_masters);
krb5_error_code get_kerberos_allowed_etypes(krb5_context context, krb5_enctype **enctypes);
void free_kerberos_etypes(krb5_context context, krb5_enctype *enctypes);
-BOOL get_krb5_smb_session_key(krb5_context context, krb5_auth_context auth_context, uint8 session_key[16]);
+BOOL get_krb5_smb_session_key(krb5_context context, krb5_auth_context auth_context, uint8 session_key[16], BOOL remote);
#endif /* HAVE_KRB5 */
/* TRUE and FALSE are part of the C99 standard and gcc, but
diff --git a/source/include/ntdomain.h b/source/include/ntdomain.h
index b6ab4fd0c50..ccbc190c59d 100644
--- a/source/include/ntdomain.h
+++ b/source/include/ntdomain.h
@@ -165,10 +165,21 @@ struct dcinfo
};
+typedef struct pipe_rpc_fns {
+
+ struct pipe_rpc_fns *next, *prev;
+
+ /* RPC function table associated with the current rpc_bind (associated by context) */
+
+ struct api_struct *cmds;
+ int n_cmds;
+ uint32 context_id;
+
+} PIPE_RPC_FNS;
+
/*
* DCE/RPC-specific samba-internal-specific handling of data on
* NamedPipes.
- *
*/
typedef struct pipes_struct
@@ -180,7 +191,12 @@ typedef struct pipes_struct
fstring name;
fstring pipe_srv_name;
-
+
+ /* linked list of rpc dispatch tables associated
+ with the open rpc contexts */
+
+ PIPE_RPC_FNS *contexts;
+
RPC_HDR hdr; /* Incoming RPC header. */
RPC_HDR_REQ hdr_req; /* Incoming request header. */
diff --git a/source/include/ntioctl.h b/source/include/ntioctl.h
index 17791fde18f..9814c88e5e5 100644
--- a/source/include/ntioctl.h
+++ b/source/include/ntioctl.h
@@ -23,6 +23,8 @@
we only need the sparse flag
*/
+#ifndef _NTIOCTL_H
+#define _NTIOCTL_H
/* IOCTL information */
/* List of ioctl function codes that look to be of interest to remote clients like this. */
@@ -53,6 +55,8 @@
#define FSCTL_SIS_COPYFILE 0x00090100
#define FSCTL_SIS_LINK_FILES 0x0009C104
+#define FSCTL_GET_SHADOW_COPY_DATA 0x00144064 /* KJC -- Shadow Copy information */
+
#if 0
#define FSCTL_SECURITY_ID_CHECK
#define FSCTL_DISMOUNT_VOLUME
@@ -66,3 +70,18 @@
#define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
#define IO_REPARSE_TAG_HSM 0xC0000004
#define IO_REPARSE_TAG_SIS 0x80000007
+
+
+/* For FSCTL_GET_SHADOW_COPY_DATA ...*/
+typedef char SHADOW_COPY_LABEL[25];
+
+typedef struct shadow_copy_data {
+ TALLOC_CTX *mem_ctx;
+ /* Total number of shadow volumes currently mounted */
+ uint32 num_volumes;
+ /* Concatenated list of labels */
+ SHADOW_COPY_LABEL *labels;
+} SHADOW_COPY_DATA;
+
+
+#endif /* _NTIOCTL_H */
diff --git a/source/include/ntlmssp.h b/source/include/ntlmssp.h
index 562e4853ccc..f1b1bc25e43 100644
--- a/source/include/ntlmssp.h
+++ b/source/include/ntlmssp.h
@@ -100,6 +100,7 @@ typedef struct ntlmssp_client_state
char *domain;
char *workstation;
char *password;
+ char *server_domain;
const char *(*get_global_myname)(void);
const char *(*get_domain)(void);
diff --git a/source/include/ntquotas.h b/source/include/ntquotas.h
index 1425e59bb84..dac1173770b 100644
--- a/source/include/ntquotas.h
+++ b/source/include/ntquotas.h
@@ -72,7 +72,7 @@ typedef struct _SMB_NTQUOTA_STRUCT {
SMB_BIG_UINT usedspace;
SMB_BIG_UINT softlim;
SMB_BIG_UINT hardlim;
- enum SMB_QUOTA_TYPE qflags;
+ uint32 qflags;
DOM_SID sid;
} SMB_NTQUOTA_STRUCT;
diff --git a/source/include/popt_common.h b/source/include/popt_common.h
index 57850bf6826..6db30fbc0ac 100644
--- a/source/include/popt_common.h
+++ b/source/include/popt_common.h
@@ -41,6 +41,7 @@ struct user_auth_info {
pstring password;
BOOL got_pass;
BOOL use_kerberos;
+ int signing_state;
};
extern struct user_auth_info cmdline_auth_info;
diff --git a/source/include/rpc_dce.h b/source/include/rpc_dce.h
index dc82f453685..2e4a418bb7d 100644
--- a/source/include/rpc_dce.h
+++ b/source/include/rpc_dce.h
@@ -78,8 +78,8 @@ enum netsec_direction
#define AUTH_PIPE_NETSEC 0x0008
/* Maximum PDU fragment size. */
-#define MAX_PDU_FRAG_LEN 0x1630
-/* #define MAX_PDU_FRAG_LEN 0x10b8 this is what w2k sets */
+/* #define MAX_PDU_FRAG_LEN 0x1630 this is what wnt sets */
+#define MAX_PDU_FRAG_LEN 0x10b8 /* this is what w2k sets */
/*
* Actual structure of a DCE UUID
@@ -136,8 +136,8 @@ typedef struct rpc_hdr_info
typedef struct rpc_hdr_req_info
{
uint32 alloc_hint; /* allocation hint - data size (bytes) minus header and tail. */
- uint16 context_id; /* 0 - presentation context identifier */
- uint16 opnum; /* opnum */
+ uint16 context_id; /* presentation context identifier */
+ uint16 opnum; /* opnum */
} RPC_HDR_REQ;
diff --git a/source/include/rpc_ds.h b/source/include/rpc_ds.h
index c01d10554ec..e2622be532c 100644
--- a/source/include/rpc_ds.h
+++ b/source/include/rpc_ds.h
@@ -27,15 +27,32 @@
/* Opcodes available on PIPE_LSARPC_DS */
#define DS_GETPRIMDOMINFO 0x00
+#define DS_NOP 0xFF /* no op -- placeholder */
+
+/* Opcodes available on PIPE_NETLOGON */
+
+#define DS_ENUM_DOM_TRUSTS 0x28
/* macros for RPC's */
+/* DSROLE_PRIMARY_DOMAIN_INFO_BASIC */
+
+/* flags */
+
#define DSROLE_PRIMARY_DS_RUNNING 0x00000001
#define DSROLE_PRIMARY_DS_MIXED_MODE 0x00000002
#define DSROLE_UPGRADE_IN_PROGRESS 0x00000004
#define DSROLE_PRIMARY_DOMAIN_GUID_PRESENT 0x01000000
+/* machine role */
+
+#define DSROLE_STANDALONE_SRV 2
+#define DSROLE_DOMAIN_MEMBER_SRV 3
+#define DSROLE_BDC 4
+#define DSROLE_PDC 5
+
+
typedef struct
{
uint16 machine_role;
@@ -50,10 +67,9 @@ typedef struct
GUID domain_guid;
UNISTR2 netbios_domain;
- /* these 2 might be reversed in order. I can't tell from
- my tests as both values are the same --jerry */
- UNISTR2 dns_domain;
- UNISTR2 forest_domain;
+
+ UNISTR2 dns_domain; /* our dns domain */
+ UNISTR2 forest_domain; /* root domain of the forest to which we belong */
} DSROLE_PRIMARY_DOMAIN_INFO_BASIC;
typedef struct
@@ -85,7 +101,58 @@ typedef struct
NTSTATUS status;
} DS_R_GETPRIMDOMINFO;
+typedef struct {
+ /* static portion of structure */
+ uint32 netbios_ptr;
+ uint32 dns_ptr;
+ uint32 flags;
+ uint32 parent_index;
+ uint32 trust_type;
+ uint32 trust_attributes;
+ uint32 sid_ptr;
+ GUID guid;
+
+ UNISTR2 netbios_domain;
+ UNISTR2 dns_domain;
+ DOM_SID2 sid;
+
+} DS_DOMAIN_TRUSTS;
+
+typedef struct {
+
+ uint32 ptr;
+ uint32 max_count;
+ DS_DOMAIN_TRUSTS *trusts;
+
+} DS_DOMAIN_TRUSTS_CTR;
+
+#define DS_DOMAIN_IN_FOREST 0x0001 /* domains in the forest to which
+ we belong; even different domain trees */
+#define DS_DOMAIN_DIRECT_OUTBOUND 0x0002 /* trusted domains */
+#define DS_DOMAIN_TREE_ROOT 0x0004 /* root of our forest; also available in
+ DsRoleGetPrimaryDomainInfo() */
+#define DS_DOMAIN_PRIMARY 0x0008 /* our domain */
+#define DS_DOMAIN_NATIVE_MODE 0x0010 /* native mode AD servers */
+#define DS_DOMAIN_DIRECT_INBOUND 0x0020 /* trusting domains */
+
+/* DS_Q_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() request */
+typedef struct
+{
+ uint32 server_ptr;
+ UNISTR2 server;
+ uint32 flags;
+
+} DS_Q_ENUM_DOM_TRUSTS;
+
+/* DS_R_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() response */
+typedef struct
+{
+ uint32 num_domains;
+ DS_DOMAIN_TRUSTS_CTR domains;
+
+ NTSTATUS status;
+} DS_R_ENUM_DOM_TRUSTS;
#endif /* _RPC_DS_H */
diff --git a/source/include/rpc_lsa.h b/source/include/rpc_lsa.h
index 135fd76d6c9..fa49d76c885 100644
--- a/source/include/rpc_lsa.h
+++ b/source/include/rpc_lsa.h
@@ -27,6 +27,12 @@
/* Opcodes available on PIPE_LSARPC */
+#if 0 /* UNIMPLEMENTED */
+
+#define LSA_LOOKUPSIDS2 0x39
+
+#endif
+
#define LSA_CLOSE 0x00
#define LSA_DELETE 0x01
#define LSA_ENUM_PRIVS 0x02
diff --git a/source/include/rpc_samr.h b/source/include/rpc_samr.h
index 7d28a0f3a71..8ec274176a7 100644
--- a/source/include/rpc_samr.h
+++ b/source/include/rpc_samr.h
@@ -5,8 +5,7 @@
Copyright (C) Luke Kenneth Casson Leighton 1996-2000
Copyright (C) Paul Ashton 1997-2000
Copyright (C) Jean François Micouleau 1998-2001
- Copyright (C) Anthony Liguori 2002
- Copyright (C) Jim McDonough 2002
+ Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002
This program is free software; you can redistribute it and/or modify
diff --git a/source/include/rpc_secdes.h b/source/include/rpc_secdes.h
index fb7060cde3b..5e718f8167d 100644
--- a/source/include/rpc_secdes.h
+++ b/source/include/rpc_secdes.h
@@ -305,12 +305,12 @@ typedef struct standard_mapping {
SA_RIGHT_FILE_EXECUTE)
-/* SAM Object specific access rights */
+/* SAM server specific access rights */
-#define SA_RIGHT_SAM_UNKNOWN_1 0x00000001
+#define SA_RIGHT_SAM_CONNECT_SERVER 0x00000001
#define SA_RIGHT_SAM_SHUTDOWN_SERVER 0x00000002
-#define SA_RIGHT_SAM_UNKNOWN_4 0x00000004
-#define SA_RIGHT_SAM_UNKNOWN_8 0x00000008
+#define SA_RIGHT_SAM_INITIALISE_SERVER 0x00000004
+#define SA_RIGHT_SAM_CREATE_DOMAIN 0x00000008
#define SA_RIGHT_SAM_ENUM_DOMAINS 0x00000010
#define SA_RIGHT_SAM_OPEN_DOMAIN 0x00000020
@@ -326,14 +326,14 @@ typedef struct standard_mapping {
#define GENERIC_RIGHTS_SAM_WRITE \
(STANDARD_RIGHTS_WRITE_ACCESS | \
- SA_RIGHT_SAM_UNKNOWN_8 | \
- SA_RIGHT_SAM_UNKNOWN_4 | \
+ SA_RIGHT_SAM_CREATE_DOMAIN | \
+ SA_RIGHT_SAM_INITIALISE_SERVER | \
SA_RIGHT_SAM_SHUTDOWN_SERVER)
#define GENERIC_RIGHTS_SAM_EXECUTE \
(STANDARD_RIGHTS_EXECUTE_ACCESS | \
SA_RIGHT_SAM_OPEN_DOMAIN | \
- SA_RIGHT_SAM_UNKNOWN_1)
+ SA_RIGHT_SAM_CONNECT_SERVER)
/* Domain Object specific access rights */
@@ -388,8 +388,8 @@ typedef struct standard_mapping {
#define SA_RIGHT_USER_CHANGE_PASSWORD 0x00000040
#define SA_RIGHT_USER_SET_PASSWORD 0x00000080
#define SA_RIGHT_USER_GET_GROUPS 0x00000100
-#define SA_RIGHT_USER_UNKNOWN_200 0x00000200
-#define SA_RIGHT_USER_UNKNOWN_400 0x00000400
+#define SA_RIGHT_USER_READ_GROUP_MEM 0x00000200
+#define SA_RIGHT_USER_CHANGE_GROUP_MEM 0x00000400
#define SA_RIGHT_USER_ALL_ACCESS 0x000007FF
@@ -399,7 +399,7 @@ typedef struct standard_mapping {
#define GENERIC_RIGHTS_USER_READ \
(STANDARD_RIGHTS_READ_ACCESS | \
- SA_RIGHT_USER_UNKNOWN_200 | \
+ SA_RIGHT_USER_READ_GROUP_MEM | \
SA_RIGHT_USER_GET_GROUPS | \
SA_RIGHT_USER_ACCT_FLAGS_EXPIRY | \
SA_RIGHT_USER_GET_LOGONINFO | \
diff --git a/source/include/rpc_spoolss.h b/source/include/rpc_spoolss.h
index c2e3d92787c..f96b4fa96ab 100755
--- a/source/include/rpc_spoolss.h
+++ b/source/include/rpc_spoolss.h
@@ -1302,6 +1302,12 @@ typedef struct s_port_info_2
}
PORT_INFO_2;
+/* Port Type bits */
+#define PORT_TYPE_WRITE 0x0001
+#define PORT_TYPE_READ 0x0002
+#define PORT_TYPE_REDIRECTED 0x0004
+#define PORT_TYPE_NET_ATTACHED 0x0008
+
typedef struct spool_q_enumports
{
uint32 name_ptr;
diff --git a/source/include/smb.h b/source/include/smb.h
index d2714e78bc8..2cafd1b9b1e 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -42,6 +42,7 @@
#define SMB_PORT2 139
#define SMB_PORTS "445 139"
+#define Undefined (-1)
#define False (0)
#define True (1)
#define Auto (2)
@@ -79,9 +80,7 @@ typedef int BOOL;
#define READ_TIMEOUT 1
#define READ_EOF 2
#define READ_ERROR 3
-
-/* This error code can go into the client smb_rw_error. */
-#define WRITE_ERROR 4
+#define WRITE_ERROR 4 /* This error code can go into the client smb_rw_error. */
#define READ_BAD_SIG 5
#define DIR_STRUCT_SIZE 43
@@ -391,6 +390,7 @@ typedef struct files_struct
SMB_OFF_T pos;
SMB_BIG_UINT size;
SMB_BIG_UINT initial_allocation_size; /* Faked up initial allocation on disk. */
+ SMB_BIG_UINT position_information;
mode_t mode;
uint16 vuid;
write_bmpx_struct *wbmpx_ptr;
@@ -707,13 +707,14 @@ struct bitmap {
unsigned int n;
};
-#define FLAG_BASIC 0x0001 /* fundamental options */
+/* The following flags are used in SWAT */
+#define FLAG_BASIC 0x0001 /* Display only in BASIC view */
#define FLAG_SHARE 0x0002 /* file sharing options */
#define FLAG_PRINT 0x0004 /* printing options */
#define FLAG_GLOBAL 0x0008 /* local options that should be globally settable in SWAT */
#define FLAG_WIZARD 0x0010 /* Parameters that the wizard will operate on */
-#define FLAG_ADVANCED 0x0020 /* Parameters that the wizard will operate on */
-#define FLAG_DEVELOPER 0x0040 /* Parameters that the wizard will operate on */
+#define FLAG_ADVANCED 0x0020 /* Parameters that will be visible in advanced view */
+#define FLAG_DEVELOPER 0x0040 /* No longer used */
#define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */
#define FLAG_HIDE 0x2000 /* options that should be hidden in SWAT */
#define FLAG_DOS_STRING 0x4000 /* convert from UNIX to DOS codepage when reading this string. */
@@ -1630,4 +1631,18 @@ struct ip_service {
unsigned port;
};
+/* Used by the SMB signing functions. */
+
+typedef struct smb_sign_info {
+ void (*sign_outgoing_message)(char *outbuf, struct smb_sign_info *si);
+ BOOL (*check_incoming_message)(char *inbuf, struct smb_sign_info *si);
+ void (*free_signing_context)(struct smb_sign_info *si);
+ void *signing_context;
+
+ BOOL negotiated_smb_signing;
+ BOOL allow_smb_signing;
+ BOOL doing_signing;
+ BOOL mandatory_signing;
+} smb_sign_info;
+
#endif /* _SMB_H */
diff --git a/source/include/smb_macros.h b/source/include/smb_macros.h
index 21ccdf295c4..178fd9c3580 100644
--- a/source/include/smb_macros.h
+++ b/source/include/smb_macros.h
@@ -77,6 +77,12 @@
#define OPEN_CONN(conn) ((conn) && (conn)->open)
#define IS_IPC(conn) ((conn) && (conn)->ipc)
#define IS_PRINT(conn) ((conn) && (conn)->printer)
+#define FSP_BELONGS_CONN(fsp,conn) do {\
+ extern struct current_user current_user;\
+ if (!((fsp) && (conn) && ((conn)==(fsp)->conn) && (current_user.vuid==(fsp)->vuid))) \
+ return(ERROR_DOS(ERRDOS,ERRbadfid));\
+ } while(0)
+
#define FNUM_OK(fsp,c) (OPEN_FSP(fsp) && (c)==(fsp)->conn && current_user.vuid==(fsp)->vuid)
#define CHECK_FSP(fsp,conn) do {\
diff --git a/source/include/smbldap.h b/source/include/smbldap.h
index 589d01aa6dd..826fc3c55a1 100644
--- a/source/include/smbldap.h
+++ b/source/include/smbldap.h
@@ -132,6 +132,9 @@ struct smbldap_state {
char *bind_secret;
unsigned int num_failures;
+
+ time_t last_use;
+ smb_event_id_t event_id;
};
#endif /* HAVE_LDAP */
diff --git a/source/include/spnego.h b/source/include/spnego.h
new file mode 100644
index 00000000000..b6492ee3c8a
--- /dev/null
+++ b/source/include/spnego.h
@@ -0,0 +1,65 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ RFC2478 Compliant SPNEGO implementation
+
+ Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
+
+ 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.
+*/
+
+#ifndef SAMBA_SPNEGO_H
+#define SAMBA_SPNEGO_H
+
+#define SPNEGO_DELEG_FLAG 0x01
+#define SPNEGO_MUTUAL_FLAG 0x02
+#define SPNEGO_REPLAY_FLAG 0x04
+#define SPNEGO_SEQUENCE_FLAG 0x08
+#define SPNEGO_ANON_FLAG 0x10
+#define SPNEGO_CONF_FLAG 0x20
+#define SPNEGO_INTEG_FLAG 0x40
+#define SPNEGO_REQ_FLAG 0x80
+
+#define SPNEGO_NEG_TOKEN_INIT 0
+#define SPNEGO_NEG_TOKEN_TARG 1
+
+typedef enum _spnego_negResult {
+ SPNEGO_ACCEPT_COMPLETED = 0,
+ SPNEGO_ACCEPT_INCOMPLETE = 1,
+ SPNEGO_REJECT = 2
+} negResult_t;
+
+typedef struct spnego_negTokenInit {
+ const char **mechTypes;
+ int reqFlags;
+ DATA_BLOB mechToken;
+ DATA_BLOB mechListMIC;
+} negTokenInit_t;
+
+typedef struct spnego_negTokenTarg {
+ uint8 negResult;
+ const char *supportedMech;
+ DATA_BLOB responseToken;
+ DATA_BLOB mechListMIC;
+} negTokenTarg_t;
+
+typedef struct spnego_spnego {
+ int type;
+ negTokenInit_t negTokenInit;
+ negTokenTarg_t negTokenTarg;
+} SPNEGO_DATA;
+
+#endif
diff --git a/source/include/sysquotas.h b/source/include/sysquotas.h
index cfdac0609aa..b803e6277ab 100644
--- a/source/include/sysquotas.h
+++ b/source/include/sysquotas.h
@@ -189,6 +189,22 @@
#define SMB_QUOTAS_NO_LIMIT ((SMB_BIG_UINT)(0))
#define SMB_QUOTAS_NO_SPACE ((SMB_BIG_UINT)(1))
+#define SMB_QUOTAS_SET_NO_LIMIT(dp) \
+{\
+ (dp)->softlimit = SMB_QUOTAS_NO_LIMIT;\
+ (dp)->hardlimit = SMB_QUOTAS_NO_LIMIT;\
+ (dp)->isoftlimit = SMB_QUOTAS_NO_LIMIT;\
+ (dp)->ihardlimit = SMB_QUOTAS_NO_LIMIT;\
+}
+
+#define SMB_QUOTAS_SET_NO_SPACE(dp) \
+{\
+ (dp)->softlimit = SMB_QUOTAS_NO_SPACE;\
+ (dp)->hardlimit = SMB_QUOTAS_NO_SPACE;\
+ (dp)->isoftlimit = SMB_QUOTAS_NO_SPACE;\
+ (dp)->ihardlimit = SMB_QUOTAS_NO_SPACE;\
+}
+
typedef struct _SMB_DISK_QUOTA {
enum SMB_QUOTA_TYPE qtype;
SMB_BIG_UINT bsize;
diff --git a/source/include/version.h b/source/include/version.h
index 5e2d47e1ded..68bc140dafb 100644
--- a/source/include/version.h
+++ b/source/include/version.h
@@ -1 +1 @@
-#define VERSION "3.0.0beta3"
+#define VERSION "3.0.0rc1"
diff --git a/source/include/vfs.h b/source/include/vfs.h
index 924d7063217..dd489702aa9 100644
--- a/source/include/vfs.h
+++ b/source/include/vfs.h
@@ -50,8 +50,8 @@
/* Changed to version 6 for the new module system, fixed cascading and quota functions. --metze */
/* Changed to version 7 to include the get_nt_acl info parameter. JRA. */
/* Changed to version 8 includes EA calls. JRA. */
-
-#define SMB_VFS_INTERFACE_VERSION 8
+/* Changed to version 9 to include the get_shadow_data call. --metze */
+#define SMB_VFS_INTERFACE_VERSION 9
/* to bug old modules witch are trying to compile with the old functions */
@@ -91,6 +91,8 @@ typedef enum _vfs_op_type {
SMB_VFS_OP_DISK_FREE,
SMB_VFS_OP_GET_QUOTA,
SMB_VFS_OP_SET_QUOTA,
+ SMB_VFS_OP_GET_SHADOW_COPY_DATA,
+
/* Directory operations */
@@ -196,6 +198,7 @@ struct vfs_ops {
SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
int (*get_quota)(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
int (*set_quota)(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt);
+ int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels);
/* Directory operations */
@@ -293,6 +296,7 @@ struct vfs_ops {
struct vfs_handle_struct *disk_free;
struct vfs_handle_struct *get_quota;
struct vfs_handle_struct *set_quota;
+ struct vfs_handle_struct *get_shadow_copy_data;
/* Directory operations */
@@ -379,6 +383,7 @@ struct vfs_ops {
struct vfs_handle_struct *setxattr;
struct vfs_handle_struct *lsetxattr;
struct vfs_handle_struct *fsetxattr;
+
} handles;
};
@@ -466,6 +471,9 @@ typedef struct vfs_handle_struct {
} \
}
+/* Check whether module-specific data handle was already allocated or not */
+#define SMB_VFS_HANDLE_TEST_DATA(handle) ( !(handle) || !(handle)->data ? False : True )
+
#define SMB_VFS_OP(x) ((void *) x)
diff --git a/source/include/vfs_macros.h b/source/include/vfs_macros.h
index fdbc1516e31..c4f63c352e4 100644
--- a/source/include/vfs_macros.h
+++ b/source/include/vfs_macros.h
@@ -33,6 +33,7 @@
#define SMB_VFS_DISK_FREE(conn, path, small_query, bsize, dfree ,dsize) ((conn)->vfs.ops.disk_free((conn)->vfs.handles.disk_free, (conn), (path), (small_query), (bsize), (dfree), (dsize)))
#define SMB_VFS_GET_QUOTA(conn, qtype, id, qt) ((conn)->vfs.ops.get_quota((conn)->vfs.handles.get_quota, (conn), (qtype), (id), (qt)))
#define SMB_VFS_SET_QUOTA(conn, qtype, id, qt) ((conn)->vfs.ops.set_quota((conn)->vfs.handles.set_quota, (conn), (qtype), (id), (qt)))
+#define SMB_VFS_GET_SHADOW_COPY_DATA(fsp,shadow_copy_data,labels) ((fsp)->conn->vfs.ops.get_shadow_copy_data((fsp)->conn->vfs.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels)))
/* Directory operations */
#define SMB_VFS_OPENDIR(conn, fname) ((conn)->vfs.ops.opendir((conn)->vfs.handles.opendir, (conn), (fname)))
@@ -128,6 +129,7 @@
#define SMB_VFS_OPAQUE_DISK_FREE(conn, path, small_query, bsize, dfree ,dsize) ((conn)->vfs_opaque.ops.disk_free((conn)->vfs_opaque.handles.disk_free, (conn), (path), (small_query), (bsize), (dfree), (dsize)))
#define SMB_VFS_OPAQUE_GET_QUOTA(conn, qtype, id, qt) ((conn)->vfs_opaque.ops.get_quota((conn)->vfs_opaque.handles.get_quota, (conn), (qtype), (id), (qt)))
#define SMB_VFS_OPAQUE_SET_QUOTA(conn, qtype, id, qt) ((conn)->vfs_opaque.ops.set_quota((conn)->vfs_opaque.handles.set_quota, (conn), (qtype), (id), (qt)))
+#define SMB_VFS_OPAQUE_GET_SHADOW_COPY_DATA(fsp,shadow_copy_data,labels) ((fsp)->conn->vfs_opaque.ops.get_shadow_copy_data((fsp)->conn->vfs_opaque.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels)))
/* Directory operations */
#define SMB_VFS_OPAQUE_OPENDIR(conn, fname) ((conn)->vfs_opaque.ops.opendir((conn)->vfs_opaque.handles.opendir, (conn), (fname)))
@@ -223,6 +225,7 @@
#define SMB_VFS_NEXT_DISK_FREE(handle, conn, path, small_query, bsize, dfree ,dsize) ((handle)->vfs_next.ops.disk_free((handle)->vfs_next.handles.disk_free, (conn), (path), (small_query), (bsize), (dfree), (dsize)))
#define SMB_VFS_NEXT_GET_QUOTA(handle, conn, qtype, id, qt) ((handle)->vfs_next.ops.get_quota((handle)->vfs_next.handles.get_quota, (conn), (qtype), (id), (qt)))
#define SMB_VFS_NEXT_SET_QUOTA(handle, conn, qtype, id, qt) ((handle)->vfs_next.ops.set_quota((handle)->vfs_next.handles.set_quota, (conn), (qtype), (id), (qt)))
+#define SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data ,labels) ((handle)->vfs_next.ops.get_shadow_copy_data((handle)->vfs_next.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels)))
/* Directory operations */
#define SMB_VFS_NEXT_OPENDIR(handle, conn, fname) ((handle)->vfs_next.ops.opendir((handle)->vfs_next.handles.opendir, (conn), (fname)))