check.c | check.c | |||
---|---|---|---|---|
skipping to change at line 332 | skipping to change at line 332 | |||
return 1; | return 1; | |||
} | } | |||
} else { | } else { | |||
c = new[i]; | c = new[i]; | |||
same = 1; | same = 1; | |||
} | } | |||
} | } | |||
return 0; | return 0; | |||
} | } | |||
static int sequence(pwquality_settings_t *pwq, const char *new, void **auxe | ||||
rror) | ||||
{ | ||||
char c; | ||||
int i; | ||||
int sequp = 1; | ||||
int seqdown = 1; | ||||
if (pwq->max_sequence == 0) | ||||
return 0; | ||||
if (new[0] == '\0') | ||||
return 0; | ||||
for (i = 1; new[i]; i++) { | ||||
c = new[i-1]; | ||||
if (new[i] == c+1) { | ||||
++sequp; | ||||
if (sequp > pwq->max_sequence) { | ||||
if (auxerror) | ||||
*auxerror = (void *)(long)pwq->max_ | ||||
sequence; | ||||
return 1; | ||||
} | ||||
seqdown = 1; | ||||
} else if (new[i] == c-1) { | ||||
++seqdown; | ||||
if (seqdown > pwq->max_sequence) { | ||||
if (auxerror) | ||||
*auxerror = (void *)(long)pwq->max_ | ||||
sequence; | ||||
return 1; | ||||
} | ||||
sequp = 1; | ||||
} else { | ||||
sequp = 1; | ||||
seqdown = 1; | ||||
} | ||||
} | ||||
return 0; | ||||
} | ||||
static int | static int | |||
usercheck(pwquality_settings_t *pwq, const char *new, | usercheck(pwquality_settings_t *pwq, const char *new, | |||
char *user) | char *user) | |||
{ | { | |||
char *f, *b; | char *f, *b; | |||
int dist; | int dist; | |||
if (strstr(new, user) != NULL) | if (strstr(new, user) != NULL) | |||
return 1; | return 1; | |||
skipping to change at line 514 | skipping to change at line 553 | |||
if (!rv && numclass(pwq, new) < pwq->min_class) { | if (!rv && numclass(pwq, new) < pwq->min_class) { | |||
rv = PWQ_ERROR_MIN_CLASSES; | rv = PWQ_ERROR_MIN_CLASSES; | |||
if (auxerror) { | if (auxerror) { | |||
*auxerror = (void *)(long)pwq->min_class; | *auxerror = (void *)(long)pwq->min_class; | |||
} | } | |||
} | } | |||
if (!rv && consecutive(pwq, new, auxerror)) | if (!rv && consecutive(pwq, new, auxerror)) | |||
rv = PWQ_ERROR_MAX_CONSECUTIVE; | rv = PWQ_ERROR_MAX_CONSECUTIVE; | |||
if (!rv && sequence(pwq, new, auxerror)) | ||||
rv = PWQ_ERROR_MAX_SEQUENCE; | ||||
if (!rv && usermono && usercheck(pwq, newmono, usermono)) | if (!rv && usermono && usercheck(pwq, newmono, usermono)) | |||
rv = PWQ_ERROR_USER_CHECK; | rv = PWQ_ERROR_USER_CHECK; | |||
if (!rv && user && pwq->gecos_check) | if (!rv && user && pwq->gecos_check) | |||
rv = gecoscheck(pwq, newmono, user); | rv = gecoscheck(pwq, newmono, user); | |||
if (!rv) | if (!rv) | |||
rv = wordlistcheck(pwq, newmono, pwq->bad_words); | rv = wordlistcheck(pwq, newmono, pwq->bad_words); | |||
if (newmono) { | if (newmono) { | |||
skipping to change at line 656 | skipping to change at line 698 | |||
* notice, and the entire permission notice in its entirety, | * notice, and the entire permission notice in its entirety, | |||
* including the disclaimer of warranties. | * including the disclaimer of warranties. | |||
* 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright | |||
* notice, this list of conditions and the following disclaimer in the | * notice, this list of conditions and the following disclaimer in the | |||
* documentation and/or other materials provided with the distribution. | * documentation and/or other materials provided with the distribution. | |||
* 3. The name of the author may not be used to endorse or promote | * 3. The name of the author may not be used to endorse or promote | |||
* products derived from this software without specific prior | * products derived from this software without specific prior | |||
* written permission. | * written permission. | |||
* | * | |||
* ALTERNATIVELY, this product may be distributed under the terms of | * ALTERNATIVELY, this product may be distributed under the terms of | |||
* the GNU Public License, in which case the provisions of the GPL are | * the GNU General Public License version 2 or later, in which case the | |||
* required INSTEAD OF the above restrictions. (This clause is | * provisions of the GPL are required INSTEAD OF the above restrictions. | |||
* necessary due to a potential bad interaction between the GPL and | ||||
* the restrictions contained in a BSD-style copyright.) | ||||
* | * | |||
* THIS SOFTWARE IS PROVIDED `AS IS'' AND ANY EXPRESS OR IMPLIED | * THIS SOFTWARE IS PROVIDED `AS IS'' AND ANY EXPRESS OR IMPLIED | |||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | |||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 47 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |