The branch, master has been updated
       via  7637e1d s3-waf: fix the build after winreg and rpc services changes.
       via  a3ee831 s3-perfcount: Create the directory on tdb open.
       via  1c6276c s3-rpc_server: Migrated spoolss to 
dcerpc_winreg_set_multi_sz.
       via  1f0c766 s3-rpc_server: Migrated spoolss to 
dcerpc_winreg_query_dword.
       via  df75045 s3-rpc_server: Migrated spoolss to dcerpc_winreg_set_X.
       via  ee817f6 s3-rpc_server: Migrated spoolss to dcerpc_winreg_set_X.
       via  e8bf397 s3-rpc_server: Migrated spoolss to dcerpc_winreg_set_dword.
       via  460aedc s3-rpc_server: Migrated spoolss to dcerpc_winreg_set_sz..
       via  8238732 s3-rpc_server: Migrated spoolss to dcerpc_winreg_enum_keys.
       via  c6255ad s3-services: Remove obsolete services_db.c.
       via  b2ddfc6 s3-smbd: Init the svcctl registry keys on service startup.
       via  f1d5cea s3-rpc_server: Added a winreg based svcctl registry init.
       via  09dafc4 s3-rpc_server: Added a svcctl shutdown function.
       via  96565db s3-services: Migrated svcctl registry functions to winreg.
       via  1adbbee s3-registry: Remove obsolete reg_eventlog.
       via  a3a38fd s3-smbd: Init the eventlog registry on service startup.
       via  34e8a50 s3-util: Moved eventlog_add_source to admin util.
       via  22ea293 s3-rpc_server: Added a winreg based eventlog registry init.
       via  75abfa6 s3-rpc_server: Migrated eventlog to winreg.
       via  01b49b1 s3-rpc_client: Added a winreg query security descriptor 
helper.
       via  35439a7 s3-rpc_client: Added a winreg set security descriptor 
helper.
       via  a370b96 s3-rpc_client: Added a winreg set binary helper.
       via  56963d1 s3-rpc_client: Added a winreg query sz helper.
       via  69e6db1 s3-rpc_client: Added a winreg helper to enum keys.
       via  8ed91d6 s3-rpc_client: Added a winreg add multi sz helper.
       via  8c119e4 s3-rpc_client: Added a winreg query multi sz helper.
       via  913426b s3-rpc_client: Added a winreg set multi sz helper.
       via  34d3e85 s3-rpc_client: Added a winreg set expand sz helper.
       via  4b32f6c s3-rpc_client: Added a winreg set sz helper.
       via  e5eb758 s3-rpc_client: Added a winreg set dword helper.
       via  d24bd4b s3-rpc_client: Added winreg query binary helper.
       via  9c7607d s3-rpc_client: Added winreg query dword helper.
       via  12cd400 s3-rpc_client: Added dcerpc_winreg_int_openkey().
      from  bcdacff s3-waf: add support for --with-aio-support.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7637e1df8eca417a78d9949b3b776b51ae250d74
Author: Günther Deschner <[email protected]>
Date:   Thu Feb 3 12:25:24 2011 +0100

    s3-waf: fix the build after winreg and rpc services changes.
    
    Andreas, please check.
    
    Guenther
    
    Signed-off-by: Günther Deschner <[email protected]>
    
    Autobuild-User: Günther Deschner <[email protected]>
    Autobuild-Date: Mon Feb  7 13:18:41 CET 2011 on sn-devel-104

