summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/globals.c2
-rw-r--r--source3/smbd/negprot.c1
-rw-r--r--source3/smbd/nttrans.c2
-rw-r--r--source3/smbd/seal.c1
-rw-r--r--source3/smbd/sesssetup.c1
-rw-r--r--source3/smbd/smb2_create.c10
-rw-r--r--source3/smbd/smb2_sesssetup.c1
-rw-r--r--source3/smbd/trans2.c59
8 files changed, 72 insertions, 5 deletions
diff --git a/source3/smbd/globals.c b/source3/smbd/globals.c
index f680b76369..68fa795ba2 100644
--- a/source3/smbd/globals.c
+++ b/source3/smbd/globals.c
@@ -95,7 +95,7 @@ time_t last_printer_reload_time = 0;
for processing.
****************************************************************************/
struct pending_message_list *deferred_open_queue = NULL;
-uint32_t common_flags2 = FLAGS2_LONG_PATH_COMPONENTS|FLAGS2_32_BIT_ERROR_CODES;
+uint32_t common_flags2 = FLAGS2_LONG_PATH_COMPONENTS|FLAGS2_32_BIT_ERROR_CODES|FLAGS2_EXTENDED_ATTRIBUTES;
struct smb_srv_trans_enc_ctx *partial_srv_trans_enc_ctx = NULL;
struct smb_srv_trans_enc_ctx *srv_trans_enc_ctx = NULL;
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 85dc32447d..372f38eb57 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "smbd/globals.h"
+#include "../libcli/auth/spnego.h"
extern fstring remote_proto;
extern enum protocol_types Protocol;
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 1b981578e3..cf955d9651 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -810,7 +810,7 @@ static NTSTATUS set_sd(files_struct *fsp, uint8 *data, uint32 sd_len,
Read a list of EA names and data from an incoming data buffer. Create an ea_list with them.
****************************************************************************/
-static struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size)
+struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size)
{
struct ea_list *ea_list_head = NULL;
size_t offset = 0;
diff --git a/source3/smbd/seal.c b/source3/smbd/seal.c
index 0d5415b5f4..2d738cbd12 100644
--- a/source3/smbd/seal.c
+++ b/source3/smbd/seal.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include "smbd/globals.h"
+#include "../libcli/auth/spnego.h"
/******************************************************************************
Server side encryption.
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 2d2e5141ee..16ea2ebfa9 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -24,6 +24,7 @@
#include "includes.h"
#include "smbd/globals.h"
+#include "../libcli/auth/spnego.h"
extern enum protocol_types Protocol;
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index 3090650c3b..e0815049a4 100644
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -450,9 +450,13 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- /* TODO */
- tevent_req_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
- return tevent_req_post(req, ev);
+ ea_list = read_nttrans_ea_list(mem_ctx,
+ (const char *)exta->data.data, exta->data.length);
+ if (!ea_list) {
+ DEBUG(10,("smbd_smb2_create_send: read_ea_name_list failed.\n"));
+ tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
+ return tevent_req_post(req, ev);
+ }
}
if (mxac) {
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 4724516f2e..dc24124b54 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "smbd/globals.h"
#include "../libcli/smb/smb_common.h"
+#include "../libcli/auth/spnego.h"
static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *req,
uint64_t in_session_id,
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index f2c025b6c1..85eb73749a 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -4379,6 +4379,9 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
case 0xFF0F:/*SMB2_INFO_QUERY_ALL_EAS*/
{
+ /* This is FileFullEaInformation - 0xF which maps to
+ * 1015 (decimal) in smbd_do_setfilepathinfo. */
+
/* We have data_size bytes to put EA's into. */
size_t total_ea_len = 0;
struct ea_list *ea_file_list = NULL;
@@ -5656,6 +5659,53 @@ static NTSTATUS smb_info_set_ea(connection_struct *conn,
}
/****************************************************************************
+ Deal with SMB_FILE_FULL_EA_INFORMATION set.
+****************************************************************************/
+
+static NTSTATUS smb_set_file_full_ea_info(connection_struct *conn,
+ const char *pdata,
+ int total_data,
+ files_struct *fsp)
+{
+ struct ea_list *ea_list = NULL;
+ NTSTATUS status;
+
+ if (!fsp) {
+ return NT_STATUS_INVALID_HANDLE;
+ }
+
+ if (!lp_ea_support(SNUM(conn))) {
+ DEBUG(10, ("smb_set_file_full_ea_info - ea_len = %u but "
+ "EA's not supported.\n",
+ (unsigned int)total_data));
+ return NT_STATUS_EAS_NOT_SUPPORTED;
+ }
+
+ if (total_data < 10) {
+ DEBUG(10, ("smb_set_file_full_ea_info - ea_len = %u "
+ "too small.\n",
+ (unsigned int)total_data));
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ ea_list = read_nttrans_ea_list(talloc_tos(),
+ pdata,
+ total_data);
+
+ if (!ea_list) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+ status = set_ea(conn, fsp, fsp->fsp_name, ea_list);
+
+ DEBUG(10, ("smb_set_file_full_ea_info on file %s returned %s\n",
+ smb_fname_str_dbg(fsp->fsp_name),
+ nt_errstr(status) ));
+
+ return status;
+}
+
+
+/****************************************************************************
Deal with SMB_SET_FILE_DISPOSITION_INFO.
****************************************************************************/
@@ -7374,6 +7424,15 @@ NTSTATUS smbd_do_setfilepathinfo(connection_struct *conn,
break;
}
+ case SMB_FILE_FULL_EA_INFORMATION:
+ {
+ status = smb_set_file_full_ea_info(conn,
+ pdata,
+ total_data,
+ fsp);
+ break;
+ }
+
/* From tridge Samba4 :
* MODE_INFORMATION in setfileinfo (I have no
* idea what "mode information" on a file is - it takes a value of 0,