From 34f12d541b0bb2e7d931968b2079dfb7ba84d692 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Thu, 14 Oct 2010 17:56:23 +0400 Subject: s4 dsdb: fix sign problem on PPC and x86 In LDAP we used signed intege and groups have the highest bit set (ie. 0x80000002). So it will result with values that are > 2^31 when these value are used on some plateforms (x86 and PPC 64bits in this case) it causes problem with strtol. --- source4/dsdb/samdb/ldb_modules/samldb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/dsdb/samdb/ldb_modules') diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 400ae81114..ff110b7402 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -793,7 +793,7 @@ static int samldb_objectclass_trigger(struct samldb_ctx *ac) /* Step 1.2: Default values */ ret = samdb_find_or_add_attribute(ldb, ac->msg, "userAccountControl", - talloc_asprintf(ac->msg, "%u", UF_NORMAL_ACCOUNT)); + talloc_asprintf(ac->msg, "%d", UF_NORMAL_ACCOUNT)); if (ret != LDB_SUCCESS) return ret; ret = samdb_find_or_add_attribute(ldb, ac->msg, "badPwdCount", "0"); @@ -896,7 +896,7 @@ static int samldb_objectclass_trigger(struct samldb_ctx *ac) /* Step 2.2: Default values */ ret = samdb_find_or_add_attribute(ldb, ac->msg, "groupType", - talloc_asprintf(ac->msg, "%u", GTYPE_SECURITY_GLOBAL_GROUP)); + talloc_asprintf(ac->msg, "%d", GTYPE_SECURITY_GLOBAL_GROUP)); if (ret != LDB_SUCCESS) return ret; /* Step 2.3: "groupType" -> "sAMAccountType" */ -- cgit