* libmisc/obscure.c, libmisc/salt.c, src/passwd.c: Match DES, MD5,

SHA256, and SHA512 exactly (not only the first 3/6 chars).
* libmisc/salt.c (SHA_salt_rounds): Set rounds to the specified
  prefered_rounds value, if specified.
* src/gpasswd.c, libmisc/salt.c: Fix compilation warnings (use
  size_t for lengths).
* src/chpasswd.c, src/chgpasswd.c: Add missing parenthesis.
This commit is contained in:
nekral-guest
2007-11-20 20:00:16 +00:00
parent 1d4b67c773
commit 9aa40bb96d
8 changed files with 49 additions and 14 deletions

View File

@@ -185,7 +185,7 @@ int main (int argc, char **argv)
usage ();
}
if ((eflg && (md5flg || cflg)) ||
md5flg && cflg) {
(md5flg && cflg)) {
fprintf (stderr,
_("%s: the -c, -e, and -m flags are exclusive\n"),
Prog);

View File

@@ -179,7 +179,7 @@ int main (int argc, char **argv)
usage ();
}
if ((eflg && (md5flg || cflg)) ||
md5flg && cflg) {
(md5flg && cflg)) {
fprintf (stderr,
_("%s: the -c, -e, and -m flags are exclusive\n"),
Prog);

View File

@@ -121,7 +121,7 @@ static int check_list (const char *users)
const char *start, *end;
char username[32];
int errors = 0;
int len;
size_t len;
for (start = users; start && *start; start = end) {
if ((end = strchr (start, ','))) {

View File

@@ -251,9 +251,9 @@ static int new_password (const struct passwd *pw)
pass_max_len = getdef_num ("PASS_MAX_LEN", 8);
#ifdef ENCRYPTMETHOD_SELECT
} else {
if (!strncmp (method, "MD5" , 3) ||
!strncmp (method, "SHA256", 6) ||
!strncmp (method, "SHA512", 6))
if (!strcmp (method, "MD5") ||
!strcmp (method, "SHA256") ||
!strcmp (method, "SHA512"))
pass_max_len = -1;
else
pass_max_len = getdef_num ("PASS_MAX_LEN", 8);