X-Git-Url: http://git.samba.org/?p=samba.git;a=blobdiff_plain;f=source3%2Fsmbd%2Fnotify.c;h=bf3fff7b97db7f00e54bfb5422b869610c28f0f0;hp=44c0b09432e7b201312e5db9c17cdbf38d8f4c28;hb=11f2583420310e0278188935f31be3131eb85fd4;hpb=12fb3ec1dd886c15977ae9eb0b2b25f2017db10d diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index 44c0b09432e..bf3fff7b97d 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -43,6 +43,8 @@ struct notify_change_buf { * 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. @@ -224,11 +226,13 @@ void change_notify_reply(struct smb_request *req, 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)) { /* @@ -276,7 +280,9 @@ void notify_callback(struct smbd_server_connection *sconn, 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); @@ -295,6 +301,7 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32_t filter, } 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));