diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2003-04-24 20:36:41 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2003-04-24 20:36:41 +0000 |
commit | ec750c5d525a225efa84a9b3090646e2e9b9c427 (patch) | |
tree | 42a49524ced8004f51209ffe15cbba5e2f9a9b64 /source3/passdb | |
parent | 08b30fcf2701a7eb75e75a922cc7f8da601450e7 (diff) | |
download | samba-ec750c5d525a225efa84a9b3090646e2e9b9c427.tar.gz samba-ec750c5d525a225efa84a9b3090646e2e9b9c427.tar.bz2 samba-ec750c5d525a225efa84a9b3090646e2e9b9c427.zip |
- Get rid of module_path_get_name()
- Use find backend function to find duplicates
- declare static function before using it
(This used to be commit ad5ebd4f2065425a9edffc753c0f0414fd6f98d4)
Diffstat (limited to 'source3/passdb')
-rw-r--r-- | source3/passdb/pdb_interface.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index 337b563c54..57424bb2d8 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -34,6 +34,8 @@ static void lazy_initialize_passdb(void) initialized = True; } +static struct pdb_init_function_entry *pdb_find_backend_entry(const char *name); + BOOL smb_register_passdb(const char *name, pdb_init_function init, int version) { struct pdb_init_function_entry *entry = backends; @@ -43,13 +45,9 @@ BOOL smb_register_passdb(const char *name, pdb_init_function init, int version) DEBUG(5,("Attempting to register passdb backend %s\n", name)); - /* Check for duplicates */ - while(entry) { - if(strcasecmp(name, entry->name) == 0) { - DEBUG(0,("There already is a passdb backend registered with the name %s!\n", name)); - return False; - } - entry = entry->next; + if (pdb_find_backend_entry(name)) { + DEBUG(0,("There already is a passdb backend registered with the name %s!\n", name)); + return False; } entry = smb_xmalloc(sizeof(struct pdb_init_function_entry)); @@ -64,12 +62,9 @@ BOOL smb_register_passdb(const char *name, pdb_init_function init, int version) static struct pdb_init_function_entry *pdb_find_backend_entry(const char *name) { struct pdb_init_function_entry *entry = backends; - pstring stripped; - - module_path_get_name(name, stripped); while(entry) { - if (strequal(entry->name, stripped)) return entry; + if (strcasecmp(entry->name, name) == 0) return entry; entry = entry->next; } |