fix salt size problem (#447136)

This commit is contained in:
Peter Vrabec 2008-05-20 11:44:16 +00:00
parent b83095da8b
commit f59529bd69
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,17 @@
diff -up shadow-4.1.1/libmisc/salt.c.saltSize shadow-4.1.1/libmisc/salt.c
--- shadow-4.1.1/libmisc/salt.c.saltSize 2008-05-20 13:36:06.000000000 +0200
+++ shadow-4.1.1/libmisc/salt.c 2008-05-20 13:39:30.000000000 +0200
@@ -90,9 +90,10 @@ static void seedRNG (void)
*/
static unsigned int SHA_salt_size (void)
{
- double rand_rounds = 9 * random ();
- rand_rounds /= RAND_MAX;
- return 8 + rand_rounds;
+ unsigned int rand_rounds;
+ seedRNG ();
+ rand_rounds = random () % 9;
+ return 8 + rand_rounds;
}
/* ! Arguments evaluated twice ! */

View File

@ -5,7 +5,7 @@
Summary: Utilities for managing accounts and shadow password files Summary: Utilities for managing accounts and shadow password files
Name: shadow-utils Name: shadow-utils
Version: 4.1.1 Version: 4.1.1
Release: 1%{?dist} Release: 2%{?dist}
Epoch: 2 Epoch: 2
URL: http://pkg-shadow.alioth.debian.org/ URL: http://pkg-shadow.alioth.debian.org/
Source0: ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-%{version}.tar.bz2 Source0: ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-%{version}.tar.bz2
@ -17,6 +17,7 @@ Patch1: shadow-4.1.1-audit.patch
Patch3: shadow-4.1.0-goodname.patch Patch3: shadow-4.1.0-goodname.patch
Patch4: shadow-4.1.1-selinux.patch Patch4: shadow-4.1.1-selinux.patch
Patch5: shadow-4.1.1-sysAccountDownhill.patch Patch5: shadow-4.1.1-sysAccountDownhill.patch
Patch6: shadow-4.1.1-saltSize.patch
License: BSD License: BSD
Group: System Environment/Base Group: System Environment/Base
@ -46,6 +47,7 @@ are used for managing group accounts.
%patch3 -p1 -b .goodname %patch3 -p1 -b .goodname
%patch4 -p1 -b .selinux %patch4 -p1 -b .selinux
%patch5 -p1 -b .sysAccountDownhill %patch5 -p1 -b .sysAccountDownhill
%patch6 -p1 -b .saltSize
rm po/*.gmo rm po/*.gmo
@ -186,6 +188,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man8/vigr.8* %{_mandir}/man8/vigr.8*
%changelog %changelog
* Tue May 20 2008 Peter Vrabec <pvrabec@redhat.com> 2:4.1.1-2
- fix salt size problem (#447136)
* Mon Apr 07 2008 Peter Vrabec <pvrabec@redhat.com> 2:4.1.1-1 * Mon Apr 07 2008 Peter Vrabec <pvrabec@redhat.com> 2:4.1.1-1
- upgrade - upgrade