commit a3ee831f2dda047d32750a8c7b4a30b6b7eb7519
Author: Andreas Schneider <[email protected]>
Date:   Wed Feb 2 11:47:37 2011 +0100

    s3-perfcount: Create the directory on tdb open.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 1c6276ce7a917d7599205e7b3f9640811c0be24b
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 15:33:02 2011 +0100

    s3-rpc_server: Migrated spoolss to dcerpc_winreg_set_multi_sz.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 1f0c766fa6f776f7ec25cab8634e2ad1f6c7aa50
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 15:29:48 2011 +0100

    s3-rpc_server: Migrated spoolss to dcerpc_winreg_query_dword.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit df75045e0d52b01f650f40e62c65426b5ce2264e
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 15:25:13 2011 +0100

    s3-rpc_server: Migrated spoolss to dcerpc_winreg_set_X.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit ee817f63cec1036ff332667b1e1b0a2478bf51e5
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 15:11:05 2011 +0100

    s3-rpc_server: Migrated spoolss to dcerpc_winreg_set_X.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit e8bf397eb0765db529f9caad7d70639071bcf00c
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 14:58:08 2011 +0100

    s3-rpc_server: Migrated spoolss to dcerpc_winreg_set_dword.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 460aedc4b1e97a7721183e164f5231e735368b14
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 14:48:11 2011 +0100

    s3-rpc_server: Migrated spoolss to dcerpc_winreg_set_sz..
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 8238732330d3dde73b23750d9b5646bfe3d4a39a
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 14:28:39 2011 +0100

    s3-rpc_server: Migrated spoolss to dcerpc_winreg_enum_keys.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit c6255adc6f027cafeca7247ce58bbeae0733d45a
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 13:38:16 2011 +0100

    s3-services: Remove obsolete services_db.c.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit b2ddfc642d0d6a39e6962c61dd178c69f0cd801b
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 11:50:10 2011 +0100

    s3-smbd: Init the svcctl registry keys on service startup.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit f1d5cea322f26aae23ee5fb57207648ec15f8218
Author: Andreas Schneider <[email protected]>
Date:   Mon Jan 31 16:40:16 2011 +0100

    s3-rpc_server: Added a winreg based svcctl registry init.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 09dafc4a256c14db6ca8ed68b99d774e118f7051
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 11:49:33 2011 +0100

    s3-rpc_server: Added a svcctl shutdown function.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 96565db5f66f791968ed354fc8f39464ff0a7e5a
Author: Andreas Schneider <[email protected]>
Date:   Mon Jan 31 16:40:33 2011 +0100

    s3-services: Migrated svcctl registry functions to winreg.
    
    This is a bigger commit. It moves the relevant function to
    svc_winreg_glue. We need to use them in the same commit else we have
    problems with prototypes in proto.h.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 1adbbeef32b71450b6c878ea34b431d19ea39523
Author: Andreas Schneider <[email protected]>
Date:   Fri Jan 28 12:37:18 2011 +0100

    s3-registry: Remove obsolete reg_eventlog.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit a3a38fdb553f978ae58bc0b62db93e1ca2908658
Author: Andreas Schneider <[email protected]>
Date:   Fri Jan 28 12:33:20 2011 +0100

    s3-smbd: Init the eventlog registry on service startup.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 34e8a50e5a71ab0d31bd0c5375a84d3b3ecf61e9
Author: Andreas Schneider <[email protected]>
Date:   Thu Jan 27 18:06:16 2011 +0100

    s3-util: Moved eventlog_add_source to admin util.
    
    This function is only used in the admin util.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 22ea2933818824eb6cf2d760fc474922ca8bbe2c
Author: Andreas Schneider <[email protected]>
Date:   Thu Jan 27 19:22:02 2011 +0100

    s3-rpc_server: Added a winreg based eventlog registry init.
    
    This enumerates the keys first and only creates them if they don't exist
    yet.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 75abfa6f949bcc2e472ae19084fa3309025caa1d
Author: Andreas Schneider <[email protected]>
Date:   Thu Jan 27 15:32:48 2011 +0100

    s3-rpc_server: Migrated eventlog to winreg.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 01b49b1a2b0442954a088035e133bd8f34fd811d
Author: Andreas Schneider <[email protected]>
Date:   Tue Feb 1 11:04:16 2011 +0100

    s3-rpc_client: Added a winreg query security descriptor helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 35439a7b182c235eb8adfc2a6864867b486d1b6a
Author: Andreas Schneider <[email protected]>
Date:   Mon Jan 31 18:40:06 2011 +0100

    s3-rpc_client: Added a winreg set security descriptor helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit a370b9605c98551c9dee5c34b53b92943182a1be
Author: Andreas Schneider <[email protected]>
Date:   Mon Jan 31 18:35:06 2011 +0100

    s3-rpc_client: Added a winreg set binary helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 56963d1f44d137581627eec672b63993585ebf64
Author: Andreas Schneider <[email protected]>
Date:   Mon Jan 31 16:39:34 2011 +0100

    s3-rpc_client: Added a winreg query sz helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 69e6db1a5354c09f038ca158e08f4426863dab34
