diff options
author | Michael Adam <obnox@samba.org> | 2013-09-15 11:58:02 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-10-02 00:50:10 +0200 |
commit | 9b7f9f90d2cdc8fd5919f7a94558f5346d35481e (patch) | |
tree | d0f60afa2d5b9d56806c178f8a1fc3568cfa8d56 /source3 | |
parent | 6d8cc470396a03b937f1c532946dfaf916ad454c (diff) | |
download | samba-9b7f9f90d2cdc8fd5919f7a94558f5346d35481e.tar.gz samba-9b7f9f90d2cdc8fd5919f7a94558f5346d35481e.tar.bz2 samba-9b7f9f90d2cdc8fd5919f7a94558f5346d35481e.zip |
idmap_autorid: add idmap_autorid_build_keystr_talloc()
talloc version of idmap_autorid_build_keystr()
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/winbindd/idmap_autorid_tdb.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/winbindd/idmap_autorid_tdb.c b/source3/winbindd/idmap_autorid_tdb.c index 597d9b6194..5fecb9fad3 100644 --- a/source3/winbindd/idmap_autorid_tdb.c +++ b/source3/winbindd/idmap_autorid_tdb.c @@ -42,6 +42,23 @@ static void idmap_autorid_build_keystr(const char *domsid, } } +static char *idmap_autorid_build_keystr_talloc(TALLOC_CTX *mem_ctx, + const char *domsid, + uint32_t domain_range_index) +{ + char *keystr; + + if (domain_range_index > 0) { + keystr = talloc_asprintf(mem_ctx, "%s#%"PRIu32, domsid, + domain_range_index); + } else { + keystr = talloc_strdup(mem_ctx, domsid); + } + + return keystr; +} + + static bool idmap_autorid_validate_sid(const char *sid) { struct dom_sid ignore; |