From 4d3d311148277e63b2834918241271d01e642510 Mon Sep 17 00:00:00 2001 From: nalin Date: Jan 03 2001 08:43:33 +0000 Subject: minor fixes for chains --- diff --git a/lib/user.c b/lib/user.c index 8afaf57..d94d15b 100644 --- a/lib/user.c +++ b/lib/user.c @@ -349,14 +349,14 @@ lu_dispatch(struct lu_context *context, enum lu_dispatch_id id, case user_del: case group_mod: case group_del: - info_module = g_hash_table_lookup(context->modules, - tmp->source_info); auth_module = g_hash_table_lookup(context->modules, tmp->source_auth); - g_assert(info_module != NULL); + info_module = g_hash_table_lookup(context->modules, + tmp->source_info); g_assert(auth_module != NULL); - if(run_single(context, info_module, auth, id, tmp, data) && - run_single(context, auth_module, info, id, tmp, data)) { + g_assert(info_module != NULL); + if(run_single(context, auth_module, info, id, tmp, data) && + run_single(context, info_module, auth, id, tmp, data)) { success = TRUE; } break; diff --git a/modules/krb5.c b/modules/krb5.c index f6a5206..2a5a507 100644 --- a/modules/krb5.c +++ b/modules/krb5.c @@ -166,7 +166,7 @@ lu_krb5_user_add(struct lu_module *module, struct lu_ent *ent) pass = lu_ent_get(ent, LU_USERPASSWORD); for(i = pass; i; i = g_list_next(i)) { password = i->data; - if(password && strncmp(password, "{crypt}", 7)) { + if(password && (strncmp(password, "{crypt}", 7) != 0)) { handle = get_server_handle(module->module_context); if(handle) { err = kadm5_create_principal(handle, @@ -175,6 +175,8 @@ lu_krb5_user_add(struct lu_module *module, struct lu_ent *ent) password); free_server_handle(handle); if(err == KADM5_OK) { + lu_ent_set(ent, LU_USERPASSWORD, + "{crypt}*K*"); ret = TRUE; break; } @@ -255,13 +257,15 @@ lu_krb5_user_mod(struct lu_module *module, struct lu_ent *ent) for(i = pass; i; i = g_list_next(i)) { password = i->data; if(password != NULL) { - if(strncmp(password, "{crypt}", 7)) { + if(strncmp(password, "{crypt}", 7) != 0) { /* A change was requested. */ ret = FALSE; if(kadm5_chpass_principal(handle, principal, password) == KADM5_OK) { /* That change succeeded. */ + lu_ent_set(ent, LU_USERPASSWORD, + "{crypt}*K*"); ret = TRUE; } } diff --git a/po/libuser.pot b/po/libuser.pot index 79ee135..a48d66d 100644 --- a/po/libuser.pot +++ b/po/libuser.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-01-03 00:38-0500\n" +"POT-Creation-Date: 2001-01-03 03:42-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -262,31 +262,31 @@ msgstr "" msgid "freeing lu_ent at %p.\n" msgstr "" -#: samples/lookup.c:41 samples/testuser.c:34 +#: samples/lookup.c:42 samples/testuser.c:34 msgid "Error initializing lu.\n" msgstr "" -#: samples/lookup.c:50 +#: samples/lookup.c:51 #, c-format msgid "Searching for group with ID %d.\n" msgstr "" -#: samples/lookup.c:53 +#: samples/lookup.c:54 #, c-format msgid "Searching for group named %s.\n" msgstr "" -#: samples/lookup.c:59 +#: samples/lookup.c:60 #, c-format msgid "Searching for user with ID %d.\n" msgstr "" -#: samples/lookup.c:62 +#: samples/lookup.c:63 #, c-format msgid "Searching for user named %s.\n" msgstr "" -#: samples/lookup.c:86 +#: samples/lookup.c:89 msgid "Entry not found.\n" msgstr "" diff --git a/samples/lookup.c b/samples/lookup.c index af9a1ff..e63724a 100644 --- a/samples/lookup.c +++ b/samples/lookup.c @@ -2,6 +2,7 @@ #include "config.h" #endif #include +#include #include #include #include @@ -68,6 +69,8 @@ int main(int argc, char **argv) ent = tmp; if(success) { GList *a; + g_print("info data source = '%s'\n", ent->source_info); + g_print("auth data source = '%s'\n", ent->source_auth); attributes = lu_ent_get_attributes(ent); for(a = attributes; a && a->data; a = g_list_next(a)) { if(lu_ent_get(ent, (char*) a->data) != NULL) {