Author: Andreas Schneider <[email protected]>
Date:   Fri Jan 28 12:08:58 2011 +0100

    s3-rpc_client: Added a winreg helper to enum keys.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 8ed91d602774155859b9d9acaa5909a1a0a68079
Author: Andreas Schneider <[email protected]>
Date:   Fri Jan 28 10:43:49 2011 +0100

    s3-rpc_client: Added a winreg add multi sz helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 8c119e47578e5dadaad32330a77a0cab8557a4a0
Author: Andreas Schneider <[email protected]>
Date:   Fri Jan 28 10:07:57 2011 +0100

    s3-rpc_client: Added a winreg query multi sz helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 913426b0c3cd319aa120d4170a99706a007fcd51
Author: Andreas Schneider <[email protected]>
Date:   Fri Jan 28 09:57:41 2011 +0100

    s3-rpc_client: Added a winreg set multi sz helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 34d3e85f35f5e1c38e686276bc8411fe6d559177
Author: Andreas Schneider <[email protected]>
Date:   Fri Jan 28 09:50:48 2011 +0100

    s3-rpc_client: Added a winreg set expand sz helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 4b32f6c9d54f0fef6b6f3ae056336221bfe867a3
Author: Andreas Schneider <[email protected]>
Date:   Fri Jan 28 09:45:44 2011 +0100

    s3-rpc_client: Added a winreg set sz helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit e5eb7582d30ec10c3fb89b380b35dffdc55595e1
Author: Andreas Schneider <[email protected]>
Date:   Thu Jan 27 16:57:34 2011 +0100

    s3-rpc_client: Added a winreg set dword helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit d24bd4be9186d43c6b438b399aafa2bdff82737e
Author: Andreas Schneider <[email protected]>
Date:   Thu Jan 27 16:20:30 2011 +0100

    s3-rpc_client: Added winreg query binary helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 9c7607d3d384240b2777aafa3ea634383431ec4d
Author: Andreas Schneider <[email protected]>
Date:   Thu Jan 27 15:20:58 2011 +0100

    s3-rpc_client: Added winreg query dword helper.
    
    Signed-off-by: Günther Deschner <[email protected]>

commit 12cd4002e66164a0a85ae0e4a17f1f0abaef7e42
Author: Andreas Schneider <[email protected]>
Date:   Thu Jan 27 12:27:23 2011 +0100

    s3-rpc_client: Added dcerpc_winreg_int_openkey().
    
    Signed-off-by: Günther Deschner <[email protected]>

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

Summary of changes:
 source3/Makefile.in                   |   17 +-
 source3/include/proto.h               |   13 +-
 source3/registry/reg_eventlog.c       |  387 -----------
 source3/registry/reg_eventlog.h       |   29 -
 source3/registry/reg_init_full.c      |    7 -
 source3/registry/reg_perfcount.c      |   20 +-
 source3/registry/reg_perfcount.h      |    1 -
 source3/rpc_client/cli_winreg.c       |  771 +++++++++++++++++++++
 source3/rpc_client/cli_winreg.h       |  384 +++++++++++
 source3/rpc_client/cli_winreg_int.c   |  134 ++++
 source3/rpc_client/cli_winreg_int.h   |   65 ++
 source3/rpc_server/srv_eventlog_nt.c  |   94 ++-
 source3/rpc_server/srv_eventlog_reg.c |  266 ++++++++
 source3/rpc_server/srv_eventlog_reg.h |   29 +
 source3/rpc_server/srv_ntsvcs_nt.c    |    6 +-
 source3/rpc_server/srv_rpc_register.c |   33 +-
 source3/rpc_server/srv_spoolss_util.c | 1210 ++++++++++++++-------------------
 source3/rpc_server/srv_svcctl_nt.c    |  100 ++-
 source3/rpc_server/srv_svcctl_reg.c   |  670 ++++++++++++++++++
 source3/rpc_server/srv_svcctl_reg.h   |   29 +
 source3/rpc_server/wscript_build      |   10 +-
 source3/services/services_db.c        |  726 --------------------
 source3/services/svc_winreg_glue.c    |  364 ++++++++++
 source3/services/svc_winreg_glue.h    |   57 ++
 source3/utils/eventlogadm.c           |  199 ++++++-
 source3/wscript_build                 |   19 +-
 26 files changed, 3678 insertions(+), 1962 deletions(-)
 delete mode 100644 source3/registry/reg_eventlog.c
 delete mode 100644 source3/registry/reg_eventlog.h
 create mode 100644 source3/rpc_client/cli_winreg.c
 create mode 100644 source3/rpc_client/cli_winreg.h
 create mode 100644 source3/rpc_client/cli_winreg_int.c
 create mode 100644 source3/rpc_client/cli_winreg_int.h
 create mode 100644 source3/rpc_server/srv_eventlog_reg.c
 create mode 100644 source3/rpc_server/srv_eventlog_reg.h
 create mode 100644 source3/rpc_server/srv_svcctl_reg.c
 create mode 100644 source3/rpc_server/srv_svcctl_reg.h
 delete mode 100644 source3/services/services_db.c
 create mode 100644 source3/services/svc_winreg_glue.c
 create mode 100644 source3/services/svc_winreg_glue.h


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index 7ea24fb..27de07e 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -347,7 +347,11 @@ LIBCLI_SPOOLSS_OBJ = librpc/gen_ndr/ndr_spoolss_c.o \
 
 LIBCLI_EVENTLOG_OBJ = librpc/gen_ndr/ndr_eventlog_c.o
 
