This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch master
in repository 389-ds-base.
commit 774ee3e42da9394fb8f3695e1545ed9129786931
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Fri Feb 16 13:18:08 2018 -0500
Ticket 49568 - Fix integer overflow on 32bit platforms
Bug Description: When generating the nsState information for the
uniqueid generator the timestamp was overflowing
on arm(and possibly other 32 bit platforms). This
then broke the upgrade setup code when 50fixNsState.pl
was ran. 50fixNsState script also incorrectly converts
64bit nsState value to 32 bit
Fix Description: Cast the current time (time_t) to the proper type when
when calculating the time since epoch. Also do not
convert nsState during upgrade if it is already 64bit
value.
https://pagure.io/389-ds-base/issue/49568
Reviewed by: firstyear(Thanks!)
---
ldap/admin/src/scripts/50fixNsState.pl | 3 ++-
ldap/servers/slapd/uuid.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ldap/admin/src/scripts/50fixNsState.pl
b/ldap/admin/src/scripts/50fixNsState.pl
index bd20708..f825bba 100644
--- a/ldap/admin/src/scripts/50fixNsState.pl
+++ b/ldap/admin/src/scripts/50fixNsState.pl
@@ -41,9 +41,11 @@ sub convert_uniqueid {
my $bigfmt64 = "NNA6nC";
my $fmt = $fmt32;
my $bigfmt = $bigfmt32;
+ my $packfmt = $packfmt32;
if (length($val) > 20) {
$fmt = $fmt64;
$bigfmt = $bigfmt64;
+ $packfmt = $packfmt64;
} elsif ($is64) {
# cannot convert 32-bit to 64-bit - just delete the entry and continue
debug(1, "Cannot convert 32-bit nsState value $hex to 64-bit - deleting
entry " .
@@ -59,7 +61,6 @@ sub convert_uniqueid {
$packfmt64 = "NNA6nCx7";
}
- my $packfmt = $packfmt32;
if ($is64) {
$packfmt = $packfmt64;
}
diff --git a/ldap/servers/slapd/uuid.c b/ldap/servers/slapd/uuid.c
index df86f06..a8bd6ee 100644
--- a/ldap/servers/slapd/uuid.c
+++ b/ldap/servers/slapd/uuid.c
@@ -872,7 +872,7 @@ get_system_time(uuid_time_t *uuid_time)
/* Offset between UUID formatted times and time() formatted times.
UUID UTC base time is October 15, 1582. time() base time is January 1, 1970.*/
- *uuid_time = cur_time * SEQ_PER_SEC + I64(0x01B21DD213814000);
+ *uuid_time = (uuid_time_t)cur_time * SEQ_PER_SEC + I64(0x01B21DD213814000);
}
/* ONREPL */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.