diff options
-rw-r--r-- | checkpasswd/checkpassword.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/checkpasswd/checkpassword.c b/checkpasswd/checkpassword.c index 0ca5eee..106889b 100644 --- a/checkpasswd/checkpassword.c +++ b/checkpasswd/checkpassword.c @@ -35,6 +35,7 @@ main(int argc,char **argv) char *stored; int r; int i; + char ch; int unit = 3; char* unit_str = getenv("CHECKPASSWORD_UNIT"); @@ -62,6 +63,18 @@ main(int argc,char **argv) if (i >= uplen) _exit(2); while (up[i++]) if (i >= uplen) _exit(2); +#ifndef KEEP_SUFFIXES +// remove from the login any suffix starting with '@' or '%' + for (i=0; ; i++){ + ch = login[i]; + if (ch == 0) break; + if (ch == '@' || ch == '%') { + login[i] = 0; + break; + } + } +#endif + #ifdef NASTY_DEBUG fprintf(stderr, "checkpassw called with '%s' '%s'\n", login, password); |