[SCM] Samba Shared Repository - branch v3-3-stable updated - release-3-3-0rc2-113-g4f8c8a8

Karolin Seeger kseeger at samba.org
Fri Jan 9 08:23:22 GMT 2009


The branch, v3-3-stable has been updated
       via  4f8c8a84a39b2fe06e7cdac6bb7dc14d836444a6 (commit)
       via  2ddff1644b80aec9acd6918c43612443d5f269ad (commit)
       via  3634ed69910c86447bde44a163f6ec1e4001b509 (commit)
       via  b7ae32518c7d7f8ba0008a63ebd54bbb992271bd (commit)
       via  336faff11baded723a9701f0e5f9907deac75e8c (commit)
       via  3523b8459b1389929a5d24e7b28962f78dc3b2f2 (commit)
       via  79e930b5fe9d87c197bf08abfe36fe7934420850 (commit)
       via  d134531fb407e54b0c09ac0c983ae44db5e3561e (commit)
       via  60b72b67f5db0b9fe557be84acf03c6141bb84db (commit)
       via  7c7435b224ac09601a96082944b220f42317f332 (commit)
       via  ae0002841e67530abd069f0e0ad6b747a1e59a02 (commit)
       via  13a52176050c86ffcbd6b75bad298ee4160527e5 (commit)
       via  7699c715b0c5b41c2903a667d520ce3c8f20680f (commit)
       via  ec8413188ad69423dfb85b425f4a7c690b02dd5c (commit)
       via  a806c7b1771e140b342c8d1928f65e6bbd8c3528 (commit)
       via  d761bc8faf398c2f1e18cb50c87eb12944333e05 (commit)
       via  29159131ec51311b3bd9e2fd1877361d2368e8c3 (commit)
       via  94e57bb795b88ffcb6af774cf3bf8acf7ff72d32 (commit)
       via  56f8db87c626917c4041eaa9d71a6f357e85a0b4 (commit)
       via  c3a39de351e156d62644b4fd86d43a32dbd76c9c (commit)
       via  5a7e9667ff78764dee0a80cc36768480f6af2c5e (commit)
       via  7db39201adef6b1579b2f62e3ee95b0311cbf643 (commit)
       via  cfc6aeb90b2fdcbac090aeb828e1f1ab1fa5231f (commit)
      from  9b17f7907bca32282d6e56fa28ca62ef84bf7afc (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-stable


- Log -----------------------------------------------------------------
commit 4f8c8a84a39b2fe06e7cdac6bb7dc14d836444a6
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Jan 7 14:55:13 2009 -0800

    Fix bug #6016 - Alternate Data Streams / Extended Attributes seem to conflict.
    Jeremy.
    (cherry picked from commit c5a8337657ebe63e1c12279fcec20a6a1abd8638)

commit 2ddff1644b80aec9acd6918c43612443d5f269ad
Author: boyang <boyang at suse.de>
Date:   Wed Jan 7 11:01:48 2009 -0800

    refresh sequence number as soon as possible when domain->sequence_number == -1 or domain->last_status is not ok.
    (cherry picked from commit 0e058da2ee3f70e66cdf5d27f7deb479fb4ccae0)

commit 3634ed69910c86447bde44a163f6ec1e4001b509
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jan 6 17:35:34 2009 -0800

    Make winbindd_cm.c use winbindd_reinit_after_fork().
    Jeremy.
    (cherry picked from commit 77a4a3976af353f517b5193bae9cfbe0f3ad6f4c)

commit b7ae32518c7d7f8ba0008a63ebd54bbb992271bd
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jan 6 16:06:22 2009 -0800

    Fix bug #6017, - magic script does not work. based on a patch from monyo at samba.gr.jp.
    Jeremy.
    (cherry picked from commit 8bd7b19aaafe96ec6ac0bf700ec9dd337b598c03)

commit 336faff11baded723a9701f0e5f9907deac75e8c
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jan 6 15:15:30 2009 -0800

    Add winbindd_reinit_after_fork(), cleaning out all possible events
    in a forked child.
    Jeremy.
    (cherry picked from commit e7433112f4f05aeaf9a3c03ec58962c4d9e16c7d)

commit 3523b8459b1389929a5d24e7b28962f78dc3b2f2
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Jan 6 13:16:25 2009 -0800

    Factor out lots of common code into a function.
    Jeremy.
    (cherry picked from commit 995fb1dc9c0aaa909dc5928bdffa756ea9402f2d)

commit 79e930b5fe9d87c197bf08abfe36fe7934420850
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Jan 6 11:22:08 2009 -0800

    s3:events: change event_add_timed() prototype to match samba4
    
    metze
    (cherry picked from commit a632a1bcd694cff03de3456dac582800e94c451e)

commit d134531fb407e54b0c09ac0c983ae44db5e3561e
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jan 6 15:13:43 2009 +0100

    s3/swat: Fix creation of the first share using SWAT.
    
    This fixes bug #5965.
    (cherry picked from commit f76614169f1e0a932cf2895702cfa9e8a5735875)

commit 60b72b67f5db0b9fe557be84acf03c6141bb84db
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Jan 6 12:26:23 2009 +0100

    docs: Improve description of the share commands in man smb.conf.
    
    -Correct the parameter names.
    -Fix typos.
    -Fix related parameters.
    
    This fixes bug #6008.
    Thanks to TAKAHASHI Motonobu <monyo at samba.gr.jp> for reporting!
    
    Karolin
    (cherry picked from commit 8b7f66c548ed170d2dab0c91ccff4aca00f4b52d)
    (cherry picked from commit 6f38786aa878bd1a7fc10069773c19b28437fbbb)

commit 7c7435b224ac09601a96082944b220f42317f332
Author: Karolin Seeger <kseeger at samba.org>
Date:   Tue Jan 6 10:26:37 2009 +0100

    docs: Fix example in man vfs_recycle.
    
    This fixes bug #6001.
    Thanks to TAKAHASHI Motonobu <monyo at samba.gr.jp> for reporting!
    
    Karolin
    (cherry picked from commit 9f44a17c3bf36067d04cec036c3e529798932cd7)
    (cherry picked from commit 5e073807f7c4679dd299a2b8f3e2643dc1c82405)

commit ae0002841e67530abd069f0e0ad6b747a1e59a02
Author: Bo Yang <boyang at novell.com>
Date:   Mon Jan 5 21:12:03 2009 -0800

    set entry->refresh_time to make ccache_regain_all_now() work correctly.
    (cherry picked from commit 35c761988df970011722e1cc8dd5ff11dd6d5527)

commit 13a52176050c86ffcbd6b75bad298ee4160527e5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 5 21:06:25 2009 -0800

    s3:events: get rid of the stupid set_event_dispatch_time() function
    
    metze
    (cherry picked from commit ff8ff5379455eafdd11fbd45d31602cf2a5fb57d)

commit 7699c715b0c5b41c2903a667d520ce3c8f20680f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 5 21:05:48 2009 -0800

    s3:events: get rid of the stupid cancel_named_event() function
    
    metze
    (cherry picked from commit 57b419fac63baa6a2b14e8800e04af75b0a6b7cc)

commit ec8413188ad69423dfb85b425f4a7c690b02dd5c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 5 21:05:20 2009 -0800

    s3:events: move prototypes to event.h
    
    metze
    (cherry picked from commit 0add7303ea7cb71c070814306c7d6fc97c7c04c2)

commit a806c7b1771e140b342c8d1928f65e6bbd8c3528
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 5 20:55:24 2009 -0800

    s3:events: remove unused stuff
    
    metze
    (cherry picked from commit 550e0e499a44218694e56243a4898ba7d460314d)

commit d761bc8faf398c2f1e18cb50c87eb12944333e05
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 5 20:54:03 2009 -0800

    s3:winbindd: regain tickets for all ccache entries, when we go online
    
    set_event_dispatch_time() is stupid by design and only handles
    the first event with a given name.
    
    metze
    (cherry picked from commit e1f794a246feab1f100abd961e0e576f0b85453a)

commit 29159131ec51311b3bd9e2fd1877361d2368e8c3
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 5 20:40:19 2009 -0800

    s3:winbindd: cancel all ccache entry events and not just one
    
    cancel_named_event() is stupid by design and also only cancels
    one single event.
    
    metze
    (cherry picked from commit d605077effaf265ea4df66fcaf9007004db61acc)

commit 94e57bb795b88ffcb6af774cf3bf8acf7ff72d32
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 5 20:35:03 2009 -0800

    s3:winbindd: recreate the per domain check_online_event without relying on global state
    
    set_event_dispatch_time() is stupid by design and just picks the first
    event with the given name.
    
    metze
    (cherry picked from commit bd1f723a14578792f4b8fda214096d66d57da208)

commit 56f8db87c626917c4041eaa9d71a6f357e85a0b4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 5 20:20:31 2009 -0800

    s3:winbindd: rename fd_event => winbindd_fd_event
    
    It's really confusing to have two versions of 'fd_event'
    
    metze
    (cherry picked from commit edac3f78c27a59a6c493f718b6b65ed7ef2a675d)

commit c3a39de351e156d62644b4fd86d43a32dbd76c9c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 5 20:12:30 2009 -0800

    s3:winbindd: move WINBINDD_CCACHE_ENTRY and WINBINDD_MEMORY_CREDS to winbindd.h
    
    metze
    (cherry picked from commit 5605f478f2a5682f3410d109c0be233e7527335f)

commit 5a7e9667ff78764dee0a80cc36768480f6af2c5e
Author: Bo Yang <boyang at novell.com>
Date:   Mon Jan 5 20:05:53 2009 -0800

    Fix broken krb5 refresh chain
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit d6eb7f1af2f4097085a4a14e9e88327f039bdf29)

