=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/passwd/Attic/pwd_gensalt.c,v retrieving revision 1.18 retrieving revision 1.19 diff -c -r1.18 -r1.19 *** src/usr.bin/passwd/Attic/pwd_gensalt.c 2004/07/13 21:09:48 1.18 --- src/usr.bin/passwd/Attic/pwd_gensalt.c 2004/07/13 21:29:12 1.19 *************** *** 1,4 **** ! /* $OpenBSD: pwd_gensalt.c,v 1.18 2004/07/13 21:09:48 millert Exp $ */ /* * Copyright 1997 Niels Provos --- 1,4 ---- ! /* $OpenBSD: pwd_gensalt.c,v 1.19 2004/07/13 21:29:12 millert Exp $ */ /* * Copyright 1997 Niels Provos *************** *** 48,56 **** int pwd_gensalt(char *salt, int saltlen, login_cap_t *lc, char type) { ! char option[LINE_MAX], *next, *now, *cipher; - option[0] = '\0'; *salt = '\0'; switch (type) { --- 48,55 ---- int pwd_gensalt(char *salt, int saltlen, login_cap_t *lc, char type) { ! char *next, *now, *cipher; *salt = '\0'; switch (type) { *************** *** 63,84 **** break; } ! /* ! * Check login.conf ! */ ! if ((next = login_getcapstr(lc, cipher, NULL, NULL)) != NULL) { ! strlcpy(option, next, sizeof(option)); ! free(next); ! } ! ! if (*option == 0) { ! if (type == 'l') ! strlcpy(option, "old", sizeof(option)); else ! strlcpy(option, "blowfish,6", sizeof(option)); } - next = option; now = strsep(&next, ","); if (!strcmp(now, "old")) { if (saltlen < 3) --- 62,74 ---- break; } ! if ((next = login_getcapstr(lc, cipher, NULL, NULL)) == NULL) { ! if (type == 'y') ! next = "old"; else ! next = "blowfish,6"; } now = strsep(&next, ","); if (!strcmp(now, "old")) { if (saltlen < 3)