| 1 | /*
|
|---|
| 2 | Unix SMB/CIFS implementation.
|
|---|
| 3 | change notify handling
|
|---|
| 4 | Copyright (C) Andrew Tridgell 2000
|
|---|
| 5 | Copyright (C) Jeremy Allison 1994-1998
|
|---|
| 6 | Copyright (C) Volker Lendecke 2007
|
|---|
| 7 |
|
|---|
| 8 | This program is free software; you can redistribute it and/or modify
|
|---|
| 9 | it under the terms of the GNU General Public License as published by
|
|---|
| 10 | the Free Software Foundation; either version 2 of the License, or
|
|---|
| 11 | (at your option) any later version.
|
|---|
| 12 |
|
|---|
| 13 | This program is distributed in the hope that it will be useful,
|
|---|
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 16 | GNU General Public License for more details.
|
|---|
| 17 |
|
|---|
| 18 | You should have received a copy of the GNU General Public License
|
|---|
| 19 | along with this program; if not, write to the Free Software
|
|---|
| 20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|---|
| 21 | */
|
|---|
| 22 |
|
|---|
| 23 | #include "includes.h"
|
|---|
| 24 |
|
|---|
| 25 | struct notify_change_request {
|
|---|
| 26 | struct notify_change_request *prev, *next;
|
|---|
| 27 | struct files_struct *fsp; /* backpointer for cancel by mid */
|
|---|
| 28 | char request_buf[smb_size];
|
|---|
| 29 | uint32 filter;
|
|---|
| 30 | uint32 max_param;
|
|---|
| 31 | struct notify_mid_map *mid_map;
|
|---|
| 32 | void *backend_data;
|
|---|
| 33 | };
|
|---|
| 34 |
|
|---|
| 35 | static void notify_fsp(files_struct *fsp, uint32 action, const char *name);
|
|---|
| 36 |
|
|---|
| 37 | static struct notify_mid_map *notify_changes_by_mid;
|
|---|
| 38 |
|
|---|
| 39 | /*
|
|---|
| 40 | * For NTCancel, we need to find the notify_change_request indexed by
|
|---|
| 41 | * mid. Separate list here.
|
|---|
| 42 | */
|
|---|
| 43 |
|
|---|
| 44 | struct notify_mid_map {
|
|---|
| 45 | struct notify_mid_map *prev, *next;
|
|---|
| 46 | struct notify_change_request *req;
|
|---|
| 47 | uint16 mid;
|
|---|
| 48 | };
|
|---|
| 49 |
|
|---|
| 50 | static BOOL notify_change_record_identical(struct notify_change *c1,
|
|---|
| 51 | struct notify_change *c2)
|
|---|
| 52 | {
|
|---|
| 53 | /* Note this is deliberately case sensitive. */
|
|---|
|
|---|