From b21fa963c4194082792a26023f265ebe50ca5c9e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 14 Jan 2007 05:26:04 +0000 Subject: * nis/nss_nis/nis-service.c (_nss_nis_getservbyname_r): Correct computation of keylen. --- nscd/nscd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'nscd/nscd.c') diff --git a/nscd/nscd.c b/nscd/nscd.c index b68ae2f413..d0c34eb010 100644 --- a/nscd/nscd.c +++ b/nscd/nscd.c @@ -332,15 +332,15 @@ parse_opt (int key, char *arg, struct argp_state *state) exit (EXIT_FAILURE); request_header req; - if (strcmp (arg, "passwd") == 0) - req.key_len = sizeof "passwd"; - else if (strcmp (arg, "group") == 0) - req.key_len = sizeof "group"; - else if (strcmp (arg, "hosts") == 0) - req.key_len = sizeof "hosts"; - else + dbtype cnt; + for (cnt = pwddb; cnt < lastdb; ++cnt) + if (strcmp (arg, dbnames[cnt]) == 0) + break; + + if (cnt == lastdb) return ARGP_ERR_UNKNOWN; + req.key_len = strlen (arg) + 1; req.version = NSCD_VERSION; req.type = INVALIDATE; -- cgit 1.4.1