From 6a9f177fbaeae43cdcc9a53c788f8f5fd52bbfce Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 2 Oct 2013 19:56:58 -0700 Subject: [PATCH] Change strength_check to take a saner argument order It makes more sense to pass in the principal before the password. Change all the internal APIs to use that order. --- plugin/general.c | 2 +- plugin/heimdal.c | 2 +- plugin/internal.h | 2 +- plugin/mit.c | 2 +- tools/heimdal-strength.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/general.c b/plugin/general.c index 963f02c..8a26acd 100644 --- a/plugin/general.c +++ b/plugin/general.c @@ -115,7 +115,7 @@ only_alpha_space(const char *password) */ krb5_error_code strength_check(krb5_context ctx UNUSED, krb5_pwqual_moddata data, - const char *password, const char *principal) + const char *principal, const char *password) { krb5_error_code code; diff --git a/plugin/heimdal.c b/plugin/heimdal.c index cdd13a2..0acae9f 100644 --- a/plugin/heimdal.c +++ b/plugin/heimdal.c @@ -93,7 +93,7 @@ heimdal_pwcheck(krb5_context ctx, krb5_principal principal, } /* Do the password strength check. */ - code = strength_check(ctx, data, pastring, name); + code = strength_check(ctx, data, name, pastring); if (code != 0) convert_error(ctx, code, NULL, message, length); diff --git a/plugin/internal.h b/plugin/internal.h index 14171e6..5063db3 100644 --- a/plugin/internal.h +++ b/plugin/internal.h @@ -65,7 +65,7 @@ krb5_error_code strength_init(krb5_context, const char *dictionary, * message and returns a Kerberos status code. */ krb5_error_code strength_check(krb5_context, krb5_pwqual_moddata, - const char *password, const char *principal); + const char *principal, const char *password); /* Free the subset of internal data used by the CDB dictionary checks. */ void strength_close_cdb(krb5_context, krb5_pwqual_moddata); diff --git a/plugin/mit.c b/plugin/mit.c index 5f45ce4..d68ad57 100644 --- a/plugin/mit.c +++ b/plugin/mit.c @@ -60,7 +60,7 @@ check(krb5_context ctx, krb5_pwqual_moddata data, const char *password, code = krb5_unparse_name(ctx, princ, &name); if (code != 0) return code; - code = strength_check(ctx, data, password, name); + code = strength_check(ctx, data, name, password); krb5_free_unparsed_name(ctx, name); return code; } diff --git a/tools/heimdal-strength.c b/tools/heimdal-strength.c index d75c65e..51416c7 100644 --- a/tools/heimdal-strength.c +++ b/tools/heimdal-strength.c @@ -70,7 +70,7 @@ check_password(krb5_context ctx, krb5_pwqual_moddata data) sysdie("Cannot read end of entry"); if (strcmp(end, "end\n") != 0) die("Malformed end line"); - code = strength_check(ctx, data, password, principal); + code = strength_check(ctx, data, principal, password); if (code == 0) printf("APPROVED\n"); else { -- 2.39.2