-LIBCLI_WINREG_OBJ = librpc/gen_ndr/ndr_winreg_c.o
+LIBCLI_WINREG_OBJ = librpc/gen_ndr/ndr_winreg_c.o \
+                   rpc_client/cli_winreg.o
+
+LIBCLI_WINREG_INT_OBJ = $(LIBCLI_WINREG_OBJ) \
+                       rpc_client/cli_winreg_int.o
 
 LIBCLI_NTSVCS_OBJ = librpc/gen_ndr/ndr_ntsvcs_c.o
 
@@ -651,7 +655,6 @@ REG_SMBCONF_OBJ = $(REG_BASE_OBJ) \
 REG_FULL_OBJ = $(REG_SMBCONF_OBJ) \
               $(REG_BACKENDS_EXTRA_OBJ) \
               $(REG_INIT_FULL_OBJ) \
-              registry/reg_eventlog.o \
               registry/reg_perfcount.o \
               librpc/gen_ndr/ndr_perfcount.o
 
@@ -684,8 +687,10 @@ RPC_WKSSVC_OBJ =  librpc/gen_ndr/srv_wkssvc.o \
                  rpc_server/srv_wkssvc_nt.o
 
 RPC_SVCCTL_OBJ =  rpc_server/srv_svcctl_nt.o \
+                 rpc_server/srv_svcctl_reg.o \
                  librpc/gen_ndr/srv_svcctl.o \
-                  services/svc_spoolss.o services/svc_rcinit.o 
services/services_db.o \
+                 services/svc_winreg_glue.o \
+                  services/svc_spoolss.o services/svc_rcinit.o  \
                   services/svc_netlogon.o services/svc_winreg.o \
                   services/svc_wins.o
 
@@ -700,6 +705,7 @@ RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss_nt.o \
                  librpc/gen_ndr/srv_spoolss.o
 
 RPC_EVENTLOG_OBJ = rpc_server/srv_eventlog_nt.o \
+                  rpc_server/srv_eventlog_reg.o \
                   $(LIB_EVENTLOG_OBJ) librpc/gen_ndr/srv_eventlog.o
 
 NPA_TSTREAM_OBJ = ../libcli/named_pipe_auth/npa_tstream.o \
@@ -730,7 +736,7 @@ RPC_SERVER_OBJ = $(RPC_LSARPC_OBJ) $(RPC_WINREG_OBJ) 
$(RPC_INITSHUTDOWN_OBJ) \
                 $(RPC_SAMR_OBJ) $(RPC_RPCECHO_OBJ) $(RPC_EPMAPPER_OBJ) \
                 $(RPC_PIPE_OBJ) $(NPA_TSTREAM_OBJ) \
                 $(LIBCLI_SPOOLSS_OBJ) \
-                $(LIBCLI_WINREG_OBJ) \
+                $(LIBCLI_WINREG_INT_OBJ) \
                 $(LIBCLI_SRVSVC_OBJ) \
                 $(LIBCLI_LSA_OBJ) \
                 $(LIBCLI_SAMR_OBJ) \
