summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-11-17 14:13:20 -0800
committerJeremy Allison <jra@samba.org>2008-11-17 14:13:20 -0800
commitd8df43e65d507710de72c6743f43127ad14019fc (patch)
tree65c1cda2b08be544e02a5cfed6c30354afb38041 /source3/modules
parenta48abdaa811c76e64a3383fe970e62b7bbb3582c (diff)
downloadsamba-d8df43e65d507710de72c6743f43127ad14019fc.tar.gz
samba-d8df43e65d507710de72c6743f43127ad14019fc.tar.bz2
samba-d8df43e65d507710de72c6743f43127ad14019fc.zip
Fix bug #5900 reported by monyo@samba.gr.jp - vfs_readonly.so does not work.
Jeremy.
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_readonly.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/modules/vfs_readonly.c b/source3/modules/vfs_readonly.c
index d4ddf32e3a..58c83e5e1b 100644
--- a/source3/modules/vfs_readonly.c
+++ b/source3/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);