diff options
-rw-r--r-- | debian/patches/0020-No-RAND_MAX-for-random.patch | 30 | ||||
-rw-r--r-- | debian/patches/series | 2 |
2 files changed, 31 insertions, 1 deletions
diff --git a/debian/patches/0020-No-RAND_MAX-for-random.patch b/debian/patches/0020-No-RAND_MAX-for-random.patch new file mode 100644 index 0000000..89890fe --- /dev/null +++ b/debian/patches/0020-No-RAND_MAX-for-random.patch @@ -0,0 +1,30 @@ +From: Shadow package maintainers <pkg-shadow-devel@lists.alioth.debian.org> +Date: Wed, 13 Jun 2012 00:20:33 +0000 +Subject: No RAND_MAX for random() + +--- + libmisc/salt.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libmisc/salt.c b/libmisc/salt.c +index e0f278e..1b650c2 100644 +--- a/libmisc/salt.c ++++ b/libmisc/salt.c +@@ -90,7 +90,7 @@ static size_t SHA_salt_size (void) + { + double rand_size; + seedRNG (); +- rand_size = (double) 9.0 * random () / RAND_MAX; ++ rand_size = (double) 9.0 * random () / LONG_MAX; + return (size_t) (8 + rand_size); + } + +@@ -132,7 +132,7 @@ static /*@observer@*/const char *SHA_salt_rounds (/*@null@*/int *prefered_rounds + + seedRNG (); + rand_rounds = (double) (max_rounds-min_rounds+1.0) * random (); +- rand_rounds /= RAND_MAX; ++ rand_rounds /= LONG_MAX; + rounds = min_rounds + rand_rounds; + } else if (0 == *prefered_rounds) { + return ""; diff --git a/debian/patches/series b/debian/patches/series index 4a57f2a..dfc3104 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -17,4 +17,4 @@ 0017-environ.patch 0018-putgrent.patch 0019-putpwent-segfault.patch -0020-random_rand_max.patch +0020-No-RAND_MAX-for-random.patch |