about summary refs log tree commit diff
path: root/nscd/nscd.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-01-14 05:26:04 +0000
committerUlrich Drepper <drepper@redhat.com>2007-01-14 05:26:04 +0000
commitb21fa963c4194082792a26023f265ebe50ca5c9e (patch)
tree78c2bb40d7a4fdb8b0b9c2c424fba511613e70e8 /nscd/nscd.c
parent23691ab23b6e631ae0c5cf58455cca25a0058e22 (diff)
downloadglibc-b21fa963c4194082792a26023f265ebe50ca5c9e.tar.gz
glibc-b21fa963c4194082792a26023f265ebe50ca5c9e.tar.xz
glibc-b21fa963c4194082792a26023f265ebe50ca5c9e.zip
* nis/nss_nis/nis-service.c (_nss_nis_getservbyname_r): Correct
	computation of keylen.
Diffstat (limited to 'nscd/nscd.c')
-rw-r--r--nscd/nscd.c14
1 files changed, 7 insertions, 7 deletions
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;