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

Jeremy Allison jra at samba.org
Mon Nov 17 21:47:50 GMT 2008


The branch, v3-2-test has been updated
       via  4cd70457781907edf6641696cc311915905c96fa (commit)
      from  0b4dd0cb1f81126344a6fe3304b46f880089718d (commit)

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


- Log -----------------------------------------------------------------
commit 4cd70457781907edf6641696cc311915905c96fa
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Nov 17 13:46:35 2008 -0800

    Fix bug #5900 reported by monyo at samba.gr.jp - vfs_readonly.so does not work.
    Jeremy.

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

Summary of changes:
 source/modules/vfs_readonly.c |    8 ++++++++
 source/smbd/share_access.c    |    6 ++++--
 source/smbd/uid.c             |    2 +-
 3 files changed, 13 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/modules/vfs_readonly.c b/source/modules/vfs_readonly.c
index d4ddf32..ccb95b5 100644
--- a/source/modules/vfs_readonly.c
+++ b/source/modules/vfs_readonly.c
@@ -64,12 +64,20 @@ static int readonly_connect(vfs_handle_struct *handle,
 					     "period", period_def); 
 
   if (period && period[0] && period[1]) {
+    int i;
     time_t current_time = time(NULL);
     time_t begin_period = get_date(period[0], &current_time);
     time_t end_period   = get_date(period[1], &current_time);
 
     if ((current_time >= begin_period) && (current_time <= end_period)) {
+      connection_struct *conn = handle->conn;
+
       handle->conn->read_only = True;
+
+      /* Wipe out the VUID cache. */
+      for (i=0;i<conn->vuid_cache.entries && i< VUID_CACHE_SIZE;i++) {
+        conn->vuid_cache.array[i].vuid = UID_FIELD_INVALID;
+      }
     }
 
     return SMB_VFS_NEXT_CONNECT(handle, service, user);
diff --git a/source/smbd/share_access.c b/source/smbd/share_access.c
index 5121262..e89934c 100644
--- a/source/smbd/share_access.c
+++ b/source/smbd/share_access.c
@@ -248,9 +248,11 @@ bool user_ok_token(const char *username, struct nt_user_token *token, int snum)
  */
 
 bool is_share_read_only_for_token(const char *username,
-				  struct nt_user_token *token, int snum)
+				struct nt_user_token *token,
+				connection_struct *conn)
 {
-	bool result = lp_readonly(snum);
+	int snum = SNUM(conn);
+	bool result = conn->read_only;
 
 	if (lp_readlist(snum) != NULL) {
 		if (token_contains_name_in_list(username,
diff --git a/source/smbd/uid.c b/source/smbd/uid.c
index ffa643a..631a37f 100644
--- a/source/smbd/uid.c
+++ b/source/smbd/uid.c
@@ -102,7 +102,7 @@ static bool check_user_ok(connection_struct *conn, user_struct *vuser,int snum)
 
 	readonly_share = is_share_read_only_for_token(vuser->user.unix_name,
 						      vuser->nt_user_token,
-						      SNUM(conn));
+						      conn);
 
 	token = conn->nt_user_token ?
 		conn->nt_user_token : vuser->nt_user_token;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list