commit 7db39201adef6b1579b2f62e3ee95b0311cbf643
Author: Bo Yang <boyang at novell.com>
Date:   Mon Jan 5 16:19:48 2009 -0800

    clean event context after child is forked.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit ada3145ffe40dfbe89f968e844bfb139a58eab5d)

commit cfc6aeb90b2fdcbac090aeb828e1f1ab1fa5231f
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Jan 5 11:42:52 2009 -0800

    Attempt to fix crash seen with new CUPS async printcap loading code.
    Karolin please pull for 3.3.0.
    Jeremy.
    (cherry picked from commit 9f5c7f55abae9278d4e7ca2f359da1b52d0409a2)

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages-3/vfs_recycle.8.xml           |   13 +-
 docs-xml/smbdotconf/misc/addsharecommand.xml    |   20 +-
 docs-xml/smbdotconf/misc/changesharecommand.xml |   20 +-
 docs-xml/smbdotconf/misc/deletesharecommand.xml |   18 +-
 source/Makefile.in                              |    2 +-
 source/include/event.h                          |   42 +++
 source/include/includes.h                       |    2 +-
 source/include/proto.h                          |   41 +---
 source/include/smb.h                            |    3 -
 source/lib/async_req.c                          |    5 +-
 source/lib/ctdbd_conn.c                         |    3 +-
 source/lib/events.c                             |   71 +----
 source/lib/smbldap.c                            |   12 +-
 source/lib/util.c                               |    3 +
 source/modules/vfs_aio_fork.c                   |    6 +-
 source/nmbd/asyncdns.c                          |    3 +-
 source/nmbd/nmbd.c                              |    3 +-
 source/nmbd/nmbd_processlogon.c                 |    3 +-
 source/nsswitch/winbind_struct_protocol.h       |   27 --
 source/printing/notify.c                        |    3 +-
 source/printing/print_cups.c                    |    5 +-
 source/printing/printing.c                      |    3 +-
 source/rpc_server/srv_samr_nt.c                 |    3 +-
 source/smbd/blocking.c                          |    4 +-
 source/smbd/close.c                             |   16 +-
 source/smbd/dosmode.c                           |   11 +-
 source/smbd/fileio.c                            |    3 +-
 source/smbd/oplock.c                            |    3 +-
 source/smbd/process.c                           |   27 ++-
 source/smbd/server.c                            |    7 +-
 source/utils/smbcontrol.c                       |    7 +-
 source/web/swat.c                               |    2 +-
 source/winbindd/winbindd.c                      |   34 ++-
 source/winbindd/winbindd.h                      |   43 +++-
 source/winbindd/winbindd_cache.c                |   11 +-
 source/winbindd/winbindd_cm.c                   |   72 +++---
 source/winbindd/winbindd_cred_cache.c           |  339 +++++++++++++++++++----
 source/winbindd/winbindd_dual.c                 |  164 +++++++----
 source/winbindd/winbindd_proto.h                |   11 +-
 39 files changed, 664 insertions(+), 401 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/vfs_recycle.8.xml b/docs-xml/manpages-3/vfs_recycle.8.xml
