diff options
author | Simo Sorce <simo@redhat.com> | 2013-01-07 17:20:49 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-15 10:53:01 +0100 |
commit | 722c364c39bc0ed81e9577fb522f684c0104e26c (patch) | |
tree | 1cd05074df1847151b4d597eae9072e3b18255f4 /src/db | |
parent | 3187afe4aafa562f2a6747846181ac06d0659dff (diff) | |
download | sssd-722c364c39bc0ed81e9577fb522f684c0104e26c.tar.gz sssd-722c364c39bc0ed81e9577fb522f684c0104e26c.tar.bz2 sssd-722c364c39bc0ed81e9577fb522f684c0104e26c.zip |
Add domain argument to sysdb_get_new_id()
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/sysdb.h | 1 | ||||
-rw-r--r-- | src/db/sysdb_ops.c | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h index 04f35e22..ab247f2f 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -596,6 +596,7 @@ int sysdb_set_netgroup_attr(struct sysdb_ctx *sysdb, /* Allocate a new id */ int sysdb_get_new_id(struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, uint32_t *id); /* Add user (only basic attrs and w/o checks) */ diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 13eb46e5..59ec82b2 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -649,6 +649,7 @@ done: /* =Get-New-ID============================================================ */ int sysdb_get_new_id(struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, uint32_t *_id) { TALLOC_CTX *tmp_ctx; @@ -664,14 +665,12 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb, int ret; int i; - struct sss_domain_info *domain = sysdb->domain; - tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { return ENOMEM; } - base_dn = sysdb_domain_dn(sysdb, tmp_ctx, sysdb->domain); + base_dn = sysdb_domain_dn(sysdb, tmp_ctx, domain); if (!base_dn) { talloc_zfree(tmp_ctx); return ENOMEM; @@ -1149,7 +1148,7 @@ int sysdb_add_user(struct sysdb_ctx *sysdb, if (ret) goto done; if (uid == 0) { - ret = sysdb_get_new_id(sysdb, &id); + ret = sysdb_get_new_id(sysdb, domain, &id); if (ret) goto done; id_attrs = sysdb_new_attrs(tmp_ctx); @@ -1344,7 +1343,7 @@ int sysdb_add_group(struct sysdb_ctx *sysdb, } if (posix && gid == 0) { - ret = sysdb_get_new_id(sysdb, &id); + ret = sysdb_get_new_id(sysdb, domain, &id); if (ret) goto done; ret = sysdb_attrs_add_uint32(attrs, SYSDB_GIDNUM, id); |