* we only append.
*/
+ uint32_t max_buffer_size;
+
/*
* num_changes == -1 means that we have got a catch-all change, when
* asked we just return NT_STATUS_OK without specific changes.
return;
}
- if (max_param == 0 || notify_buf == NULL) {
+ if (notify_buf == NULL) {
reply_fn(req, NT_STATUS_OK, NULL, 0);
return;
}
+ max_param = MIN(max_param, notify_buf->max_buffer_size);
+
if (!notify_marshall_changes(notify_buf->num_changes, max_param,
notify_buf->changes, &blob)) {
/*
files_forall(sconn, notify_fsp_cb, &state);
}
-NTSTATUS change_notify_create(struct files_struct *fsp, uint32_t filter,
+NTSTATUS change_notify_create(struct files_struct *fsp,
+ uint32_t max_buffer_size,
+ uint32_t filter,
bool recursive)
{
size_t len = fsp_fullbasepath(fsp, NULL, 0);
}
fsp->notify->filter = filter;
fsp->notify->subdir_filter = recursive ? filter : 0;
+ fsp->notify->max_buffer_size = max_buffer_size;
fsp_fullbasepath(fsp, fullpath, sizeof(fullpath));
if (fsp->notify == NULL) {
- status = change_notify_create(fsp, filter, recursive);
-
+ status = change_notify_create(fsp,
+ max_param_count,
+ filter,
+ recursive);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(10, ("change_notify_create returned %s\n",
nt_errstr(status)));
void notify_callback(struct smbd_server_connection *sconn,
void *private_data, struct timespec when,
const struct notify_event *e);
-NTSTATUS change_notify_create(struct files_struct *fsp, uint32_t filter,
+NTSTATUS change_notify_create(struct files_struct *fsp,
+ uint32_t max_buffer_size,
+ uint32_t filter,
bool recursive);
NTSTATUS change_notify_add_request(struct smb_request *req,
uint32_t max_param,