index 0909d34..70ca689 100644
--- a/docs-xml/manpages-3/vfs_recycle.8.xml
+++ b/docs-xml/manpages-3/vfs_recycle.8.xml
@@ -185,14 +185,17 @@
 <refsect1>
 	<title>EXAMPLES</title>
 
-	<para>Log operations on all shares using the LOCAL1 facility
-	and NOTICE priority:</para>
+	<para>Move files "deleted" on <parameter>share</parameter> to
+	<parameter>/data/share/.recycle</parameter> instead of deleting them:
+	</para>
 
 <programlisting>
-        <smbconfsection name="[global]"/>
+        <smbconfsection name="[share]"/>
+	<smbconfoption name="path">/data/share</smbconfoption>
 	<smbconfoption name="vfs objects">recycle</smbconfoption>
-	<smbconfoption name="recycle:facility">LOCAL1</smbconfoption>
-	<smbconfoption name="recycle:priority">NOTICE</smbconfoption>
+	<smbconfoption name="recycle:repository">.recycle</smbconfoption>
+	<smbconfoption name="recycle:keeptree">yes</smbconfoption>
+	<smbconfoption name="recycle:versions">yes</smbconfoption>
 </programlisting>
 
 </refsect1>
diff --git a/docs-xml/smbdotconf/misc/addsharecommand.xml b/docs-xml/smbdotconf/misc/addsharecommand.xml
index 9eb50f3..de8da7b 100644
--- a/docs-xml/smbdotconf/misc/addsharecommand.xml
+++ b/docs-xml/smbdotconf/misc/addsharecommand.xml
@@ -7,15 +7,19 @@
 	<para>
 	Samba 2.2.0 introduced the ability to dynamically add and delete shares via the Windows NT 4.0 Server
 	Manager.  The <parameter moreinfo="none">add share command</parameter> is used to define an external program
