diff options
author | Steven Danneman <steven.danneman@isilon.com> | 2009-02-17 16:20:18 -0800 |
---|---|---|
committer | Steven Danneman <steven.danneman@isilon.com> | 2009-02-20 14:10:30 -0800 |
commit | 9a90cbea83548bffb224151a24005cb916f238f5 (patch) | |
tree | c0e4ca5360ef916ee0a9d862115632249474d06b | |
parent | b329ea1cf35cfe151ac026eefc8ff82b2dfd711c (diff) | |
download | samba-9a90cbea83548bffb224151a24005cb916f238f5.tar.gz samba-9a90cbea83548bffb224151a24005cb916f238f5.tar.bz2 samba-9a90cbea83548bffb224151a24005cb916f238f5.zip |
s3: Make change notify immediately return a catch-all packet on underlying error
* This allows a problem in the underlying CN backend to be bubbled up
to the general CN layer so a catch-all reply can be returned
* We now also return a catch-all response immediately if the server-side
event queue becomes too big
-rw-r--r-- | source3/smbd/notify.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index e360af9ef5..8ceeaf5f55 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -372,13 +372,26 @@ static void notify_fsp(files_struct *fsp, uint32 action, const char *name) if ((fsp->notify->num_changes > 1000) || (name == NULL)) { /* * The real number depends on the client buf, just provide a - * guard against a DoS here. + * guard against a DoS here. If name == NULL the CN backend is + * alerting us to a problem. Possibly dropped events. Clear + * queued changes and send the catch-all response to the client + * if a request is pending. */ TALLOC_FREE(fsp->notify->changes); fsp->notify->num_changes = -1; + if (fsp->notify->requests != NULL) { + change_notify_reply(fsp->conn, + fsp->notify->requests->req, + fsp->notify->requests->max_param, + fsp->notify); + change_notify_remove_request(fsp->notify->requests); + } return; } + /* If we've exceeded the server side queue or received a NULL name + * from the underlying CN implementation, don't queue up any more + * requests until we can send a catch-all response to the client */ if (fsp->notify->num_changes == -1) { return; } |