Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libutil Rename struct pw_policy -> struct pw_policy_hand...
details: https://anonhg.NetBSD.org/src/rev/e6ece3be36e4
branches: trunk
changeset: 584425:e6ece3be36e4
user: elad <elad%NetBSD.org@localhost>
date: Fri Sep 16 22:38:48 2005 +0000
description:
Rename struct pw_policy -> struct pw_policy_handler.
diffstat:
lib/libutil/pw_policy.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diffs (53 lines):
diff -r 5dd52d7639f0 -r e6ece3be36e4 lib/libutil/pw_policy.c
--- a/lib/libutil/pw_policy.c Fri Sep 16 18:29:55 2005 +0000
+++ b/lib/libutil/pw_policy.c Fri Sep 16 22:38:48 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pw_policy.c,v 1.1 2005/09/14 11:36:53 elad Exp $ */
+/* $NetBSD: pw_policy.c,v 1.2 2005/09/16 22:38:48 elad Exp $ */
/*-
* Copyright 2005 Elad Efrat <elad%NetBSD.org@localhost>
@@ -66,13 +66,13 @@
static int pw_policy_handle_nclasses(HANDLER_PROTO);
static int pw_policy_handle_ntoggles(HANDLER_PROTO);
-struct pw_policy {
+struct pw_policy_handler {
const char *name;
int (*handler)(char *, size_t, void *, void *);
void *arg2;
};
-static struct pw_policy policies[] = {
+static struct pw_policy_handler handlers[] = {
{ "length", pw_policy_handle_len, NULL },
{ "lowercase", pw_policy_handle_charclass, islower },
{ "uppercase", pw_policy_handle_charclass, isupper },
@@ -286,7 +286,7 @@
int
pw_policy_test(char *pw, void *key, int how)
{
- struct pw_policy *pwp;
+ struct pw_policy_handler *hp;
char buf[BUFSIZ];
size_t pwlen;
@@ -370,13 +370,13 @@
test_policies:
pwlen = strlen(pw);
- pwp = &policies[0];
- while (pwp->name != NULL) {
- PW_GETCONF(buf, sizeof(buf), key, pwp->name);
- if (*buf && pwp->handler(pw, pwlen, buf, pwp->arg2) != 0)
+ hp = &handlers[0];
+ while (hp->name != NULL) {
+ PW_GETCONF(buf, sizeof(buf), key, hp->name);
+ if (*buf && hp->handler(pw, pwlen, buf, hp->arg2) != 0)
return (EPERM);
- pwp++;
+ hp++;
}
return (0);
Home |
Main Index |
Thread Index |
Old Index