summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-02-01 15:11:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:39 -0500
commitbad8c39f1ce48229c1ca545c03de6b7c26b7ba9f (patch)
tree936776b3feaa2c07089c5706af345a50118b1b26 /source3
parent1898eaddb805e86d0c36bd289e7fa61d7bbd4810 (diff)
downloadsamba-bad8c39f1ce48229c1ca545c03de6b7c26b7ba9f.tar.gz
samba-bad8c39f1ce48229c1ca545c03de6b7c26b7ba9f.tar.bz2
samba-bad8c39f1ce48229c1ca545c03de6b7c26b7ba9f.zip
r21111: Reorganize the change notify params a bit. We now have the per-share
parameters change notify = [yes]/no # do we do it at all kernel change notify = [yes]/no # enable/disable inotify Those who want FAM need to say change notify = yes vfs objects = notify_fam Volker (This used to be commit c3a44d8b9606fc516faceb69b8e87bfc8be312f3)
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_default.c10
-rw-r--r--source3/param/loadparm.c20
-rw-r--r--source3/smbd/notify_internal.c3
3 files changed, 16 insertions, 17 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 0efffe154d..458618ee0b 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -842,10 +842,14 @@ static NTSTATUS vfswrap_notify_watch(vfs_handle_struct *vfs_handle,
void *private_data, void *handle)
{
#ifdef HAVE_INOTIFY
- return inotify_watch(ctx, e, callback, private_data, handle);
-#else
- return NT_STATUS_OK;
+ if (lp_kernel_change_notify(ctx->conn->params)) {
+ return inotify_watch(ctx, e, callback, private_data, handle);
+ }
#endif
+ /*
+ * Do nothing, leave everything to notify_internal.c
+ */
+ return NT_STATUS_OK;
}
static size_t vfswrap_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, int fd, uint32 security_info, SEC_DESC **ppdesc)
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 8634c48b31..f7dd30475a 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -299,8 +299,6 @@ typedef struct {
BOOL bHostnameLookups;
BOOL bUnixExtensions;
BOOL bDisableNetbios;
- BOOL bKernelChangeNotify;
- BOOL bFamChangeNotify;
BOOL bUseKerberosKeytab;
BOOL bDeferSharingViolations;
BOOL bEnablePrivileges;
@@ -452,11 +450,12 @@ typedef struct {
BOOL bAclCheckPermissions;
BOOL bAclMapFullControl;
BOOL bAclGroupControl;
+ BOOL bChangeNotify;
+ BOOL bKernelChangeNotify;
int iallocation_roundup_size;
int iAioReadSize;
int iAioWriteSize;
int iMap_readonly;
- int ichange_notify_timeout;
param_opt_struct *param_opt;
char dummy[3]; /* for alignment */
@@ -591,11 +590,12 @@ static service sDefault = {
True, /* bAclCheckPermissions */
True, /* bAclMapFullControl */
False, /* bAclGroupControl */
+ True, /* bChangeNotify */
+ True, /* bKernelChangeNotify */
SMB_ROUNDUP_ALLOCATION_SIZE, /* iallocation_roundup_size */
0, /* iAioReadSize */
0, /* iAioWriteSize */
MAP_READONLY_YES, /* iMap_readonly */
- 60, /* ichange_notify_timeout = 1 minute default. */
NULL, /* Parametric options */
@@ -1006,12 +1006,11 @@ static struct parm_struct parm_table[] = {
{N_("Tuning Options"), P_SEP, P_SEPARATOR},
{"block size", P_INTEGER, P_LOCAL, &sDefault.iBlock_size, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE | FLAG_GLOBAL},
- {"change notify timeout", P_INTEGER, P_LOCAL, &sDefault.ichange_notify_timeout, NULL, NULL, FLAG_ADVANCED},
{"deadtime", P_INTEGER, P_GLOBAL, &Globals.deadtime, NULL, NULL, FLAG_ADVANCED},
{"getwd cache", P_BOOL, P_GLOBAL, &use_getwd_cache, NULL, NULL, FLAG_ADVANCED},
{"keepalive", P_INTEGER, P_GLOBAL, &keepalive, NULL, NULL, FLAG_ADVANCED},
- {"kernel change notify", P_BOOL, P_GLOBAL, &Globals.bKernelChangeNotify, NULL, NULL, FLAG_ADVANCED},
- {"fam change notify", P_BOOL, P_GLOBAL, &Globals.bFamChangeNotify, NULL, NULL, FLAG_ADVANCED},
+ {"change notify", P_BOOL, P_LOCAL, &sDefault.bChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE },
+ {"kernel change notify", P_BOOL, P_LOCAL, &sDefault.bKernelChangeNotify, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE },
{"lpq cache time", P_INTEGER, P_GLOBAL, &Globals.lpqcachetime, NULL, NULL, FLAG_ADVANCED},
{"max smbd processes", P_INTEGER, P_GLOBAL, &Globals.iMaxSmbdProcesses, NULL, NULL, FLAG_ADVANCED},
@@ -1524,8 +1523,6 @@ static void init_globals(BOOL first_time_only)
Globals.max_wins_ttl = 60 * 60 * 24 * 6; /* 6 days default. */
Globals.min_wins_ttl = 60 * 60 * 6; /* 6 hours default. */
Globals.machine_password_timeout = 60 * 60 * 24 * 7; /* 7 days default. */
- Globals.bKernelChangeNotify = True; /* On if we have it. */
- Globals.bFamChangeNotify = True; /* On if we have it. */
Globals.lm_announce = 2; /* = Auto: send only if LM clients found */
Globals.lm_interval = 60;
Globals.announce_as = ANNOUNCE_AS_NT_SERVER;
@@ -1939,8 +1936,8 @@ FN_GLOBAL_BOOL(lp_unix_extensions, &Globals.bUnixExtensions)
FN_GLOBAL_BOOL(lp_use_spnego, &Globals.bUseSpnego)
FN_GLOBAL_BOOL(lp_client_use_spnego, &Globals.bClientUseSpnego)
FN_GLOBAL_BOOL(lp_hostname_lookups, &Globals.bHostnameLookups)
-FN_GLOBAL_BOOL(lp_kernel_change_notify, &Globals.bKernelChangeNotify)
-FN_GLOBAL_BOOL(lp_fam_change_notify, &Globals.bFamChangeNotify)
+FN_LOCAL_PARM_BOOL(lp_change_notify, bChangeNotify)
+FN_LOCAL_PARM_BOOL(lp_kernel_change_notify, bKernelChangeNotify)
FN_GLOBAL_BOOL(lp_use_kerberos_keytab, &Globals.bUseKerberosKeytab)
FN_GLOBAL_BOOL(lp_defer_sharing_violations, &Globals.bDeferSharingViolations)
FN_GLOBAL_BOOL(lp_enable_privileges, &Globals.bEnablePrivileges)
@@ -2102,7 +2099,6 @@ FN_LOCAL_INTEGER(lp_allocation_roundup_size, iallocation_roundup_size)
FN_LOCAL_INTEGER(lp_aio_read_size, iAioReadSize)
FN_LOCAL_INTEGER(lp_aio_write_size, iAioWriteSize)
FN_LOCAL_INTEGER(lp_map_readonly, iMap_readonly)
-FN_LOCAL_INTEGER(lp_change_notify_timeout, ichange_notify_timeout)
FN_LOCAL_CHAR(lp_magicchar, magic_char)
FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time)
FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo)
diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c
index 506ad15b71..afa4e0922b 100644
--- a/source3/smbd/notify_internal.c
+++ b/source3/smbd/notify_internal.c
@@ -77,8 +77,7 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,
{
struct notify_context *notify;
- if (!lp_parm_bool(conn->params->service, "notify", "enable",
- True)) {
+ if (!lp_change_notify(conn->params)) {
return NULL;
}