-	or script which will add a new service definition to <filename moreinfo="none">smb.conf</filename>.  In order
-	to successfully execute the <parameter moreinfo="none">add share command</parameter>, <command
-	moreinfo="none">smbd</command> requires that the administrator be connected using a root account (i.e.  uid == 0).
+	or script which will add a new service definition to
+	<filename moreinfo="none">smb.conf</filename>.
 	</para>
 
-    <para>
-    If the connected account has <literal>SeDiskOperatorPrivilege</literal>, scripts defined in
-    <parameter moreinfo="none">change share</parameter> parameter are executed as root.
-    </para>
+	<para>
+	In order to successfully execute the
+	<parameter moreinfo="none">add share command</parameter>,
+	<command moreinfo="none">smbd</command> requires that the administrator
+	connects using a root account (i.e.  uid == 0) or has the
+	<literal>SeDiskOperatorPrivilege</literal>.
+	Scripts defined in the <parameter moreinfo="none">add share command</parameter>
+	parameter are executed as root.
+	</para>
 
 	<para>
 	When executed, <command moreinfo="none">smbd</command> will automatically invoke the
@@ -56,7 +60,7 @@
 	</itemizedlist>
 
 	<para>
-	This parameter is only used for add file shares.  To add printer shares, see the <smbconfoption
+	This parameter is only used to add file shares. To add printer shares, see the <smbconfoption
 	name="addprinter command"/>.
 	</para>
 </description>
diff --git a/docs-xml/smbdotconf/misc/changesharecommand.xml b/docs-xml/smbdotconf/misc/changesharecommand.xml
index 5a42e22..2033fcf 100644
--- a/docs-xml/smbdotconf/misc/changesharecommand.xml
+++ b/docs-xml/smbdotconf/misc/changesharecommand.xml
@@ -8,14 +8,17 @@
 	Samba 2.2.0 introduced the ability to dynamically add and delete shares via the Windows NT 4.0 Server
 Manager.  The <parameter moreinfo="none">change share command</parameter> is used to define an external
 program or script which will modify an existing service definition in <filename
-moreinfo="none">smb.conf</filename>.  In order to successfully execute the <parameter moreinfo="none">change
-share command</parameter>, <command moreinfo="none">smbd</command> requires that the administrator be
-connected using a root account (i.e. uid == 0).
+moreinfo="none">smb.conf</filename>.
 	</para>
 
 	<para>
