From c6f1107dac6935dae497c08f3afbdaf503d693f5 Mon Sep 17 00:00:00 2001 From: rcritten <> Date: Wed, 10 Jan 2007 20:56:00 +0000 Subject: 222173 Stop processing tokens when a login fails so we can correctly report the failure. Fix an off-by-one error in nss_pcache that prevented 1 character passwords (not a huge problem but a bug none-the-less). --- nss_pcache.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'nss_pcache.c') diff --git a/nss_pcache.c b/nss_pcache.c index 65a7a02..8e0f70f 100644 --- a/nss_pcache.c +++ b/nss_pcache.c @@ -445,12 +445,13 @@ char * getstr(const char * cmd, int el) { work = strdup(cmd); s = t = work; + r = NULL; peek = s; if (peek) peek++; while (*s) { - if (*s == '\t' || *peek == '\0') { + if (*s == '\t' || *s == '\0') { if (i == el) { if (*peek != '\0') *s = '\0'; @@ -468,8 +469,9 @@ char * getstr(const char * cmd, int el) { peek++; } + if (t) r = strdup(t); free(work); - return NULL; + return r; } /* -- cgit