From 059838a843e8677e69c79ee8dbdc0e575ca54797 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 25 Sep 2002 11:42:30 +0000 Subject: Don't crash when a backend doesn't have a setsampwent function available - bug reported by metze (This used to be commit 4aea951102a6e82612560e6a59931fde433ee6ea) --- source3/passdb/pdb_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c index f5926e54f1..f965dd727c 100644 --- a/source3/passdb/pdb_interface.c +++ b/source3/passdb/pdb_interface.c @@ -41,7 +41,7 @@ const struct pdb_init_function_entry builtin_pdb_init_functions[] = { static BOOL context_setsampwent(struct pdb_context *context, BOOL update) { - if ((!context) || (!context->pdb_methods) || (!context->pdb_methods->setsampwent)) { + if (!context) { DEBUG(0, ("invalid pdb_context specified!\n")); return False; } @@ -53,7 +53,7 @@ static BOOL context_setsampwent(struct pdb_context *context, BOOL update) return True; } - while (!(context->pwent_methods->setsampwent(context->pwent_methods, update))) { + while (!(context->pwent_methods->setsampwent) || !(context->pwent_methods->setsampwent(context->pwent_methods, update))) { context->pwent_methods = context->pwent_methods->next; if (context->pwent_methods == NULL) return False; -- cgit