[Pkg-openldap-devel] Bug#905237: (ITS#8890) Bug fix patches unbreaking the build on x32 systems
Howard Chu
hyc at symas.com
Wed Dec 19 00:26:20 GMT 2018
Thorsten Glaser wrote:
> I know my way *very* well around the time_t issue because
> I’ve been having them on MirBSD/i386 years before x32 even
> existed, and am experienced in how to fix them.
>From here it only looks like you're experienced in how to break things.
This patch of yours *introduces a bug*. If you wanted to actually *fix*
something you should have made sure the malloc'd buffer - which only happens
2 lines above the lines you change - was large enough to store a long long.
That's just plain sloppy. It's as careless as submitting a patch to
fix a no-op, and just wasting my time.
+--- a/contrib/slapd-modules/smbk5pwd/smbk5pwd.c
++++ b/contrib/slapd-modules/smbk5pwd/smbk5pwd.c
+@@ -605,7 +605,7 @@ static int smbk5pwd_exop_passwd(
+ keys[0].bv_val = ch_malloc( LDAP_PVT_INTTYPE_CHARS(long) );
+ keys[0].bv_len = snprintf(keys[0].bv_val,
+ LDAP_PVT_INTTYPE_CHARS(long),
+- "%ld", slap_get_time());
++ "%lld", (long long)slap_get_time());
+ BER_BVZERO( &keys[1] );
+
+ ml->sml_desc = ad_sambaPwdLastSet;
+@@ -627,7 +627,7 @@ static int smbk5pwd_exop_passwd(
+ keys[0].bv_val = ch_malloc( LDAP_PVT_INTTYPE_CHARS(long) );
+ keys[0].bv_len = snprintf(keys[0].bv_val,
+ LDAP_PVT_INTTYPE_CHARS(long),
+- "%ld", slap_get_time() + pi->smb_must_change);
++ "%lld", (long long)slap_get_time() + (long long)pi->smb_must_change);
+ BER_BVZERO( &keys[1] );
+
+ ml->sml_desc = ad_sambaPwdMustChange;
+@@ -650,7 +650,7 @@ static int smbk5pwd_exop_passwd(
+ keys[0].bv_val = ch_malloc( LDAP_PVT_INTTYPE_CHARS(long) );
+ keys[0].bv_len = snprintf(keys[0].bv_val,
+ LDAP_PVT_INTTYPE_CHARS(long),
+- "%ld", slap_get_time() + pi->smb_can_change);
++ "%lld", (long long)slap_get_time() + (long long)pi->smb_can_change);
+ BER_BVZERO( &keys[1] );
+
+ ml->sml_desc = ad_sambaPwdCanChange;
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/
More information about the Pkg-openldap-devel
mailing list