s4:dsdb - fix unsigned integer save problems using the "%u" specifier
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Thu, 14 Oct 2010 15:01:39 +0000 (17:01 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 16 Oct 2010 08:54:46 +0000 (10:54 +0200)
commitc2918581996b58c3e2a2416e6dd693978becd3a2
treed460eb0c2c6cd2a9aabdf846fac2c7e0cccc6e58
parenta72ffb0d0157dce2ac45e3b228f168a56c89f26e
s4:dsdb - fix unsigned integer save problems using the "%u" specifier

The issue here is that we have not yet first cast to int32_t explicitly,
before we cast to an signed int to printf() into the %d or cast to a
int64_t before we then cast to a long long to printf into a %lld.

There are *no* unsigned integers in Active Directory LDAP, even the RID
allocations and ms-DS-Secondary-KrbTgt-Number are *signed* quantities.
(See the schema, and the syntax definitions in schema_syntax.c).

The failure has been detected by Matthieu Patou on the buildfarm host "tridge"
due to a malformed "groupType" attribute.

The solution is to use the "%d" specifier. Either to use it directly - or better
(when possible) use the call "samdb_msg_add_uint" (which encapsulates it).

This patch changes such problematic situations.
source4/dsdb/samdb/ldb_modules/acl.c
source4/dsdb/samdb/ldb_modules/instancetype.c
source4/dsdb/samdb/ldb_modules/operational.c
source4/dsdb/samdb/ldb_modules/rootdse.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/libnet/libnet_become_dc.c
source4/libnet/libnet_unbecome_dc.c
source4/rpc_server/lsa/dcesrv_lsa.c