>From 53b48a8273cd6fd3c569a4fef16c1c0050d5f308 Mon Sep 17 00:00:00 2001 From: magnum Date: Thu, 1 Sep 2011 01:29:51 +0200 Subject: [PATCH 09/13] ->N reject flag (reject unless length N is supported) --- doc/RULES | 1 + src/rules.c | 9 +++++++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/doc/RULES b/doc/RULES index b387e01..57218c6 100644 --- a/doc/RULES +++ b/doc/RULES @@ -30,6 +30,7 @@ john rule to start with a period, so at this time, this is not a problem. -p reject this rule unless word pair commands are currently allowed -u reject this rule unless the --encoding=utf8 flag is used -U reject this rule if the --encoding=utf8 flag is used +->N reject this rule unless length N or longer is supported Numeric constants and variables. diff --git a/src/rules.c b/src/rules.c index 06b91b9..e0f4182 100644 --- a/src/rules.c +++ b/src/rules.c @@ -623,6 +623,15 @@ char *rules_reject(char *rule, int split, char *last, struct db_main *db) if (split >= 0) continue; return NULL; + case '>': + if (!db && RULE) continue; + if (!NEXT) { + rules_errno = RULES_ERROR_END; + return NULL; + } + if (rules_vars[ARCH_INDEX(RULE)] <= db->format->params.plaintext_length ) continue; + return NULL; + case '\0': rules_errno = RULES_ERROR_END; return NULL; -- 1.7.4.1