preview of winsdb stuff

Jelmer Vernooij jelmer at nl.linux.org
Fri Nov 15 18:11:00 GMT 2002


On Fri, Nov 15, 2002 at 06:58:36PM +0100, Stefan (metze) Metzmacher wrote about 'preview of winsdb stuff':
> HI Jelmer,

> here's the preview of my winsdb stuff...

> it's working for me but must be tested a lot!

> I may want move wreld to nmbd as a child process what do you thing?
I think you'd better discuss that with jfm - he's the original author
of wrepld iirc - I'm not really into nmbd (yet...) ;-)


> +/* use this inside a passdb module */
> +#define WINSDB_MODULE_VERSIONING_MAGIC \
> +int winsdb_version(void)\
> +{\
> +	return WINSDB_INTERFACE_VERSION;\
> +}
This can be removed

> +/* Backend to use by default when no backend was specified */
> +#define WINSDB_DEFAULT_BACKEND "tdb"
This should actually be a default for lp_winsdb_backend() - in
params/loadparm.c

> +const struct {
> +	char *module_name;
> +	/* Function to create a member of the sam_methods list */
sam ? ;-)

> +	winsdb_init_function init;
> +} builtin_winsdb_init_functions[] = {
> +	{ "tdb", winsdb_init_tdb },
> +	{ NULL, NULL}
> +};
> +	if(version != WINSDB_INTERFACE_VERSION)
> +		return False;
> +
> +	DEBUG(5,("Attempting to register passdb backend %s\n", name));
Please change passdb -> winsdb
> +
> +	/* Check for duplicates */
> +	while(entry) { 
> +		if(strcasecmp(name, entry->module_name) == 0) { 
> +			DEBUG(0,("There already is a passdb backend registered with the name %s!\n", name));
please change passdb -> winsdb
> +	entry = smb_xmalloc(sizeof(struct pdb_init_function_entry));
passdb -> winsdb
> +	entry->module_name = name;
> +	entry->init = init;

> +
> +	DLIST_ADD(backends, entry);
> +	DEBUG(5,("Successfully added passdb backend '%s'\n", name));
passdb -> winsdb
> +	return True;
> +}
> +	DEBUG(5,("Attempting to find an passdb backend to match %s (%s)\n", backend_string, module_name));
passdb -> winsdb...
> +	while(entry) {
> +		if (strequal(entry->module_name, module_name)) {
> +			DEBUG(5,("Found pdb backend %s\n", module_name));
> +			nt_status = entry->init(*context, module_location);
> +			if (NT_STATUS_IS_OK(nt_status)) {
> +				DEBUG(5,("winsdb backend %s has a valid init\n", backend_string));
> +			} else {
> +				DEBUG(0,("winsdb backend %s did not correctly init (error was %s)\n", backend_string, nt_errstr(nt_status)));
> +			}
> +			SAFE_FREE(module_name);
> +			return nt_status;
> +			break; /* unreached */
> +		}
> +		entry = entry->next;
> +	}
> +
> +	/* No such backend found */
> +	SAFE_FREE(module_name);
> +	return NT_STATUS_INVALID_PARAMETER;
> +}

Jelmer


-- 
Jelmer Vernooij <jelmer at nl.linux.org> - http://nl.linux.org/~jelmer/
 19:04:32 up  3:57, 11 users,  load average: 0.73, 1.02, 0.60



More information about the samba-technical mailing list