The Samba-Bugzilla – Attachment 3744 Details for
Bug 5900
vfs_readonly.so does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 3.2.x
look (text/plain), 1.96 KB, created by
Jeremy Allison
on 2008-11-17 15:37:31 UTC
(
hide
)
Description:
Patch for 3.2.x
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2008-11-17 15:37:31 UTC
Size:
1.96 KB
patch
obsolete
>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], ¤t_time); > time_t end_period = get_date(period[1], ¤t_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;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5900
:
3736
| 3744