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

Volker Lendecke vlendec at samba.org
Sun Jun 15 09:46:27 GMT 2008


The branch, v3-3-test has been updated
       via  b92cfd19b459caad34229dfe941cf15fd14a5ce0 (commit)
       via  093bc5f2b33ebf90e04bc17e51b1695b1b932bf2 (commit)
      from  5663587e5e4703f9e3ff6d78d1f3248053ccd4c0 (commit)

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


- Log -----------------------------------------------------------------
commit b92cfd19b459caad34229dfe941cf15fd14a5ce0
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jun 15 11:40:33 2008 +0200

    Remove unused "extern struct current_user" from dir.c

commit 093bc5f2b33ebf90e04bc17e51b1695b1b932bf2
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jun 15 11:39:31 2008 +0200

    Remove the reference to current_user from file_access.c
    
    conn holds the current user info

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

Summary of changes:
 source/smbd/dir.c         |    2 --
 source/smbd/file_access.c |   14 ++++++--------
 2 files changed, 6 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/dir.c b/source/smbd/dir.c
index 7d58497..caa1c41 100644
--- a/source/smbd/dir.c
+++ b/source/smbd/dir.c
@@ -24,8 +24,6 @@
    This module implements directory related functions for Samba.
 */
 
-extern struct current_user current_user;
-
 /* "Special" directory offsets. */
 #define END_OF_DIRECTORY_OFFSET ((long)-1)
 #define START_OF_DIRECTORY_OFFSET ((long)0)
diff --git a/source/smbd/file_access.c b/source/smbd/file_access.c
index 71f3291..f72d6d1 100644
--- a/source/smbd/file_access.c
+++ b/source/smbd/file_access.c
@@ -20,8 +20,6 @@
 
 #include "includes.h"
 
-extern struct current_user current_user;
-
 #undef  DBGC_CLASS
 #define DBGC_CLASS DBGC_ACLS
 
@@ -44,7 +42,7 @@ bool can_access_file_acl(struct connection_struct *conn,
 		return false;
 	}
 
-	result = se_access_check(secdesc, current_user.nt_user_token,
+	result = se_access_check(secdesc, conn->server_info->ptok,
 				 access_mask, &access_granted, &status);
 	TALLOC_FREE(secdesc);
 	return result;
@@ -81,13 +79,13 @@ bool can_delete_file_in_directory(connection_struct *conn, const char *fname)
 	if (!S_ISDIR(sbuf.st_mode)) {
 		return False;
 	}
-	if (current_user.ut.uid == 0 || conn->admin_user) {
+	if (conn->server_info->uid == 0 || conn->admin_user) {
 		/* I'm sorry sir, I didn't know you were root... */
 		return True;
 	}
 
 	/* Check primary owner write access. */
-	if (current_user.ut.uid == sbuf.st_uid) {
+	if (conn->server_info->uid == sbuf.st_uid) {
 		return (sbuf.st_mode & S_IWUSR) ? True : False;
 	}
 
@@ -108,7 +106,7 @@ bool can_delete_file_in_directory(connection_struct *conn, const char *fname)
 		 * for bug #3348. Don't assume owning sticky bit
 		 * directory means write access allowed.
 		 */
-		if (current_user.ut.uid != sbuf_file.st_uid) {
+		if (conn->server_info->uid != sbuf_file.st_uid) {
 			return False;
 		}
 	}
@@ -137,7 +135,7 @@ bool can_access_file_data(connection_struct *conn, const char *fname, SMB_STRUCT
 	DEBUG(10,("can_access_file_data: requesting 0x%x on file %s\n",
 		(unsigned int)access_mask, fname ));
 
-	if (current_user.ut.uid == 0 || conn->admin_user) {
+	if (conn->server_info->uid == 0 || conn->admin_user) {
 		/* I'm sorry sir, I didn't know you were root... */
 		return True;
 	}
@@ -150,7 +148,7 @@ bool can_access_file_data(connection_struct *conn, const char *fname, SMB_STRUCT
 	}
 
 	/* Check primary owner access. */
-	if (current_user.ut.uid == psbuf->st_uid) {
+	if (conn->server_info->uid == psbuf->st_uid) {
 		switch (access_mask) {
 			case FILE_READ_DATA:
 				return (psbuf->st_mode & S_IRUSR) ? True : False;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list