svn commit: samba r14959 - in branches/SAMBA_4_0/source/ntvfs:
common posix
tridge at samba.org
tridge at samba.org
Fri Apr 7 11:25:21 GMT 2006
Author: tridge
Date: 2006-04-07 11:25:21 +0000 (Fri, 07 Apr 2006)
New Revision: 14959
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14959
Log:
allow change notify to be disabled completely using
notify:enable=False
Modified:
branches/SAMBA_4_0/source/ntvfs/common/notify.c
branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/common/notify.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/common/notify.c 2006-04-07 11:18:34 UTC (rev 14958)
+++ branches/SAMBA_4_0/source/ntvfs/common/notify.c 2006-04-07 11:25:21 UTC (rev 14959)
@@ -83,6 +83,10 @@
char *path;
struct notify_context *notify;
+ if (lp_parm_bool(snum, "notify", "enable", True) != True) {
+ return NULL;
+ }
+
notify = talloc(mem_ctx, struct notify_context);
if (notify == NULL) {
return NULL;
@@ -339,6 +343,11 @@
size_t len;
int depth;
+ /* see if change notify is enabled at all */
+ if (notify == NULL) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+
status = notify_lock(notify);
NT_STATUS_NOT_OK_RETURN(status);
@@ -410,6 +419,11 @@
int i, depth;
struct notify_depth *d;
+ /* see if change notify is enabled at all */
+ if (notify == NULL) {
+ return NT_STATUS_NOT_IMPLEMENTED;
+ }
+
for (listel=notify->list;listel;listel=listel->next) {
if (listel->private == private) {
DLIST_REMOVE(notify->list, listel);
@@ -552,6 +566,11 @@
int depth;
const char *p, *next_p;
+ /* see if change notify is enabled at all */
+ if (notify == NULL) {
+ return;
+ }
+
status = notify_load(notify);
if (!NT_STATUS_IS_OK(status)) {
return;
Modified: branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c 2006-04-07 11:18:34 UTC (rev 14958)
+++ branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c 2006-04-07 11:25:21 UTC (rev 14959)
@@ -185,14 +185,12 @@
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
+ /* allow this to be NULL - we just disable change notify */
pvfs->notify_context = notify_init(pvfs,
pvfs->ntvfs->ctx->server_id,
pvfs->ntvfs->ctx->msg_ctx,
event_context_find(pvfs),
pvfs->ntvfs->ctx->config.snum);
- if (pvfs->notify_context == NULL) {
- return NT_STATUS_INTERNAL_DB_CORRUPTION;
- }
pvfs->sidmap = sidmap_open(pvfs);
if (pvfs->sidmap == NULL) {
More information about the samba-cvs
mailing list