From f68c43e80338921be8145f8b3a3b391a941715a2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 8 Jan 2010 12:45:29 +1100 Subject: s4-samba3sid: the sambaNextRid attribute is actually the previous RID Not well named .... though same mistake that MS made with rIDNextRid --- source4/dsdb/samdb/ldb_modules/samba3sid.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/dsdb/samdb/ldb_modules/samba3sid.c b/source4/dsdb/samdb/ldb_modules/samba3sid.c index 6ea5742e6d..bb4b58be3f 100644 --- a/source4/dsdb/samdb/ldb_modules/samba3sid.c +++ b/source4/dsdb/samdb/ldb_modules/samba3sid.c @@ -48,7 +48,7 @@ static int samba3sid_next_sid(struct ldb_module *module, struct ldb_context *ldb = ldb_module_get_ctx(module); int sambaNextRid, sambaNextGroupRid, sambaNextUserRid; struct ldb_message *msg; - uint32_t rid; + int rid; const char *sambaSID; ret = dsdb_module_search(module, tmp_ctx, &res, NULL, LDB_SCOPE_SUBTREE, @@ -105,7 +105,10 @@ static int samba3sid_next_sid(struct ldb_module *module, return ret; } - (*sid) = talloc_asprintf(tmp_ctx, "%s-%u", sambaSID, rid); + /* sambaNextRid is actually the previous RID .... */ + rid += 1; + + (*sid) = talloc_asprintf(tmp_ctx, "%s-%d", sambaSID, rid); if (!*sid) { ldb_module_oom(module); talloc_free(tmp_ctx); @@ -114,7 +117,7 @@ static int samba3sid_next_sid(struct ldb_module *module, ret = dsdb_module_constrainted_update_integer(module, msg->dn, "sambaNextRid", - sambaNextRid, rid+1); + sambaNextRid, rid); if (ret != LDB_SUCCESS) { ldb_asprintf_errstring(ldb, __location__ -- cgit