-	If the connected account has <literal>SeDiskOperatorPrivilege</literal>, scripts defined in
-	<parameter moreinfo="none">change share</parameter> parameter are executed as root.
+	In order to successfully execute the
+	<parameter moreinfo="none">change share command</parameter>,
+	<command moreinfo="none">smbd</command> requires that the administrator
+	connects using a root account (i.e. uid == 0) or has the
+	<literal>SeDiskOperatorPrivilege</literal>.
+	Scripts defined in the <parameter moreinfo="none">change share command</parameter>
+	parameter are executed as root.
 	</para>
 
 	<para>
@@ -58,13 +61,14 @@ connected using a root account (i.e. uid == 0).
 	</itemizedlist>
 
 	<para>
-	This parameter is only used modify existing file shares definitions.  To modify
-	printer shares, use the &quot;Printers...&quot; folder as seen when browsing the Samba host.
+	This parameter is only used to modify existing file share definitions.
+	To modify printer shares, use the &quot;Printers...&quot; folder as seen
+	when browsing the Samba host.
 	</para>
 </description>
 
 <related>add share command</related>
 <related>delete share command</related>
 <value type="default"></value>
-<value type="example">/usr/local/bin/addshare</value>
+<value type="example">/usr/local/bin/changeshare</value>
 </samba:parameter>
diff --git a/docs-xml/smbdotconf/misc/deletesharecommand.xml b/docs-xml/smbdotconf/misc/deletesharecommand.xml
index 40eb649..3def6b8 100644
--- a/docs-xml/smbdotconf/misc/deletesharecommand.xml
+++ b/docs-xml/smbdotconf/misc/deletesharecommand.xml
@@ -8,15 +8,17 @@
 	Samba 2.2.0 introduced the ability to dynamically add and delete shares via the Windows NT 4.0 Server
 	Manager.  The <parameter moreinfo="none">delete share command</parameter> is used to define an external
 	program or script which will remove an existing service definition from
-	<filename moreinfo="none">smb.conf</filename>.  In order to successfully execute the
-	<parameter moreinfo="none">delete share command</parameter>, <command moreinfo="none">smbd</command>
-	requires that the administrator be connected using a root account (i.e.  uid == 0).
+	<filename moreinfo="none">smb.conf</filename>.
 	</para>
 
-    <para>
-    If the connected account has <literal>SeDiskOperatorPrivilege</literal>, scripts defined in
-    <parameter moreinfo="none">change share</parameter> parameter are executed as root.
-    </para>
+	<para>In order to successfully execute the
+	<parameter moreinfo="none">delete share command</parameter>,
+	<command moreinfo="none">smbd</command>	requires that the administrator
+	connects using a root account (i.e.  uid == 0) or has the
+	<literal>SeDiskOperatorPrivilege</literal>.
+	Scripts defined in the <parameter moreinfo="none">delete share command</parameter>
+	parameter are executed as root.
+	</para>
 
 	<para>
 	When executed, <command moreinfo="none">smbd</command> will automatically invoke the
@@ -44,7 +46,7 @@
 </description>
 
 <related>add share command</related>
-<related>delete share command</related>
+<related>change share command</related>
 <value type="default"></value>
 <value type="example">/usr/local/bin/delshare</value>
 </samba:parameter>
diff --git a/source/Makefile.in b/source/Makefile.in
index 5e1aed4..597e01f 100644
--- a/source/Makefile.in
+++ b/source/Makefile.in
@@ -724,7 +724,7 @@ NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
 SWAT_OBJ1 = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \
            web/swat.o web/neg_lang.o
 
-SWAT_OBJ = $(SWAT_OBJ1) $(PARAM_OBJ) $(PRINTING_OBJ) $(LIBSMB_OBJ) \
+SWAT_OBJ = $(SWAT_OBJ1) $(PARAM_OBJ) $(PRINTING_OBJ) $(PRINTBASE_OBJ) $(LIBSMB_OBJ) \
 	   $(LOCKING_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(KRBCLIENT_OBJ) \
 	   $(LIB_NONSMBD_OBJ) $(GROUPDB_OBJ) $(PLAINTEXT_AUTH_OBJ) \
 	   $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) $(RPC_PARSE_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBMSRPC_OBJ) \
