Make sure method is not NULL, defaulting to DES. Thanks to Dan Kopecek <dkopecek@redhat.com>.
This commit is contained in:
parent
963bfaf521
commit
a99bec34a9
@ -1,3 +1,9 @@
|
|||||||
|
2007-11-24 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* libmisc/salt.c: Make sure method is not NULL, defaulting to DES.
|
||||||
|
Thanks to Dan Kopecek <dkopecek@redhat.com>.
|
||||||
|
|
||||||
|
|
||||||
2007-11-23 Nicolas François <nicolas.francois@centraliens.net>
|
2007-11-23 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* libmisc/salt.c: Move the srandom call to gensalt.
|
* libmisc/salt.c: Move the srandom call to gensalt.
|
||||||
|
@ -180,18 +180,18 @@ char *crypt_make_salt (char *meth, void *arg)
|
|||||||
*/
|
*/
|
||||||
static char result[40];
|
static char result[40];
|
||||||
size_t salt_len = 8;
|
size_t salt_len = 8;
|
||||||
char *method = "DES";
|
char *method;
|
||||||
|
|
||||||
result[0] = '\0';
|
result[0] = '\0';
|
||||||
|
|
||||||
if (NULL != meth)
|
if (NULL != meth)
|
||||||
method = meth;
|
method = meth;
|
||||||
else
|
else {
|
||||||
#ifdef ENCRYPTMETHOD_SELECT
|
#ifdef ENCRYPTMETHOD_SELECT
|
||||||
if ((method = getdef_str ("ENCRYPT_METHOD")) == NULL)
|
if ((method = getdef_str ("ENCRYPT_METHOD")) == NULL)
|
||||||
#endif
|
#endif
|
||||||
if (getdef_bool ("MD5_CRYPT_ENAB"))
|
method = getdef_bool ("MD5_CRYPT_ENAB") ? "MD5" : "DES";
|
||||||
method = "MD5";
|
}
|
||||||
|
|
||||||
if (!strcmp (method, "MD5")) {
|
if (!strcmp (method, "MD5")) {
|
||||||
MAGNUM(result, '1');
|
MAGNUM(result, '1');
|
||||||
|
Loading…
Reference in New Issue
Block a user