[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Wed Jul 8 02:54:08 CEST 2015
The branch, master has been updated
via 93c91bd Remove ctdb_conn.[ch]
via 4e8e76d notifyd: Add notifydd
via b4d6aee utils: add net notify
via 14b426c notify: Remove two now unused stubs
via 70283ff smbd: Remove SMB_VFS_NOTIFY_WATCH
via c118c30 notify: Re-add notify_walk()
via 0deb657 notifyd: Add notifyd_parse_db()
via 730b025 smbd: Remove the notify_fam module
via ce26c64 smbd: Kernel change notify is done by notifyd
via b434eb5 smbd: Replace the tdb-based notify_internal with notify_msg
via 96a256b smbd: Don't start the notify cleanup anymore
via 72a8fcf smbd: Start the notify daemon
via 802b282 smbd: Add the notify daemon
via 45a2c2e smbd: Add direct notify_fam support
via a24f037 param: Make "kernel change notify" global
via e5895c3 param: Make "change notify" global
via e749174 lib: Add server_id_db_set_exclusive
via bf65865 lib: Add server_id_db_pid()
via b593cc7 lib: Add server_id_db_prune_name
via 07c9f69 lib: Add tevent_req_poll_unix
from 117e87d librpc:ndr:witness: remove an unneeded block, reducing indentation.
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 93c91bddd89be74d7721d36d67112d86b71d0bf1
Author: Volker Lendecke <vl at samba.org>
Date: Sun May 3 16:30:45 2015 +0000
Remove ctdb_conn.[ch]
This was only used in notify_internal.c
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Wed Jul 8 02:53:33 CEST 2015 on sn-devel-104
commit 4e8e76dd597aae36193e440e49cdf225707d66be
Author: Volker Lendecke <vl at samba.org>
Date: Tue Jun 16 14:57:14 2015 +0000
notifyd: Add notifydd
A little standalone notify daemon to play around with.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit b4d6aee15ef5643c1516347cb19402e7dd0b7b95
Author: Volker Lendecke <vl at samba.org>
Date: Mon Jun 15 12:14:03 2015 +0000
utils: add net notify
A little tool to play with the notify daemon
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 14b426ce07ec28713b297b27cfed8d5c61073f07
Author: Volker Lendecke <vl at samba.org>
Date: Fri Jan 9 12:59:46 2015 +0000
notify: Remove two now unused stubs
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 70283ffd38bdaccbf05f66953aec6cfd83611aa5
Author: Volker Lendecke <vl at samba.org>
Date: Fri Dec 12 15:37:30 2014 +0100
smbd: Remove SMB_VFS_NOTIFY_WATCH
No longer needed
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit c118c301c9d9b5eb9244e473ac8f251d40d11526
Author: Volker Lendecke <vl at samba.org>
Date: Fri Jan 9 12:48:56 2015 +0000
notify: Re-add notify_walk()
This used to be a tdb traverse wrapper. Now we get the notify db from
notifyd via messages.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 0deb657ba689c8b0e259b385bce30d4ff56f2810
Author: Volker Lendecke <vl at samba.org>
Date: Fri Jan 9 12:24:58 2015 +0000
notifyd: Add notifyd_parse_db()
The database format notifyd is "private" to it. This makes it
possible for smbcontrol and others to query notifyd's database with
MSG_SMB_NOTIFY_GET_DB and inspect it without having to know exactly what
format it uses.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 730b025d7bf8c951d55db60018c6ef85eae387a3
Author: Volker Lendecke <vl at samba.org>
Date: Fri Nov 21 17:28:02 2014 +0100
smbd: Remove the notify_fam module
This has been moved to main smbd
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit ce26c642724fb95d610c19d7f03e8c1e065219a2
Author: Volker Lendecke <vl at samba.org>
Date: Fri Nov 21 17:23:18 2014 +0100
smbd: Kernel change notify is done by notifyd
smbd itself does not need to call VFS_NOTIFY_WATCH anymore
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit b434eb5077948fb8db2f1cc90556edce34d26af0
Author: Volker Lendecke <vl at samba.org>
Date: Fri Nov 21 17:05:16 2014 +0100
smbd: Replace the tdb-based notify_internal with notify_msg
For the moment, this removes smbstatus -N output. It will come back with
the next commits.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 96a256baf273d8fe5327809b4ff37618c621e2b9
Author: Volker Lendecke <vl at samba.org>
Date: Fri Nov 21 16:58:47 2014 +0100
smbd: Don't start the notify cleanup anymore
We don't have a database to clean up anymore
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 72a8fcf0ca0141be225bab7828539b9615f6018a
Author: Volker Lendecke <vl at samba.org>
Date: Fri Nov 21 16:55:25 2014 +0100
smbd: Start the notify daemon
For this we need the kernel change notify stuff to be global: There's only one
notifyd and we have to pass over the kernel change notify watch function
Signed-off-by: Volker Lendecke <vl at samba.org>
commit 802b282a8f24610dd4ba0b7d3032d400fa5b70ec
Author: Volker Lendecke <vl at samba.org>
Date: Fri Nov 21 16:52:47 2014 +0100
smbd: Add the notify daemon
This adds the notify daemon listening on MSG_SMB_NOTIFY_REC_CHANGE
and MSG_SMB_NOTIFY_TRIGGER messages. It relies on ctdbd to distribute
the notify database and events in a cluster.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 45a2c2ee3f89f66cab0b440f5dc442cc59ebcd79
Author: Volker Lendecke <vl at samba.org>
Date: Thu Nov 20 15:30:51 2014 +0000
smbd: Add direct notify_fam support
notifyd won't have the VFS around, it is a systemwide daemon without
a connection to specific shares. To continue FAM support, notifyd
needs to be able to link it directly. This adds code to make fam
equivalent to inotify.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit a24f0379aca67bf8126878b8a671964d7d936c1c
Author: Volker Lendecke <vl at samba.org>
Date: Fri Nov 21 16:02:27 2014 +0100
param: Make "kernel change notify" global
With a central notifyd, we can't do this per share anymore. Notifyd will
only look at absolute paths, not shares.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit e5895c3c37885c3538666bf6cde75881156419cf
Author: Volker Lendecke <vl at samba.org>
Date: Fri Nov 21 15:53:53 2014 +0100
param: Make "change notify" global
With a central notifyd, we can't do this per share anymore. Notifyd will
only look at absolute paths, not shares.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit e749174dd8207bd9ffcb950d701e89661f3801e3
Author: Volker Lendecke <vl at samba.org>
Date: Tue Jun 9 05:03:25 2015 +0000
lib: Add server_id_db_set_exclusive
This is used for server names where only one instance can exist.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit bf658656e7297077f6b347a748e4f5a26efbe2ca
Author: Volker Lendecke <vl at samba.org>
Date: Mon Jun 8 20:46:54 2015 +0000
lib: Add server_id_db_pid()
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit b593cc78aeaaa5d79ddfccc46bdbac6296a63890
Author: Volker Lendecke <vl at samba.org>
Date: Sun Apr 26 11:02:27 2015 +0200
lib: Add server_id_db_prune_name
With this you can remove a foreign mapping. Required to clean up dead
processes.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 07c9f697692c784af1f5ab254c1638c60dec407f
Author: Volker Lendecke <vl at samba.org>
Date: Wed Jul 9 12:50:24 2014 +0000
lib: Add tevent_req_poll_unix
This makes sync wrappers a bit shorter
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
docs-xml/Samba3-HOWTO/manpages.xml | 1 -
docs-xml/manpages/vfs_notify_fam.8.xml | 70 -
docs-xml/smbdotconf/misc/changenotify.xml | 3 +-
docs-xml/smbdotconf/misc/kernelchangenotify.xml | 3 +-
docs-xml/wscript_build | 1 -
examples/VFS/skel_opaque.c | 14 -
examples/VFS/skel_transparent.c | 16 -
lib/param/param_table.c | 8 +-
lib/util/server_id_db.c | 36 +-
lib/util/server_id_db.h | 3 +
lib/util/tevent_unix.c | 10 +
lib/util/tevent_unix.h | 2 +
librpc/idl/messaging.idl | 13 +
source3/include/vfs.h | 20 +-
source3/include/vfs_macros.h | 5 -
source3/lib/ctdb_conn.c | 547 -------
source3/lib/ctdb_conn.h | 65 -
source3/lib/ctdb_dummy.c | 76 -
source3/lib/server_id_db_util.c | 104 ++
.../lib/server_id_db_util.h | 12 +-
source3/modules/vfs_ceph.c | 18 -
source3/modules/vfs_default.c | 46 -
source3/modules/vfs_full_audit.c | 24 -
source3/modules/vfs_glusterfs.c | 13 -
source3/modules/vfs_time_audit.c | 29 -
source3/modules/wscript_build | 7 -
source3/param/loadparm.c | 5 +-
source3/smbd/notify.c | 22 -
.../vfs_notify_fam.c => smbd/notify_fam.c} | 61 +-
source3/smbd/notify_internal.c | 1278 -----------------
source3/smbd/notify_msg.c | 312 ++++
source3/smbd/notifyd/notifyd.c | 1490 ++++++++++++++++++++
source3/smbd/notifyd/notifyd.h | 156 ++
source3/smbd/notifyd/notifydd.c | 83 ++
source3/smbd/notifyd/tests.c | 118 ++
source3/smbd/notifyd/wscript_build | 19 +
source3/smbd/proto.h | 32 +-
source3/smbd/server.c | 189 ++-
source3/smbd/service.c | 2 +-
source3/smbd/vfs.c | 16 -
source3/torture/proto.h | 1 -
source3/torture/test_ctdbconn.c | 239 ----
source3/torture/torture.c | 1 -
source3/utils/net.c | 8 +
source3/utils/net_notify.c | 198 +++
source3/utils/net_proto.h | 1 +
source3/utils/status.c | 44 +-
source3/wscript_build | 17 +-
48 files changed, 2725 insertions(+), 2713 deletions(-)
delete mode 100644 docs-xml/manpages/vfs_notify_fam.8.xml
delete mode 100644 source3/lib/ctdb_conn.c
delete mode 100644 source3/lib/ctdb_conn.h
create mode 100644 source3/lib/server_id_db_util.c
copy lib/util/close_low_fd.h => source3/lib/server_id_db_util.h (81%)
rename source3/{modules/vfs_notify_fam.c => smbd/notify_fam.c} (86%)
delete mode 100644 source3/smbd/notify_internal.c
create mode 100644 source3/smbd/notify_msg.c
create mode 100644 source3/smbd/notifyd/notifyd.c
create mode 100644 source3/smbd/notifyd/notifyd.h
create mode 100644 source3/smbd/notifyd/notifydd.c
create mode 100644 source3/smbd/notifyd/tests.c
create mode 100644 source3/smbd/notifyd/wscript_build
delete mode 100644 source3/torture/test_ctdbconn.c
create mode 100644 source3/utils/net_notify.c
Changeset truncated at 500 lines:
diff --git a/docs-xml/Samba3-HOWTO/manpages.xml b/docs-xml/Samba3-HOWTO/manpages.xml
index 577ac8b..ad23f49 100644
--- a/docs-xml/Samba3-HOWTO/manpages.xml
+++ b/docs-xml/Samba3-HOWTO/manpages.xml
@@ -58,7 +58,6 @@
<xi:include href="../manpages/vfs_full_audit.8.xml"/>
<xi:include href="../manpages/vfs_gpfs.8.xml"/>
<xi:include href="../manpages/vfs_netatalk.8.xml"/>
- <xi:include href="../manpages/vfs_notify_fam.8.xml"/>
<xi:include href="../manpages/vfs_prealloc.8.xml"/>
<xi:include href="../manpages/vfs_readahead.8.xml"/>
<xi:include href="../manpages/vfs_readonly.8.xml"/>
diff --git a/docs-xml/manpages/vfs_notify_fam.8.xml b/docs-xml/manpages/vfs_notify_fam.8.xml
deleted file mode 100644
index 954aa37..0000000
--- a/docs-xml/manpages/vfs_notify_fam.8.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
-<refentry id="vfs_notify_fam.8">
-
-<refmeta>
- <refentrytitle>vfs_notify_fam</refentrytitle>
- <manvolnum>8</manvolnum>
- <refmiscinfo class="source">Samba</refmiscinfo>
- <refmiscinfo class="manual">System Administration tools</refmiscinfo>
- <refmiscinfo class="version">4.2</refmiscinfo>
-</refmeta>
-
-
-<refnamediv>
- <refname>vfs_notify_fam</refname>
- <refpurpose>FAM support for file change notifications</refpurpose>
-</refnamediv>
-
-<refsynopsisdiv>
- <cmdsynopsis>
- <command>vfs objects = notify_fam</command>
- </cmdsynopsis>
-</refsynopsisdiv>
-
-<refsect1>
- <title>DESCRIPTION</title>
-
- <para>This VFS module is part of the
- <citerefentry><refentrytitle>samba</refentrytitle>
- <manvolnum>7</manvolnum></citerefentry> suite.</para>
-
- <para>The <command>vfs_notify_fam</command> module makes use of
- the system FAM (File Alteration Monitor) daemon to implement
- file change notifications for Windows clients. FAM is generally
- present only on IRIX and some BSD systems.</para>
-
- <para>This module is not stackable.</para>
-
-</refsect1>
-
-<refsect1>
- <title>EXAMPLES</title>
-
- <para>Support FAM notifications globally:</para>
-
-<programlisting>
- <smbconfsection name="[global]"/>
- <smbconfoption name="vfs objects">notify_fam</smbconfoption>
-</programlisting>
-
-</refsect1>
-
-<refsect1>
- <title>VERSION</title>
-
- <para>This man page is correct for version 3.0.25 of the Samba suite.
- </para>
-</refsect1>
-
-<refsect1>
- <title>AUTHOR</title>
-
- <para>The original Samba software and related utilities
- were created by Andrew Tridgell. Samba is now developed
- by the Samba Team as an Open Source project similar
- to the way the Linux kernel is developed.</para>
-
-</refsect1>
-
-</refentry>
diff --git a/docs-xml/smbdotconf/misc/changenotify.xml b/docs-xml/smbdotconf/misc/changenotify.xml
index 1344dce..70793d6 100644
--- a/docs-xml/smbdotconf/misc/changenotify.xml
+++ b/docs-xml/smbdotconf/misc/changenotify.xml
@@ -1,7 +1,6 @@
<samba:parameter name="change notify"
- context="S"
+ context="G"
type="boolean"
- parm="1"
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<description>
<para>This parameter specifies whether Samba should reply
diff --git a/docs-xml/smbdotconf/misc/kernelchangenotify.xml b/docs-xml/smbdotconf/misc/kernelchangenotify.xml
index 1e11bb8..6a41dcb 100644
--- a/docs-xml/smbdotconf/misc/kernelchangenotify.xml
+++ b/docs-xml/smbdotconf/misc/kernelchangenotify.xml
@@ -1,7 +1,6 @@
<samba:parameter name="kernel change notify"
- context="S"
+ context="G"
type="boolean"
- parm="1"
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<description>
<para>This parameter specifies whether Samba should ask the
diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
index f54ae15..5c42a31 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -68,7 +68,6 @@ manpages='''
manpages/vfs_linux_xfs_sgid.8
manpages/vfs_media_harmony.8
manpages/vfs_netatalk.8
- manpages/vfs_notify_fam.8
manpages/vfs_prealloc.8
manpages/vfs_preopen.8
manpages/vfs_readahead.8
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 296a855..7021998 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -490,19 +490,6 @@ static char *skel_realpath(vfs_handle_struct *handle, const char *path)
return NULL;
}
-static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
- struct sys_notify_context *ctx,
- const char *path,
- uint32_t *filter,
- uint32_t *subdir_filter,
- void (*callback) (struct sys_notify_context *
- ctx, void *private_data,
- struct notify_event *ev),
- void *private_data, void *handle_p)
-{
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
static int skel_chflags(vfs_handle_struct *handle, const char *path,
uint flags)
{
@@ -918,7 +905,6 @@ struct vfs_fn_pointers skel_opaque_fns = {
.link_fn = skel_link,
.mknod_fn = skel_mknod,
.realpath_fn = skel_realpath,
- .notify_watch_fn = skel_notify_watch,
.chflags_fn = skel_chflags,
.file_id_create_fn = skel_file_id_create,
.copy_chunk_send_fn = skel_copy_chunk_send,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 10f5ac5..6c6adea 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -579,21 +579,6 @@ static char *skel_realpath(vfs_handle_struct *handle, const char *path)
return SMB_VFS_NEXT_REALPATH(handle, path);
}
-static NTSTATUS skel_notify_watch(struct vfs_handle_struct *handle,
- struct sys_notify_context *ctx,
- const char *path,
- uint32_t *filter,
- uint32_t *subdir_filter,
- void (*callback) (struct sys_notify_context *ctx,
- void *private_data,
- struct notify_event *ev),
- void *private_data, void *handle_p)
-{
- return SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, path,
- filter, subdir_filter, callback,
- private_data, handle_p);
-}
-
static int skel_chflags(vfs_handle_struct *handle, const char *path,
uint flags)
{
@@ -1029,7 +1014,6 @@ struct vfs_fn_pointers skel_transparent_fns = {
.link_fn = skel_link,
.mknod_fn = skel_mknod,
.realpath_fn = skel_realpath,
- .notify_watch_fn = skel_notify_watch,
.chflags_fn = skel_chflags,
.file_id_create_fn = skel_file_id_create,
.copy_chunk_send_fn = skel_copy_chunk_send,
diff --git a/lib/param/param_table.c b/lib/param/param_table.c
index 148f79c..0fdd50d 100644
--- a/lib/param/param_table.c
+++ b/lib/param/param_table.c
@@ -1660,8 +1660,8 @@ struct parm_struct parm_table[] = {
{
.label = "change notify",
.type = P_BOOL,
- .p_class = P_LOCAL,
- .offset = LOCAL_VAR(change_notify),
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(change_notify),
.special = NULL,
.enum_list = NULL,
},
@@ -1676,8 +1676,8 @@ struct parm_struct parm_table[] = {
{
.label = "kernel change notify",
.type = P_BOOL,
- .p_class = P_LOCAL,
- .offset = LOCAL_VAR(kernel_change_notify),
+ .p_class = P_GLOBAL,
+ .offset = GLOBAL_VAR(kernel_change_notify),
.special = NULL,
.enum_list = NULL,
},
diff --git a/lib/util/server_id_db.c b/lib/util/server_id_db.c
index 7f5b055..0874129 100644
--- a/lib/util/server_id_db.c
+++ b/lib/util/server_id_db.c
@@ -74,6 +74,11 @@ void server_id_db_reinit(struct server_id_db *db, struct server_id pid)
TALLOC_FREE(db->names);
}
+struct server_id server_id_db_pid(struct server_id_db *db)
+{
+ return db->pid;
+}
+
static int server_id_db_destructor(struct server_id_db *db)
{
char *name = NULL;
@@ -118,22 +123,18 @@ int server_id_db_add(struct server_id_db *db, const char *name)
return 0;
}
-int server_id_db_remove(struct server_id_db *db, const char *name)
+int server_id_db_prune_name(struct server_id_db *db, const char *name,
+ struct server_id server)
{
struct tdb_context *tdb = db->tdb->tdb;
struct server_id_buf buf;
TDB_DATA key;
uint8_t *data;
- char *ids, *n, *id;
+ char *ids, *id;
int ret;
- n = strv_find(db->names, name);
- if (n == NULL) {
- return ENOENT;
- }
-
key = string_term_tdb_data(name);
- server_id_str_buf(db->pid, &buf);
+ server_id_str_buf(server, &buf);
ret = tdb_chainlock(tdb, key);
if (ret == -1) {
@@ -162,9 +163,22 @@ int server_id_db_remove(struct server_id_db *db, const char *name)
tdb_chainunlock(tdb, key);
- if (ret == -1) {
- enum TDB_ERROR err = tdb_error(tdb);
- return map_unix_error_from_tdb(err);
+ return 0;
+}
+
+int server_id_db_remove(struct server_id_db *db, const char *name)
+{
+ char *n;
+ int ret;
+
+ n = strv_find(db->names, name);
+ if (n == NULL) {
+ return ENOENT;
+ }
+
+ ret = server_id_db_prune_name(db, name, db->pid);
+ if (ret != 0) {
+ return ret;
}
strv_delete(&db->names, n);
diff --git a/lib/util/server_id_db.h b/lib/util/server_id_db.h
index 31b3305..2dcce62 100644
--- a/lib/util/server_id_db.h
+++ b/lib/util/server_id_db.h
@@ -30,8 +30,11 @@ struct server_id_db *server_id_db_init(TALLOC_CTX *mem_ctx,
const char *base_path,
int hash_size, int tdb_flags);
void server_id_db_reinit(struct server_id_db *db, struct server_id pid);
+struct server_id server_id_db_pid(struct server_id_db *db);
int server_id_db_add(struct server_id_db *db, const char *name);
int server_id_db_remove(struct server_id_db *db, const char *name);
+int server_id_db_prune_name(struct server_id_db *db, const char *name,
+ struct server_id server);
int server_id_db_lookup(struct server_id_db *db, const char *name,
TALLOC_CTX *mem_ctx, unsigned *num_servers,
struct server_id **servers);
diff --git a/lib/util/tevent_unix.c b/lib/util/tevent_unix.c
index ee7ec8a..63bdaf6 100644
--- a/lib/util/tevent_unix.c
+++ b/lib/util/tevent_unix.c
@@ -61,3 +61,13 @@ int tevent_req_simple_recv_unix(struct tevent_req *req)
tevent_req_received(req);
return err;
}
+
+bool tevent_req_poll_unix(struct tevent_req *req, struct tevent_context *ev,
+ int *err)
+{
+ bool ret = tevent_req_poll(req, ev);
+ if (!ret) {
+ *err = errno;
+ }
+ return ret;
+}
diff --git a/lib/util/tevent_unix.h b/lib/util/tevent_unix.h
index c1b0eb4..39689d6 100644
--- a/lib/util/tevent_unix.h
+++ b/lib/util/tevent_unix.h
@@ -28,5 +28,7 @@
bool tevent_req_is_unix_error(struct tevent_req *req, int *perrno);
int tevent_req_simple_recv_unix(struct tevent_req *req);
+bool tevent_req_poll_unix(struct tevent_req *req, struct tevent_context *ev,
+ int *err);
#endif
diff --git a/librpc/idl/messaging.idl b/librpc/idl/messaging.idl
index 2b902ec..ca99f41 100644
--- a/librpc/idl/messaging.idl
+++ b/librpc/idl/messaging.idl
@@ -99,6 +99,13 @@ interface messaging
/* Cancel a notify, directory got deleted */
MSG_SMB_NOTIFY_CANCEL_DELETED = 0x0319,
+ /* notifyd messages */
+ MSG_SMB_NOTIFY_REC_CHANGE = 0x031A,
+ MSG_SMB_NOTIFY_TRIGGER = 0x031B,
+ MSG_SMB_NOTIFY_GET_DB = 0x031C,
+ MSG_SMB_NOTIFY_DB = 0x031D,
+ MSG_SMB_NOTIFY_REC_CHANGES = 0x031E,
+
/* winbind messages */
MSG_WINBIND_FINISHED = 0x0401,
MSG_WINBIND_FORGET_STATE = 0x0402,
@@ -152,4 +159,10 @@ interface messaging
uint8 num_fds;
dlong fds[num_fds];
} messaging_rec;
+
+ typedef [public] struct {
+ hyper rec_index;
+ uint32 num_recs;
+ messaging_rec *recs[num_recs];
+ } messaging_reclog;
}
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 081030c..9945375 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -166,6 +166,7 @@
/* Version 33 - change fallocate mode flags param from enum->uint32_t */
/* Version 33 - Add snapshot create/delete calls */
/* Version 33 - Add OS X SMB2 AAPL copyfile extension flag to fsp */
+/* Version 33 - Remove notify_watch_fn */
#define SMB_VFS_INTERFACE_VERSION 33
@@ -626,16 +627,6 @@ struct vfs_fn_pointers {
int (*link_fn)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath);
int (*mknod_fn)(struct vfs_handle_struct *handle, const char *path, mode_t mode, SMB_DEV_T dev);
char *(*realpath_fn)(struct vfs_handle_struct *handle, const char *path);
- NTSTATUS (*notify_watch_fn)(struct vfs_handle_struct *handle,
- struct sys_notify_context *ctx,
- const char *path,
- uint32_t *filter,
- uint32_t *subdir_filter,
- void (*callback)(struct sys_notify_context *ctx,
- void *private_data,
- struct notify_event *ev),
- void *private_data,
- void *handle_p);
int (*chflags_fn)(struct vfs_handle_struct *handle, const char *path, unsigned int flags);
struct file_id (*file_id_create_fn)(struct vfs_handle_struct *handle,
const SMB_STRUCT_STAT *sbuf);
@@ -1093,15 +1084,6 @@ int smb_vfs_call_link(struct vfs_handle_struct *handle, const char *oldpath,
int smb_vfs_call_mknod(struct vfs_handle_struct *handle, const char *path,
mode_t mode, SMB_DEV_T dev);
char *smb_vfs_call_realpath(struct vfs_handle_struct *handle, const char *path);
-NTSTATUS smb_vfs_call_notify_watch(struct vfs_handle_struct *handle,
- struct sys_notify_context *ctx,
- const char *name,
- uint32_t *filter,
- uint32_t *subdir_filter,
- void (*callback)(struct sys_notify_context *ctx,
- void *private_data,
- struct notify_event *ev),
- void *private_data, void *handle_p);
int smb_vfs_call_chflags(struct vfs_handle_struct *handle, const char *path,
unsigned int flags);
struct file_id smb_vfs_call_file_id_create(struct vfs_handle_struct *handle,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 9a686c9..eaf0c19 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -336,11 +336,6 @@
#define SMB_VFS_NEXT_REALPATH(handle, path) \
smb_vfs_call_realpath((handle)->next, (path))
-#define SMB_VFS_NOTIFY_WATCH(conn, ctx, path, filter, subdir_filter, callback, private_data, handle_p) \
- smb_vfs_call_notify_watch((conn)->vfs_handles, (ctx), (path), (filter), (subdir_filter), (callback), (private_data), (handle_p))
-#define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, path, filter, subdir_filter, callback, private_data, handle_p) \
- smb_vfs_call_notify_watch((conn)->next, (ctx), (path), (filter), (subdir_filter), (callback), (private_data), (handle_p))
-
#define SMB_VFS_CHFLAGS(conn, path, flags) \
smb_vfs_call_chflags((conn)->vfs_handles, (path), (flags))
#define SMB_VFS_NEXT_CHFLAGS(handle, path, flags) \
diff --git a/source3/lib/ctdb_conn.c b/source3/lib/ctdb_conn.c
deleted file mode 100644
index 4e1b3e5..0000000
--- a/source3/lib/ctdb_conn.c
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- Samba3 ctdb connection handling
- Copyright (C) Volker Lendecke 2012
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "lib/util/tevent_unix.h"
-#include "ctdb_conn.h"
-
-#include <tdb.h>
-
-#include <ctdb_protocol.h>
-
-#include "lib/async_req/async_sock.h"
-
-struct ctdb_conn {
- int fd;
- struct tevent_queue *outqueue;
-};
-
-struct ctdb_conn_init_state {
- struct sockaddr_un addr;
- struct ctdb_conn *conn;
-};
-
-/*
- * use the callbacks of async_connect_send to make sure
- * we are connecting to CTDB as root
- */
-static void before_connect_cb(void *private_data) {
- become_root();
-}
-
-static void after_connect_cb(void *private_data) {
- unbecome_root();
-}
-
-static void ctdb_conn_init_done(struct tevent_req *subreq);
-static int ctdb_conn_destructor(struct ctdb_conn *conn);
-
-struct tevent_req *ctdb_conn_init_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- const char *sock)
-{
- struct tevent_req *req, *subreq;
- struct ctdb_conn_init_state *state;
- size_t len;
-
- req = tevent_req_create(mem_ctx, &state, struct ctdb_conn_init_state);
- if (req == NULL) {
- return NULL;
- }
-
- if (!lp_clustering()) {
- tevent_req_error(req, ENOSYS);
- return tevent_req_post(req, ev);
- }
--
Samba Shared Repository
More information about the samba-cvs
mailing list