[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Sat Jun 12 03:59:46 MDT 2010
The branch, master has been updated
via 46a48ed... s3: Use "sconn" argument in smbd_[un]lock_socket_internal
via d7bc5fe... s3: Pass sconn to init_smb_request()
via edfc7ea... s3: Add "smbd_server_connection" to smb_request
via 312a508... s3: Fix some nonempty lines
from 8d8678f... s4:dsdb Allow calling dsdb_convert_object_ex() directly
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 46a48edcdfc043a400310e6b1b84d0469c5623e1
Author: Volker Lendecke <vl at samba.org>
Date: Sat Jun 12 11:06:24 2010 +0200
s3: Use "sconn" argument in smbd_[un]lock_socket_internal
Metze, please check!
commit d7bc5fe7346e4f6c3f04be96618046879666a127
Author: Volker Lendecke <vl at samba.org>
Date: Sat Jun 12 11:01:27 2010 +0200
s3: Pass sconn to init_smb_request()
commit edfc7eaf6ddd0e08c6a8544230c42f50ed45d9aa
Author: Volker Lendecke <vl at samba.org>
Date: Sat Jun 12 11:01:10 2010 +0200
s3: Add "smbd_server_connection" to smb_request
commit 312a508e8880bead0d5a3343540f67e7696a00a0
Author: Volker Lendecke <vl at samba.org>
Date: Sat Jun 12 10:28:42 2010 +0200
s3: Fix some nonempty lines
-----------------------------------------------------------------------
Summary of changes:
source3/include/smb.h | 1 +
source3/smbd/process.c | 29 ++++++++++++++++-------------
source3/smbd/service.c | 15 +++++++--------
3 files changed, 24 insertions(+), 21 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 877588a..3cbd0c0 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -612,6 +612,7 @@ struct smb_request {
size_t unread_bytes;
bool encrypted;
connection_struct *conn;
+ struct smbd_server_connection *sconn;
struct smb_perfcount_data pcd;
/*
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 9dc43c4..6b48d96 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -46,19 +46,19 @@ static bool smbd_lock_socket_internal(struct smbd_server_connection *sconn)
{
bool ok;
- if (smbd_server_conn->smb1.echo_handler.socket_lock_fd == -1) {
+ if (sconn->smb1.echo_handler.socket_lock_fd == -1) {
return true;
}
- smbd_server_conn->smb1.echo_handler.ref_count++;
+ sconn->smb1.echo_handler.ref_count++;
- if (smbd_server_conn->smb1.echo_handler.ref_count > 1) {
+ if (sconn->smb1.echo_handler.ref_count > 1) {
return true;
}
DEBUG(10,("pid[%d] wait for socket lock\n", (int)sys_getpid()));
- ok = fcntl_lock(smbd_server_conn->smb1.echo_handler.socket_lock_fd,
+ ok = fcntl_lock(sconn->smb1.echo_handler.socket_lock_fd,
SMB_F_SETLKW, 0, 0, F_WRLCK);
if (!ok) {
return false;
@@ -80,17 +80,17 @@ static bool smbd_unlock_socket_internal(struct smbd_server_connection *sconn)
{
bool ok;
- if (smbd_server_conn->smb1.echo_handler.socket_lock_fd == -1) {
+ if (sconn->smb1.echo_handler.socket_lock_fd == -1) {
return true;
}
- smbd_server_conn->smb1.echo_handler.ref_count--;
+ sconn->smb1.echo_handler.ref_count--;
- if (smbd_server_conn->smb1.echo_handler.ref_count > 0) {
+ if (sconn->smb1.echo_handler.ref_count > 0) {
return true;
}
- ok = fcntl_lock(smbd_server_conn->smb1.echo_handler.socket_lock_fd,
+ ok = fcntl_lock(sconn->smb1.echo_handler.socket_lock_fd,
SMB_F_SETLKW, 0, 0, F_UNLCK);
if (!ok) {
return false;
@@ -440,11 +440,12 @@ static NTSTATUS receive_smb_talloc(TALLOC_CTX *mem_ctx, int fd,
* Initialize a struct smb_request from an inbuf
*/
-static bool init_smb_request(struct smb_request *req, const uint8 *inbuf,
+static bool init_smb_request(struct smb_request *req,
+ struct smbd_server_connection *sconn,
+ const uint8 *inbuf,
size_t unread_bytes, bool encrypted,
uint32_t seqnum)
{
- struct smbd_server_connection *sconn = smbd_server_conn;
size_t req_size = smb_len(inbuf) + 4;
/* Ensure we have at least smb_size bytes. */
if (req_size < smb_size) {
@@ -465,6 +466,7 @@ static bool init_smb_request(struct smb_request *req, const uint8 *inbuf,
req->buf = (const uint8_t *)smb_buf(inbuf);
req->unread_bytes = unread_bytes;
req->encrypted = encrypted;
+ req->sconn = sconn;
req->conn = conn_find(sconn,req->tid);
req->chain_fsp = NULL;
req->chain_outbuf = NULL;
@@ -1561,8 +1563,8 @@ static void construct_reply(char *inbuf, int size, size_t unread_bytes,
smb_panic("could not allocate smb_request");
}
- if (!init_smb_request(req, (uint8 *)inbuf, unread_bytes, encrypted,
- seqnum)) {
+ if (!init_smb_request(req, smbd_server_conn, (uint8 *)inbuf,
+ unread_bytes, encrypted, seqnum)) {
exit_server_cleanly("Invalid SMB request");
}
@@ -2585,7 +2587,8 @@ static bool smbd_echo_reply(int fd,
return false;
}
- if (!init_smb_request(&req, inbuf, 0, false, seqnum)) {
+ if (!init_smb_request(&req, smbd_server_conn, inbuf, 0, false,
+ seqnum)) {
return false;
}
req.inbuf = inbuf;
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 8642544..0d6c1e6 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -2,17 +2,17 @@
Unix SMB/CIFS implementation.
service (connection) opening and closing
Copyright (C) Andrew Tridgell 1992-1998
-
+
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 3 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, see <http://www.gnu.org/licenses/>.
*/
@@ -183,7 +183,7 @@ bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir)
conn->lastused_count++;
snum = SNUM(conn);
-
+
if (do_chdir &&
vfs_ChDir(conn,conn->connectpath) != 0 &&
vfs_ChDir(conn,conn->origpath) != 0) {
@@ -198,7 +198,7 @@ bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir)
last_conn = conn;
last_flags = flags;
-
+
/* Obey the client case sensitivity requests - only for clients that support it. */
switch (lp_casesensitive(snum)) {
case Auto:
@@ -292,7 +292,7 @@ int add_home_service(const char *service, const char *username, const char *home
if (!lp_add_home(service, iHomeService, username, homedir)) {
return -1;
}
-
+
return lp_servicenumber(service);
}
@@ -425,7 +425,6 @@ int find_service(fstring service)
static NTSTATUS share_sanity_checks(int snum, fstring dev)
{
-
if (!lp_snum_ok(snum) ||
!check_access(smbd_server_fd(),
lp_hostsallow(snum), lp_hostsdeny(snum))) {
@@ -1181,7 +1180,7 @@ connection_struct *make_connection(struct smbd_server_connection *sconn,
vuser, no_pw,
dev, status);
}
-
+
fstrcpy(service, service_in);
strlower_m(service);
--
Samba Shared Repository
More information about the samba-cvs
mailing list