[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Mon Dec 13 15:48:01 MST 2010
The branch, master has been updated
via 0414283 As we handle missing sendfile() inside lib/sendfile.c, remove the WITH_SENDFILE ifdefs.
via 6ce365b We need to start off with smb2.credits_granted == 0. That way when processing the faked up SMB2 NegProt from the SMB1 packet we always allocate one credit on reply.
via 27a47eb Remove extra unused credit arg. to smbd_smb2_request_setup_out()
from 4ec6652 s4:dsdb:password_hash: verify content if the BYPASS_PASSWORD_HASH control is used
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 041428352c36d548de738fbe971a1361e3a5402b
Author: Jeremy Allison <jra at samba.org>
Date: Mon Dec 13 14:00:34 2010 -0800
As we handle missing sendfile() inside lib/sendfile.c, remove the WITH_SENDFILE ifdefs.
Autobuild-User: Jeremy Allison <jra at samba.org>
Autobuild-Date: Mon Dec 13 23:47:07 CET 2010 on sn-devel-104
commit 6ce365b238755ccd64b1c2aca0933f8e717300b0
Author: Jeremy Allison <jra at samba.org>
Date: Mon Dec 13 13:34:50 2010 -0800
We need to start off with smb2.credits_granted == 0. That way
when processing the faked up SMB2 NegProt from the SMB1 packet we
always allocate one credit on reply.
Jeremy.
commit 27a47eb9fc869a1ee6c18f4165e1dccc9a8bee26
Author: Jeremy Allison <jra at samba.org>
Date: Mon Dec 13 13:17:49 2010 -0800
Remove extra unused credit arg. to smbd_smb2_request_setup_out()
-----------------------------------------------------------------------
Summary of changes:
source3/smbd/reply.c | 7 -------
source3/smbd/smb2_server.c | 11 ++++++-----
source3/utils/status_profile.c | 2 --
3 files changed, 6 insertions(+), 14 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 5af5dac..9601f53 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2864,7 +2864,6 @@ static ssize_t fake_sendfile(files_struct *fsp, SMB_OFF_T startpos,
return (ssize_t)nread;
}
-#if defined(WITH_SENDFILE)
/****************************************************************************
Deal with the case of sendfile reading less bytes from the file than
requested. Fill with zeros (all we can do).
@@ -2934,7 +2933,6 @@ static void sendfile_short_send(files_struct *fsp,
SAFE_FREE(buf);
}
}
-#endif /* defined WITH_SENDFILE */
/****************************************************************************
Return a readbraw error (4 bytes of zero).
@@ -2978,7 +2976,6 @@ static void send_file_readbraw(connection_struct *conn,
char *outbuf = NULL;
ssize_t ret=0;
-#if defined(WITH_SENDFILE)
/*
* We can only use sendfile on a non-chained packet
* but we can use on a non-oplocked file. tridge proved this
@@ -3053,7 +3050,6 @@ static void send_file_readbraw(connection_struct *conn,
}
normal_readbraw:
-#endif
outbuf = TALLOC_ARRAY(NULL, char, nread+4);
if (!outbuf) {
@@ -3528,7 +3524,6 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req,
goto nosendfile_read;
}
-#if defined(WITH_SENDFILE)
/*
* We can only use sendfile on a non-chained packet
* but we can use on a non-oplocked file. tridge proved this
@@ -3621,8 +3616,6 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req,
normal_read:
-#endif
-
if ((smb_maxcnt & 0xFF0000) > 0x10000) {
uint8 headerbuf[smb_size + 2*12];
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 9ed74fc..91e00dc 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -111,7 +111,7 @@ static NTSTATUS smbd_initialize_smb2(struct smbd_server_connection *sconn)
sconn->smb2.sessions.limit = 0x0000FFFE;
sconn->smb2.sessions.list = NULL;
sconn->smb2.seqnum_low = 0;
- sconn->smb2.credits_granted = 1;
+ sconn->smb2.credits_granted = 0;
sconn->smb2.max_credits = lp_smb2_max_credits();
sconn->smb2.credits_bitmap = bitmap_talloc(sconn, 2*sconn->smb2.max_credits);
if (sconn->smb2.credits_bitmap == NULL) {
@@ -453,7 +453,8 @@ static void smb2_set_operation_credit(struct smbd_server_connection *sconn,
sconn->smb2.credits_granted));
if (credits_granted == 0 && sconn->smb2.credits_granted == 0) {
- /* Ensure the client credits can never drop to zero. */
+ /* First negprot packet, or ensure the client credits can
+ never drop to zero. */
credits_granted = 1;
}
@@ -481,7 +482,7 @@ static void smb2_calculate_credits(const struct smbd_smb2_request *inreq,
}
}
-static NTSTATUS smbd_smb2_request_setup_out(struct smbd_smb2_request *req, uint16_t creds)
+static NTSTATUS smbd_smb2_request_setup_out(struct smbd_smb2_request *req)
{
struct iovec *vector;
int count;
@@ -2178,7 +2179,7 @@ void smbd_smb2_first_negprot(struct smbd_server_connection *sconn,
return;
}
- status = smbd_smb2_request_setup_out(req, 1);
+ status = smbd_smb2_request_setup_out(req);
if (!NT_STATUS_IS_OK(status)) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
@@ -2233,7 +2234,7 @@ static void smbd_smb2_request_incoming(struct tevent_req *subreq)
return;
}
- status = smbd_smb2_request_setup_out(req, 5);
+ status = smbd_smb2_request_setup_out(req);
if (!NT_STATUS_IS_OK(status)) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
diff --git a/source3/utils/status_profile.c b/source3/utils/status_profile.c
index d39ae2d..ec0ea03 100644
--- a/source3/utils/status_profile.c
+++ b/source3/utils/status_profile.c
@@ -81,11 +81,9 @@ bool status_profile_dump(bool verbose)
d_printf("pwrite_count: %u\n", profile_p->syscall_pwrite_count);
d_printf("pwrite_time: %u\n", profile_p->syscall_pwrite_time);
d_printf("pwrite_bytes: %u\n", profile_p->syscall_pwrite_bytes);
-#ifdef WITH_SENDFILE
d_printf("sendfile_count: %u\n", profile_p->syscall_sendfile_count);
d_printf("sendfile_time: %u\n", profile_p->syscall_sendfile_time);
d_printf("sendfile_bytes: %u\n", profile_p->syscall_sendfile_bytes);
-#endif
d_printf("lseek_count: %u\n", profile_p->syscall_lseek_count);
d_printf("lseek_time: %u\n", profile_p->syscall_lseek_time);
d_printf("rename_count: %u\n", profile_p->syscall_rename_count);
--
Samba Shared Repository
More information about the samba-cvs
mailing list