(find_func): Fix off-by-one and logic error.
(external_passwd_quality): Improve messages. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15106 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -189,12 +189,12 @@ external_passwd_quality (krb5_context context,
|
|||||||
|
|
||||||
if (fgets(reply, sizeof(reply), error) == NULL) {
|
if (fgets(reply, sizeof(reply), error) == NULL) {
|
||||||
snprintf(message, length, "external password quality "
|
snprintf(message, length, "external password quality "
|
||||||
"program fail without error");
|
"program failed without error");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
reply[strcspn(reply, "\n")] = '\0';
|
reply[strcspn(reply, "\n")] = '\0';
|
||||||
snprintf(message, length, "External password quality "
|
snprintf(message, length, "External password quality "
|
||||||
"program fail: %s", reply);
|
"program failed: %s", reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(out);
|
fclose(out);
|
||||||
@@ -420,7 +420,7 @@ find_func(krb5_context context, const char *name)
|
|||||||
p = strchr(name, ':');
|
p = strchr(name, ':');
|
||||||
if (p) {
|
if (p) {
|
||||||
func = p + 1;
|
func = p + 1;
|
||||||
module = strndup(name, p - name - 1);
|
module = strndup(name, p - name);
|
||||||
if (module == NULL)
|
if (module == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
} else
|
} else
|
||||||
@@ -440,7 +440,7 @@ find_func(krb5_context context, const char *name)
|
|||||||
/* Lets try try the builtin modules */
|
/* Lets try try the builtin modules */
|
||||||
if (module == NULL || strcmp(module, "builtin") == 0) {
|
if (module == NULL || strcmp(module, "builtin") == 0) {
|
||||||
for (f = builtin_verifier.funcs; f->name ; f++)
|
for (f = builtin_verifier.funcs; f->name ; f++)
|
||||||
if (strcmp(name, f->name) == 0) {
|
if (strcmp(func, f->name) == 0) {
|
||||||
if (module)
|
if (module)
|
||||||
free(module);
|
free(module);
|
||||||
return f;
|
return f;
|
||||||
|
Reference in New Issue
Block a user