@@ -1256,8 +1262,7 @@ SMBCQUOTAS_OBJ = utils/smbcquotas.o $(LIBSMB_OBJ) 
$(KRBCLIENT_OBJ) \
 EVTLOGADM_OBJ0 = utils/eventlogadm.o
 
 EVTLOGADM_OBJ  = $(EVTLOGADM_OBJ0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
-               $(LIBSMB_ERR_OBJ) \
-               registry/reg_eventlog.o $(LIB_EVENTLOG_OBJ) \
+               $(LIBSMB_ERR_OBJ) $(LIB_EVENTLOG_OBJ) \
                librpc/gen_ndr/ndr_eventlog.o \
                librpc/gen_ndr/ndr_lsa.o
 
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 94cd0a9..ddb5c5e 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4372,6 +4372,7 @@ char *valid_share_pathname(TALLOC_CTX *ctx, const char 
*dos_pathname);
 /* The following definitions come from rpc_server/srv_svcctl_nt.c  */
 
 bool init_service_op_table( void );
+bool shutdown_service_op_table(void);
 
 /* The following definitions come from rpcclient/cmd_dfs.c  */
 
@@ -4412,18 +4413,6 @@ bool init_service_op_table( void );
 /* The following definitions come from rpcclient/rpcclient.c  */
 
 
-/* The following definitions come from services/services_db.c  */
-
-void svcctl_init_keys( void );
-struct security_descriptor *svcctl_get_secdesc( TALLOC_CTX *ctx, const char 
*name, struct security_token *token );
-bool svcctl_set_secdesc(const char *name, struct security_descriptor *sec_desc,
-                       struct security_token *token);
-const char *svcctl_get_string_value(TALLOC_CTX *ctx, const char *key_name,
-                                   const char *value_name,
-                                   struct security_token *token);
-const char *svcctl_lookup_dispname(TALLOC_CTX *ctx, const char *name, struct 
security_token *token );
-const char *svcctl_lookup_description(TALLOC_CTX *ctx, const char *name, 
struct security_token *token );
-
 /* The following definitions come from services/svc_netlogon.c  */
 
 
diff --git a/source3/registry/reg_eventlog.c b/source3/registry/reg_eventlog.c
deleted file mode 100644
index 6bedf46..0000000
--- a/source3/registry/reg_eventlog.c
+++ /dev/null
@@ -1,387 +0,0 @@
-
-/* 
- *  Unix SMB/CIFS implementation.
- *  Virtual Windows Registry Layer
- *  Copyright (C) Marcin Krzysztof Porwit    2005,
- *  Copyright (C) Brian Moran                2005.
- *  Copyright (C) Gerald (Jerry) Carter      2005.
- *  
- *  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 "registry.h"
-#include "reg_backend_db.h"
-#include "reg_eventlog.h"
-#include "reg_objects.h"
-
-#undef DBGC_CLASS
-#define DBGC_CLASS DBGC_REGISTRY
-
-/**********************************************************************
- for an eventlog, add in the default values
-*********************************************************************/
-
-bool eventlog_init_keys(void)
-{
-       /* Find all of the eventlogs, add keys for each of them */
-       const char **elogs = lp_eventlog_list();
-       char *evtlogpath = NULL;
-       char *evtfilepath = NULL;
-       struct regsubkey_ctr *subkeys;
-       struct regval_ctr *values;
-       uint32 uiMaxSize;
-       uint32 uiRetention;
-       uint32 uiCategoryCount;
-       DATA_BLOB data;
-       TALLOC_CTX *ctx = talloc_tos();
-       WERROR werr;
-
-       while (elogs && *elogs) {
-               werr = regsubkey_ctr_init(ctx, &subkeys);
-               if (!W_ERROR_IS_OK(werr)) {
-                       DEBUG( 0, ( "talloc() failure!\n" ) );
-                       return False;
-               }
-               regdb_fetch_keys(KEY_EVENTLOG, subkeys);
-               regsubkey_ctr_addkey( subkeys, *elogs );
-               if ( !regdb_store_keys( KEY_EVENTLOG, subkeys ) ) {
-                       TALLOC_FREE(subkeys);
-                       return False;
-               }
-               TALLOC_FREE(subkeys);
-
-               /* add in the key of form KEY_EVENTLOG/Application */
-               DEBUG( 5,
-                      ( "Adding key of [%s] to path of [%s]\n", *elogs,
-                        KEY_EVENTLOG ) );
-
-               evtlogpath = talloc_asprintf(ctx, "%s\\%s",
-                         KEY_EVENTLOG, *elogs);
-               if (!evtlogpath) {
-                       return false;
-               }
-               /* add in the key of form KEY_EVENTLOG/Application/Application 
*/
-               DEBUG( 5,
-                      ( "Adding key of [%s] to path of [%s]\n", *elogs,
-                        evtlogpath ) );
-               werr = regsubkey_ctr_init(ctx, &subkeys);
-               if (!W_ERROR_IS_OK(werr)) {
-                       DEBUG( 0, ( "talloc() failure!\n" ) );
-                       return False;
-               }
-               regdb_fetch_keys( evtlogpath, subkeys );
-               regsubkey_ctr_addkey( subkeys, *elogs );
-
-               if ( !regdb_store_keys( evtlogpath, subkeys ) ) {
-                       TALLOC_FREE(subkeys);
-                       return False;
-               }
-               TALLOC_FREE( subkeys );
-
-               /* now add the values to the KEY_EVENTLOG/Application form key 
*/
-
-               werr = regval_ctr_init(ctx, &values);
-               if (!W_ERROR_IS_OK(werr)) {
-                       DEBUG( 0, ( "talloc() failure!\n" ) );
-                       return False;
-               }
-               DEBUG( 5,
-                      ( "Storing values to eventlog path of [%s]\n",
-                        evtlogpath ) );
-               regdb_fetch_values( evtlogpath, values );
-
-
-               if (!regval_ctr_key_exists(values, "MaxSize")) {
-
-                       /* assume we have none, add them all */
-
-                       /* hard code some initial values */
-
-                       /* uiDisplayNameId = 0x00000100; */
-                       uiMaxSize = 0x00080000;
-                       uiRetention = 0x93A80;
-
-                       regval_ctr_addvalue(values, "MaxSize", REG_DWORD,
-                                            (uint8 *)&uiMaxSize,
-                                            sizeof(uint32));
-
-                       regval_ctr_addvalue(values, "Retention", REG_DWORD,
-                                            (uint8 *)&uiRetention,
-                                            sizeof(uint32));
-
-                       regval_ctr_addvalue_sz(values, "PrimaryModule", *elogs);
-                       push_reg_sz(talloc_tos(), &data, *elogs);
-
-                       regval_ctr_addvalue(values, "Sources", REG_MULTI_SZ,
-                                            data.data,
-                                            data.length);
-
-                       evtfilepath = talloc_asprintf(ctx,
-                                       
"%%SystemRoot%%\\system32\\config\\%s.tdb",
-                                       *elogs);
-                       if (!evtfilepath) {
-                               TALLOC_FREE(values);
-                       }
-                       push_reg_sz(talloc_tos(), &data, evtfilepath);
-                       regval_ctr_addvalue(values, "File", REG_EXPAND_SZ, 
data.data,
-                                            data.length);
-                       regdb_store_values(evtlogpath, values);
-
-               }
-
-               TALLOC_FREE(values);
-
-               /* now do the values under KEY_EVENTLOG/Application/Application 
*/
-               TALLOC_FREE(evtlogpath);
-               evtlogpath = talloc_asprintf(ctx, "%s\\%s\\%s",
-                         KEY_EVENTLOG, *elogs, *elogs);
-               if (!evtlogpath) {
-                       return false;
-               }
-
-               werr = regval_ctr_init(ctx, &values);
-               if (!W_ERROR_IS_OK(werr)) {
-                       DEBUG( 0, ( "talloc() failure!\n" ) );
-                       return False;
-               }
-               DEBUG( 5,
-                      ( "Storing values to eventlog path of [%s]\n",
-                        evtlogpath));
-               regdb_fetch_values(evtlogpath, values);
-               if (!regval_ctr_key_exists( values, "CategoryCount")) {
-
-                       /* hard code some initial values */
-
-                       uiCategoryCount = 0x00000007;
-                       regval_ctr_addvalue( values, "CategoryCount",
-                                            REG_DWORD,
-                                            (uint8 *) &uiCategoryCount,
-                                            sizeof( uint32 ) );
-                       push_reg_sz(talloc_tos(), &data,
-                                     "%SystemRoot%\\system32\\eventlog.dll");
-
-                       regval_ctr_addvalue( values, "CategoryMessageFile",
-                                            REG_EXPAND_SZ,
-                                            data.data,
-                                            data.length);
-                       regdb_store_values( evtlogpath, values );
-               }
-               TALLOC_FREE(values);
-               elogs++;
-       }
-
-       return true;
-}
-
-/*********************************************************************
- for an eventlog, add in a source name. If the eventlog doesn't
- exist (not in the list) do nothing.   If a source for the log
- already exists, change the information (remove, replace)
-*********************************************************************/
-
-bool eventlog_add_source( const char *eventlog, const char *sourcename,
-                         const char *messagefile )
-{
-       /* Find all of the eventlogs, add keys for each of them */
-       /* need to add to the value KEY_EVENTLOG/<eventlog>/Sources string 
(Creating if necessary)
-          need to add KEY of source to KEY_EVENTLOG/<eventlog>/<source> */
-
-       const char **elogs = lp_eventlog_list(  );
-       const char **wrklist, **wp;
-       char *evtlogpath = NULL;
-       struct regsubkey_ctr *subkeys;
-       struct regval_ctr *values;
-       struct regval_blob *rval;
-       int ii = 0;
-       bool already_in;
-       int i;
-       int numsources = 0;
-       TALLOC_CTX *ctx = talloc_tos();
-       WERROR werr;
-       DATA_BLOB blob;
-
-       if (!elogs) {
-               return False;
-       }
-
-       for ( i = 0; elogs[i]; i++ ) {
-               if ( strequal( elogs[i], eventlog ) )
-                       break;
-       }
-
-       if ( !elogs[i] ) {
-               DEBUG( 0,
-                      ( "Eventlog [%s] not found in list of valid event 
logs\n",
-                        eventlog ) );
-               return false;   /* invalid named passed in */
-       }
-
-       /* have to assume that the evenlog key itself exists at this point */
-       /* add in a key of [sourcename] under the eventlog key */
-
-       /* todo add to Sources */
-
-       werr = regval_ctr_init(ctx, &values);
-       if(!W_ERROR_IS_OK(werr)) {
-               DEBUG( 0, ( "talloc() failure!\n" ));
-               return false;
-       }
-
-       evtlogpath = talloc_asprintf(ctx, "%s\\%s", KEY_EVENTLOG, eventlog);
-       if (!evtlogpath) {
-               TALLOC_FREE(values);
-               return false;
-       }
-
-       regdb_fetch_values( evtlogpath, values );
-
-
-       if ( !( rval = regval_ctr_getvalue( values, "Sources" ) ) ) {
-               DEBUG( 0, ( "No Sources value for [%s]!\n", eventlog ) );
-               return False;
-       }
-       /* perhaps this adding a new string to a multi_sz should be a fn? */
-       /* check to see if it's there already */
-
-       if ( regval_type(rval) != REG_MULTI_SZ ) {
-               DEBUG( 0,
-                      ( "Wrong type for Sources, should be REG_MULTI_SZ\n" ) );
-               return False;
-       }
-       /* convert to a 'regulah' chars to do some comparisons */
-
-       already_in = False;
-       wrklist = NULL;
-       dump_data(1, regval_data_p(rval), regval_size(rval));
-
-       blob = data_blob_const(regval_data_p(rval), regval_size(rval));
-       if (!pull_reg_multi_sz(talloc_tos(), &blob, &wrklist)) {
-               return false;
-       }
-
-       for (ii=0; wrklist[ii]; ii++) {
-               numsources++;
-       }
-
-       if (numsources > 0) {
-               /* see if it's in there already */
-               wp = wrklist;
-
-               while (wp && *wp ) {
-                       if ( strequal( *wp, sourcename ) ) {
-                               DEBUG( 5,
-                                      ( "Source name [%s] already in list for 
[%s] \n",
-                                        sourcename, eventlog ) );
-                               already_in = True;
-                               break;
-                       }
-                       wp++;
-               }
-       } else {
-               DEBUG( 3,
-                      ( "Nothing in the sources list, this might be a 
problem\n" ) );
-       }
-
-       wp = wrklist;
-
-       if ( !already_in ) {
-               /* make a new list with an additional entry; copy values, add 
another */
-               wp = TALLOC_ARRAY(ctx, const char *, numsources + 2 );
-
-               if ( !wp ) {
-                       DEBUG( 0, ( "talloc() failed \n" ) );
-                       return False;
-               }
-               memcpy( wp, wrklist, sizeof( char * ) * numsources );
-               *( wp + numsources ) = ( char * ) sourcename;
-               *( wp + numsources + 1 ) = NULL;
-               if (!push_reg_multi_sz(ctx, &blob, wp)) {
-                       return false;
-               }
-               dump_data( 1, blob.data, blob.length);
-               regval_ctr_addvalue( values, "Sources", REG_MULTI_SZ,
-                                    blob.data, blob.length);
-               regdb_store_values( evtlogpath, values );
-               data_blob_free(&blob);
-       } else {
-               DEBUG( 3,
-                      ( "Source name [%s] found in existing list of sources\n",
-                        sourcename ) );
-       }
-       TALLOC_FREE(values);
-       TALLOC_FREE(wrklist);   /*  */
-
-       werr = regsubkey_ctr_init(ctx, &subkeys);
-       if (!W_ERROR_IS_OK(werr)) {
-               DEBUG( 0, ( "talloc() failure!\n" ) );
-               return False;
-       }
-       TALLOC_FREE(evtlogpath);
-       evtlogpath = talloc_asprintf(ctx, "%s\\%s", KEY_EVENTLOG, eventlog );
-       if (!evtlogpath) {
-               TALLOC_FREE(subkeys);
-               return false;
-       }
-
-       regdb_fetch_keys( evtlogpath, subkeys );
-
-       if ( !regsubkey_ctr_key_exists( subkeys, sourcename ) ) {
-               DEBUG( 5,
-                      ( " Source name [%s] for eventlog [%s] didn't exist, 
adding \n",
-                        sourcename, eventlog ) );
-               regsubkey_ctr_addkey( subkeys, sourcename );
-               if ( !regdb_store_keys( evtlogpath, subkeys ) )
-                       return False;
-       }
-       TALLOC_FREE(subkeys);
-
-       /* at this point KEY_EVENTLOG/<eventlog>/<sourcename> key is in there. 
Now need to add EventMessageFile */
-
-       /* now allocate room for the source's subkeys */
-
-       werr = regsubkey_ctr_init(ctx, &subkeys);
-       if (!W_ERROR_IS_OK(werr)) {
-               DEBUG( 0, ( "talloc() failure!\n" ) );
-               return False;
-       }
-       TALLOC_FREE(evtlogpath);
-       evtlogpath = talloc_asprintf(ctx, "%s\\%s\\%s",
-                 KEY_EVENTLOG, eventlog, sourcename);
-       if (!evtlogpath) {
-               TALLOC_FREE(subkeys);
-               return false;
-       }
-
-       regdb_fetch_keys( evtlogpath, subkeys );
-
-       /* now add the values to the KEY_EVENTLOG/Application form key */
-       werr = regval_ctr_init(ctx, &values);
-       if (!W_ERROR_IS_OK(werr)) {
-               DEBUG( 0, ( "talloc() failure!\n" ) );
-               return False;
-       }
-       DEBUG( 5,
-              ( "Storing EventMessageFile [%s] to eventlog path of [%s]\n",
-                messagefile, evtlogpath ) );
-
-       regdb_fetch_values( evtlogpath, values );
-
-       regval_ctr_addvalue_sz(values, "EventMessageFile", messagefile);
-       regdb_store_values( evtlogpath, values );
-
-       TALLOC_FREE(values);
-
-       return True;
-}
diff --git a/source3/registry/reg_eventlog.h b/source3/registry/reg_eventlog.h
deleted file mode 100644
index 69f2f99..0000000
--- a/source3/registry/reg_eventlog.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- *  Unix SMB/CIFS implementation.
- *  Virtual Windows Registry Layer
- *  Copyright (C) Marcin Krzysztof Porwit    2005,
- *  Copyright (C) Brian Moran                2005.
- *  Copyright (C) Gerald (Jerry) Carter      2005.


-- 
Samba Shared Repository

Reply via email to