summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/samba3sid.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-01-08 12:45:29 +1100
committerAndrew Tridgell <tridge@samba.org>2010-01-08 13:03:07 +1100
commitf68c43e80338921be8145f8b3a3b391a941715a2 (patch)
treef2a0c4a7eff84d31ca08ef7cb01ffdeb1b6653c9 /source4/dsdb/samdb/ldb_modules/samba3sid.c
parentd6f92db456162571e7d9273afe371103da72e6b0 (diff)
downloadsamba-f68c43e80338921be8145f8b3a3b391a941715a2.tar.gz
samba-f68c43e80338921be8145f8b3a3b391a941715a2.tar.bz2
samba-f68c43e80338921be8145f8b3a3b391a941715a2.zip
s4-samba3sid: the sambaNextRid attribute is actually the previous RID
Not well named .... though same mistake that MS made with rIDNextRid
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/samba3sid.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/samba3sid.c9
1 files changed, 6 insertions, 3 deletions
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__