diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-10-16 14:19:19 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-10-16 14:39:23 +0200 |
commit | bc0294814af8dd2756191c8df74bb8db0fe61319 (patch) | |
tree | f2db82553be33fd51df7455b7421c5cf5d076b27 /source4/dsdb | |
parent | 42d9978cdd20c4f5a8cfee8e9db8e8d7b405b677 (diff) | |
download | samba-bc0294814af8dd2756191c8df74bb8db0fe61319.tar.gz samba-bc0294814af8dd2756191c8df74bb8db0fe61319.tar.bz2 samba-bc0294814af8dd2756191c8df74bb8db0fe61319.zip |
s4:samldb LDB module - use appropriate fixed-length integer types where needed
- The "systemFlags" we interpret always as signed
- Use "samdb_msg_add_int" where possible (much saver for integer storing than
ldb_msg_add_fmt)
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/samldb.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 9d4f3b8672..3a971e80c5 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -259,7 +259,7 @@ static bool samldb_krbtgtnumber_available(struct samldb_ctx *ac, unsigned krbtgt static int samldb_rodc_add(struct samldb_ctx *ac) { struct ldb_context *ldb = ldb_module_get_ctx(ac->module); - unsigned krbtgt_number, i_start, i; + uint32_t krbtgt_number, i_start, i; int ret; char *newpass; @@ -359,7 +359,7 @@ static int samldb_add_handle_msDS_IntId(struct samldb_ctx *ac) int ret; bool id_exists; uint32_t msds_intid; - uint32_t system_flags; + int32_t system_flags; struct ldb_context *ldb; struct ldb_result *ldb_res; struct ldb_dn *schema_dn; @@ -389,7 +389,7 @@ static int samldb_add_handle_msDS_IntId(struct samldb_ctx *ac) } /* check systemFlags for SCHEMA_BASE_OBJECT flag */ - system_flags = ldb_msg_find_attr_as_uint(ac->msg, "systemFlags", 0); + system_flags = ldb_msg_find_attr_as_int(ac->msg, "systemFlags", 0); if (system_flags & SYSTEM_FLAG_SCHEMA_BASE_OBJECT) { return LDB_SUCCESS; } @@ -423,7 +423,8 @@ static int samldb_add_handle_msDS_IntId(struct samldb_ctx *ac) talloc_free(ldb_res); } while(id_exists); - return ldb_msg_add_fmt(ac->msg, "msDS-IntId", "%d", msds_intid); + return samdb_msg_add_int(ldb, ac->msg, ac->msg, "msDS-IntId", + msds_intid); } |