diff --git a/source/include/event.h b/source/include/event.h
index 0465fae..3d40000 100644
--- a/source/include/event.h
+++ b/source/include/event.h
@@ -18,7 +18,49 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+struct event_context;
+struct fd_event;
+struct timed_event;
+
 /* bits for file descriptor event flags */
 #define EVENT_FD_READ 1
 #define EVENT_FD_WRITE 2
 
+/* The following definitions come from lib/events.c  */
+
+struct timed_event *_event_add_timed(struct event_context *event_ctx,
+				TALLOC_CTX *mem_ctx,
+				struct timeval when,
+				const char *event_name,
+				void (*handler)(struct event_context *event_ctx,
+						struct timed_event *te,
+						struct timeval now,
+						void *private_data),
+				void *private_data);
+#define event_add_timed(event_ctx, mem_ctx, when, handler, private_data) \
+	_event_add_timed(event_ctx, mem_ctx, when, #handler, handler, private_data)
+struct fd_event *event_add_fd(struct event_context *event_ctx,
+			      TALLOC_CTX *mem_ctx,
+			      int fd, uint16_t flags,
+			      void (*handler)(struct event_context *event_ctx,
+					      struct fd_event *event,
+					      uint16 flags,
+					      void *private_data),
+			      void *private_data);
+void event_fd_set_writeable(struct fd_event *fde);
+void event_fd_set_not_writeable(struct fd_event *fde);
+void event_fd_set_readable(struct fd_event *fde);
+void event_fd_set_not_readable(struct fd_event *fde);
+bool event_add_to_select_args(struct event_context *event_ctx,
+			      const struct timeval *now,
+			      fd_set *read_fds, fd_set *write_fds,
+			      struct timeval *timeout, int *maxfd);
+bool run_events(struct event_context *event_ctx,
+		int selrtn, fd_set *read_fds, fd_set *write_fds);
+struct timeval *get_timed_events_timeout(struct event_context *event_ctx,
+					 struct timeval *to_ret);
+int event_loop_once(struct event_context *ev);
+void event_context_reinit(struct event_context *ev);
+struct event_context *event_context_init(TALLOC_CTX *mem_ctx);
+void dump_event_list(struct event_context *event_ctx);
+
diff --git a/source/include/includes.h b/source/include/includes.h
index b90f12a..d130171 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -657,6 +657,7 @@ typedef char fstring[FSTRING_LEN];
 #define talloc_get_type_abort(ptr, type) \
 	(type *)talloc_check_name_abort(ptr, #type)
 
+#include "event.h"
 #include "nt_status.h"
 #include "ads.h"
 #include "ads_dns.h"
@@ -717,7 +718,6 @@ typedef char fstring[FSTRING_LEN];
 #include "nsswitch/winbind_client.h"
 #include "spnego.h"
 #include "rpc_client.h"
-#include "event.h"
 #include "dbwrap.h"
 #include "packet.h"
 #include "ctdbd_conn.h"
diff --git a/source/include/proto.h b/source/include/proto.h
index 95de3f9..6b7291f 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -519,46 +519,6 @@ void display_set_stderr(void);
 NTSTATUS map_nt_error_from_unix(int unix_error);
 int map_errno_from_nt_status(NTSTATUS status);
 
-/* The following definitions come from lib/events.c  */
-
-struct timed_event *event_add_timed(struct event_context *event_ctx,
-				TALLOC_CTX *mem_ctx,
-				struct timeval when,
-				const char *event_name,
-				void (*handler)(struct event_context *event_ctx,
-						struct timed_event *te,
-						const struct timeval *now,
-						void *private_data),
-				void *private_data);
-struct fd_event *event_add_fd(struct event_context *event_ctx,
-			      TALLOC_CTX *mem_ctx,
-			      int fd, uint16_t flags,
-			      void (*handler)(struct event_context *event_ctx,
-					      struct fd_event *event,
-					      uint16 flags,
-					      void *private_data),
-			      void *private_data);
-void event_fd_set_writeable(struct fd_event *fde);
-void event_fd_set_not_writeable(struct fd_event *fde);
-void event_fd_set_readable(struct fd_event *fde);
-void event_fd_set_not_readable(struct fd_event *fde);
-bool event_add_to_select_args(struct event_context *event_ctx,
-			      const struct timeval *now,
-			      fd_set *read_fds, fd_set *write_fds,
-			      struct timeval *timeout, int *maxfd);
-bool events_pending(struct event_context *event_ctx);
-bool run_events(struct event_context *event_ctx,
-		int selrtn, fd_set *read_fds, fd_set *write_fds);
-struct timeval *get_timed_events_timeout(struct event_context *event_ctx,
-					 struct timeval *to_ret);
-int event_loop_once(struct event_context *ev);
-struct event_context *event_context_init(TALLOC_CTX *mem_ctx);
-int set_event_dispatch_time(struct event_context *event_ctx,
-			    const char *event_name, struct timeval when);
-int cancel_named_event(struct event_context *event_ctx,
-		       const char *event_name);
-void dump_event_list(struct event_context *event_ctx);
-
 /* The following definitions come from lib/fault.c  */
 
 void fault_setup(void (*fn)(void *));
@@ -1297,6 +1257,7 @@ int set_blocking(int fd, bool set);
 void smb_msleep(unsigned int t);
 void become_daemon(bool Fork, bool no_process_group);
 bool reinit_after_fork(struct messaging_context *msg_ctx,
+		       struct event_context *ev_ctx,
 		       bool parent_longlived);
 bool yesno(const char *p);
 void *malloc_(size_t size);
diff --git a/source/include/smb.h b/source/include/smb.h
index cea4fe5..e7f08a3 100644
--- a/source/include/smb.h
+++ b/source/include/smb.h
@@ -384,9 +384,6 @@ struct fd_handle {
 	unsigned long gen_id;
 };
 
-struct event_context;
-struct fd_event;
-struct timed_event;
 struct idle_event;
 struct share_mode_entry;
 struct uuid;
diff --git a/source/lib/async_req.c b/source/lib/async_req.c
index 501a6b5..e8c1935 100644
--- a/source/lib/async_req.c
+++ b/source/lib/async_req.c
@@ -104,12 +104,12 @@ void async_req_error(struct async_req *req, NTSTATUS status)
  * @brief Timed event callback
  * @param[in] ev	Event context
  * @param[in] te	The timed event
- * @param[in] now	current time
+ * @param[in] now	zero time
  * @param[in] priv	The async request to be finished
  */
 
 static void async_trigger(struct event_context *ev, struct timed_event *te,
-			  const struct timeval *now, void *priv)
+			  struct timeval now, void *priv)
 {
 	struct async_req *req = talloc_get_type_abort(priv, struct async_req);
 
@@ -140,7 +140,6 @@ bool async_post_status(struct async_req *req, NTSTATUS status)
 	req->status = status;
 
 	if (event_add_timed(req->event_ctx, req, timeval_zero(),
-			    "async_trigger",
 			    async_trigger, req) == NULL) {
 		return false;
 	}
diff --git a/source/lib/ctdbd_conn.c b/source/lib/ctdbd_conn.c
index 424c316..1b07fd4 100644
--- a/source/lib/ctdbd_conn.c
+++ b/source/lib/ctdbd_conn.c
@@ -200,7 +200,7 @@ struct deferred_msg_state {
 
 static void deferred_message_dispatch(struct event_context *event_ctx,
 				      struct timed_event *te,
-				      const struct timeval *now,
+				      struct timeval now,
 				      void *private_data)
 {
 	struct deferred_msg_state *state = talloc_get_type_abort(
@@ -386,7 +386,6 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32 reqid,
 		evt = event_add_timed(conn->msg_ctx->event_ctx,
 				      conn->msg_ctx->event_ctx,
 				      timeval_zero(),
-				      "deferred_message_dispatch",
 				      deferred_message_dispatch,
 				      msg_state);
 		if (evt == NULL) {
diff --git a/source/lib/events.c b/source/lib/events.c
index f031387..0dd8727 100644
--- a/source/lib/events.c
+++ b/source/lib/events.c
@@ -27,7 +27,7 @@ struct timed_event {
 	const char *event_name;
 	void (*handler)(struct event_context *event_ctx,
 			struct timed_event *te,
-			const struct timeval *now,
+			struct timeval now,
 			void *private_data);
 	void *private_data;
 };
@@ -44,16 +44,6 @@ struct fd_event {
 	void *private_data;
 };
 
-#define EVENT_FD_WRITEABLE(fde) \
-	event_set_fd_flags(fde, event_get_fd_flags(fde) | EVENT_FD_WRITE)
-#define EVENT_FD_READABLE(fde) \
-	event_set_fd_flags(fde, event_get_fd_flags(fde) | EVENT_FD_READ)
-
-#define EVENT_FD_NOT_WRITEABLE(fde) \
-	event_set_fd_flags(fde, event_get_fd_flags(fde) & ~EVENT_FD_WRITE)
-#define EVENT_FD_NOT_READABLE(fde) \
-	event_set_fd_flags(fde, event_get_fd_flags(fde) & ~EVENT_FD_READ)
-
 struct event_context {
 	struct timed_event *timed_events;
 	struct fd_event *fd_events;
@@ -98,13 +88,13 @@ static void add_event_by_time(struct timed_event *te)
  handed to it.
 ****************************************************************************/
 
-struct timed_event *event_add_timed(struct event_context *event_ctx,
+struct timed_event *_event_add_timed(struct event_context *event_ctx,
 				TALLOC_CTX *mem_ctx,
 				struct timeval when,
 				const char *event_name,
 				void (*handler)(struct event_context *event_ctx,
 						struct timed_event *te,
-						const struct timeval *now,
+						struct timeval now,
 						void *private_data),
 				void *private_data)
 {
@@ -225,21 +215,6 @@ bool event_add_to_select_args(struct event_context *event_ctx,
 	return True;
 }
 
-bool events_pending(struct event_context *event_ctx)
-{
-	struct fd_event *fde;
-
-	if (event_ctx->timed_events != NULL) {
-		return True;
-	}
-	for (fde = event_ctx->fd_events; fde; fde = fde->next) {
-		if (fde->flags & (EVENT_FD_READ|EVENT_FD_WRITE)) {
-			return True;
-		}
-	}
-	return False;
-}
-
 bool run_events(struct event_context *event_ctx,
 		int selrtn, fd_set *read_fds, fd_set *write_fds)
 {
@@ -266,7 +241,7 @@ bool run_events(struct event_context *event_ctx,
 
 		event_ctx->timed_events->handler(
 			event_ctx,
-			event_ctx->timed_events, &now,
+			event_ctx->timed_events, now,
 			event_ctx->timed_events->private_data);
 
 		fired = True;
@@ -369,6 +344,12 @@ static int event_context_destructor(struct event_context *ev)
 	return 0;
 }
 
+void event_context_reinit(struct event_context *ev)
+{
+	event_context_destructor(ev);
+	return;
+}
+
 struct event_context *event_context_init(TALLOC_CTX *mem_ctx)
 {
 	struct event_context *result;
@@ -382,38 +363,6 @@ struct event_context *event_context_init(TALLOC_CTX *mem_ctx)
 	return result;
 }
 
-int set_event_dispatch_time(struct event_context *event_ctx,
-			    const char *event_name, struct timeval when)
-{
-	struct timed_event *te;
-
-	for (te = event_ctx->timed_events; te; te = te->next) {
-		if (strcmp(event_name, te->event_name) == 0) {
-			DLIST_REMOVE(event_ctx->timed_events, te);
-			te->when = when;
-			add_event_by_time(te);
-			return 1;
-		}
-	}
-	return 0;
-}
-
-/* Returns 1 if event was found and cancelled, 0 otherwise. */
-
-int cancel_named_event(struct event_context *event_ctx,
-		       const char *event_name)
-{
-	struct timed_event *te;
-
-	for (te = event_ctx->timed_events; te; te = te->next) {
-		if (strcmp(event_name, te->event_name) == 0) {
-			TALLOC_FREE(te);
-			return 1;
-		}
-	}
-	return 0;
-}
-
 void dump_event_list(struct event_context *event_ctx)
 {
 	struct timed_event *te;
diff --git a/source/lib/smbldap.c b/source/lib/smbldap.c
index 9c2ee3a..8e7ecdf 100644
--- a/source/lib/smbldap.c
+++ b/source/lib/smbldap.c
@@ -1014,7 +1014,7 @@ static int smbldap_connect_system(struct smbldap_state *ldap_state, LDAP * ldap_
 
 static void smbldap_idle_fn(struct event_context *event_ctx,
 			    struct timed_event *te,
-			    const struct timeval *now,
+			    struct timeval now,
 			    void *private_data);
 
 /**********************************************************************


-- 
Samba Shared Repository


More information about the samba-cvs mailing list