[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-2851-gd038691

Volker Lendecke vlendec at samba.org
Sun Jun 15 11:42:08 GMT 2008


The branch, v3-3-test has been updated
       via  d0386914ff0f7b0f1edc3302fdc6a25f211712fa (commit)
       via  c8fd5eef32a86888c7a28317f0fdf717a26b7d4c (commit)
      from  b92cfd19b459caad34229dfe941cf15fd14a5ce0 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit d0386914ff0f7b0f1edc3302fdc6a25f211712fa
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jun 15 13:41:16 2008 +0200

    Remove the current_user references from open.c
    
    current_user_info was "only" used in a debug msg, and current_user.ut.uid is
    also available via conn->server_info

commit c8fd5eef32a86888c7a28317f0fdf717a26b7d4c
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jun 15 13:37:53 2008 +0200

    Remove the current_user reference from fake_file.c
    
    The current vuid is not only available there, it is also in the current
    smb_request structure.

-----------------------------------------------------------------------

Summary of changes:
 source/include/proto.h  |    1 +
 source/smbd/fake_file.c |    7 +++----
 source/smbd/open.c      |   13 ++++++-------
 3 files changed, 10 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/proto.h b/source/include/proto.h
index dfde0c7..4bdf808 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -9629,6 +9629,7 @@ void reply_unix_error(struct smb_request *req, uint8 defclass, uint32 defcode,
 
 enum FAKE_FILE_TYPE is_fake_file(const char *fname);
 NTSTATUS open_fake_file(connection_struct *conn,
+				uint16_t current_vuid,
 				enum FAKE_FILE_TYPE fake_file_type,
 				const char *fname,
 				uint32 access_mask,
diff --git a/source/smbd/fake_file.c b/source/smbd/fake_file.c
index 565b557..47982d4 100644
--- a/source/smbd/fake_file.c
+++ b/source/smbd/fake_file.c
@@ -19,8 +19,6 @@
 
 #include "includes.h"
 
-extern struct current_user current_user;
-
 struct fake_file_type {
 	const char *name;
 	enum FAKE_FILE_TYPE type;
@@ -101,6 +99,7 @@ enum FAKE_FILE_TYPE is_fake_file(const char *fname)
 ****************************************************************************/
 
 NTSTATUS open_fake_file(connection_struct *conn,
+				uint16_t current_vuid,
 				enum FAKE_FILE_TYPE fake_file_type,
 				const char *fname,
 				uint32 access_mask,
@@ -110,7 +109,7 @@ NTSTATUS open_fake_file(connection_struct *conn,
 	NTSTATUS status;
 
 	/* access check */
-	if (current_user.ut.uid != 0) {
+	if (conn->server_info->uid != 0) {
 		DEBUG(3, ("open_fake_file_shared: access_denied to "
 			  "service[%s] file[%s] user[%s]\n",
 			  lp_servicename(SNUM(conn)), fname,
@@ -129,7 +128,7 @@ NTSTATUS open_fake_file(connection_struct *conn,
 
 	fsp->conn = conn;
 	fsp->fh->fd = -1;
-	fsp->vuid = current_user.vuid;
+	fsp->vuid = current_vuid;
 	fsp->fh->pos = -1;
 	fsp->can_lock = False; /* Should this be true ? - No, JRA */
 	fsp->access_mask = access_mask;
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 546128c..5a1af42 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -22,8 +22,6 @@
 #include "includes.h"
 
 extern const struct generic_mapping file_generic_mapping;
-extern struct current_user current_user;
-extern userdom_struct current_user_info;
 extern bool global_client_failed_oplock_break;
 
 struct deferred_open_record {
@@ -400,8 +398,7 @@ static NTSTATUS open_file(files_struct *fsp,
 	fsp->wcp = NULL; /* Write cache pointer. */
 
 	DEBUG(2,("%s opened file %s read=%s write=%s (numopen=%d)\n",
-		 *current_user_info.smb_name
-		 ? current_user_info.smb_name : conn->server_info->unix_name,
+		 conn->server_info->unix_name,
 		 fsp->fsp_name,
 		 BOOLSTR(fsp->can_read), BOOLSTR(fsp->can_write),
 		 conn->num_files_open + 1));
@@ -1850,7 +1847,8 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
 		new_file_created = True;
 	}
 
-	set_share_mode(lck, fsp, current_user.ut.uid, 0, fsp->oplock_type, new_file_created);
+	set_share_mode(lck, fsp, conn->server_info->uid, 0, fsp->oplock_type,
+		       new_file_created);
 
 	/* Handle strange delete on close create semantics. */
 	if ((create_options & FILE_DELETE_ON_CLOSE)
@@ -2249,7 +2247,7 @@ NTSTATUS open_directory(connection_struct *conn,
 		return status;
 	}
 
-	set_share_mode(lck, fsp, current_user.ut.uid, 0, NO_OPLOCK, True);
+	set_share_mode(lck, fsp, conn->server_info->uid, 0, NO_OPLOCK, True);
 
 	/* For directories the delete on close bit at open time seems
 	   always to be honored on close... See test 19 in Samba4 BASE-DELETE. */
@@ -2990,7 +2988,8 @@ NTSTATUS create_file(connection_struct *conn,
 			 * also tries a QUERY_FILE_INFO on the file and then
 			 * close it
 			 */
-			status = open_fake_file(conn, fake_file_type, fname,
+			status = open_fake_file(conn, req->vuid,
+						fake_file_type, fname,
 						access_mask, &fsp);
 			if (!NT_STATUS_IS_OK(status)) {
 				goto fail;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list