summaryrefslogtreecommitdiffstats
path: root/source/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-11-17 14:13:28 -0800
committerKarolin Seeger <kseeger@samba.org>2008-11-18 10:06:57 +0100
commitc88ce26c666d54b9d6f76ebd0d9bd7eafd85db9a (patch)
treea8bf7da13198e8be9a1d0ea004fd3e178477e361 /source/modules
parentff2827098a31e0b9899b8f14a9661cb290b12497 (diff)
downloadsamba-c88ce26c666d54b9d6f76ebd0d9bd7eafd85db9a.tar.gz
samba-c88ce26c666d54b9d6f76ebd0d9bd7eafd85db9a.tar.xz
samba-c88ce26c666d54b9d6f76ebd0d9bd7eafd85db9a.zip
Fix bug #5900 reported by monyo@samba.gr.jp - vfs_readonly.so does not work.
Jeremy. (cherry picked from commit 37233a3f62f4b0e5d4fc3376687f445656bded41)
Diffstat (limited to 'source/modules')
-rw-r--r--source/modules/vfs_readonly.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/modules/vfs_readonly.c b/source/modules/vfs_readonly.c
index d4ddf32e3ac..58c83e5e1be 100644
--- a/source/modules/vfs_readonly.c
+++ b/source/modules/vfs_readonly.c
@@ -64,12 +64,25 @@ 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< VUID_CACHE_SIZE; i++) {
+ struct vuid_cache_entry *ent = ent = &conn->vuid_cache.array[i];
+ ent->vuid = UID_FIELD_INVALID;
+ TALLOC_FREE(ent->server_info);
+ ent->read_only = false;
+ ent->admin_user = false;
+ }
+ conn->vuid_cache.next_entry = 0;
}
return SMB_VFS_NEXT_CONNECT(handle, service, user);