r1292: Add const to the subsystem/module registration code.
authorAndrew Bartlett <abartlet@samba.org>
Tue, 29 Jun 2004 09:20:18 +0000 (09:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:56:49 +0000 (12:56 -0500)
Add some 'multi init' code, until we get a better set of infrustructure.

Andrew Bartlett
(This used to be commit 982422b2d286335378531ae9523e74192340af3c)

source4/auth/auth.c
source4/include/module.h
source4/lib/module.c
source4/smbd/process_model.c

index f33330f5de78593aaaeae70f45ac07ce2bed2158..703df21d45324981cbc4250be1097a973d9929d5 100644 (file)
@@ -409,7 +409,7 @@ static int num_backends;
   The 'name' can be later used by other backends to find the operations
   structure for this backend.
 */
-static NTSTATUS auth_register(void *_ops)
+static NTSTATUS auth_register(const void *_ops)
 {
        const struct auth_operations *ops = _ops;
        struct auth_operations *new_ops;
@@ -467,7 +467,6 @@ const struct auth_critical_sizes *auth_interface_version(void)
                sizeof(struct auth_operations),
                sizeof(struct auth_methods),
                sizeof(struct auth_context),
-               sizeof(struct auth_ntlmssp_state),
                sizeof(struct auth_usersupplied_info),
                sizeof(struct auth_serversupplied_info),
                sizeof(struct auth_str),
@@ -482,6 +481,13 @@ const struct auth_critical_sizes *auth_interface_version(void)
 BOOL auth_init(void)
 {
        NTSTATUS status;
+       
+       /* ugly cludge, to go away */
+       static BOOL initialised;
+
+       if (initialised) {
+               return True;
+       }
 
        status = register_subsystem("auth", auth_register); 
        if (!NT_STATUS_IS_OK(status)) {
@@ -491,6 +497,7 @@ BOOL auth_init(void)
        /* FIXME: Perhaps panic if a basic backend, such as SAM, fails to initialise? */
        static_init_auth;
 
+       initialised = True;
        DEBUG(3,("AUTH subsystem version %d initialised\n", AUTH_INTERFACE_VERSION));
        return True;
 }
index 02826595e4013befc20635d0266add8cb82d7981..5994b85f8ea9f07cb25d3cb226dabf989d6cb3bb 100644 (file)
@@ -25,6 +25,6 @@
 typedef NTSTATUS (*init_module_function) (void);
 
 /* Module that registers a backend for a certain subsystem */
-typedef NTSTATUS (*register_backend_function) (void *data);
+typedef NTSTATUS (*register_backend_function) (const void *data);
 
 #endif /* _MODULE_H */
index 1fcb57fac18a5bfb969dbf5820ec6c7e748eb399..c724d872ee970b516941b2c4cacccd7dac9d11c1 100644 (file)
@@ -153,7 +153,7 @@ NTSTATUS register_subsystem(const char *name, register_backend_function callback
        return NT_STATUS_OK;
 }
 
-NTSTATUS register_backend(const char *subsystem, void *args)
+NTSTATUS register_backend(const char *subsystem, const void *args)
 {
        /* Find the specified subsystem */
        struct subsystem *s = subsystems;
index 16bce3913d3241646fb9aa2e05035c89113e8920..f981b36798d3ca82d8539a9daa7de7ea8fdbfe9c 100644 (file)
@@ -57,7 +57,7 @@ static int num_models;
   The 'name' can be later used by other backends to find the operations
   structure for this backend.  
 */
-static NTSTATUS register_process_model(void *_ops)
+static NTSTATUS register_process_model(const void *_ops)
 {
        const struct model_ops *ops = _ops;