"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);
*/
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,
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;