diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2009-07-30 12:02:29 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-07-31 12:08:40 -0400 |
commit | 3f21b54146399bdf3e2a56b8466dc95c3b70283e (patch) | |
tree | 3e54d494876c2e5a8039bc734fe9f32fe4cbaa5b /server/tools | |
parent | a45aea02734e57dd91cdc35b6761364057ca76ae (diff) | |
download | sssd2-3f21b54146399bdf3e2a56b8466dc95c3b70283e.tar.gz sssd2-3f21b54146399bdf3e2a56b8466dc95c3b70283e.tar.xz sssd2-3f21b54146399bdf3e2a56b8466dc95c3b70283e.zip |
Correct check for local domain in tools
When looking for the local domain in the tools, do so by looking
on provider value, not domain name. Also removes one redundant lookup
of local domain.
Diffstat (limited to 'server/tools')
-rw-r--r-- | server/tools/sss_usermod.c | 12 | ||||
-rw-r--r-- | server/tools/tools_util.c | 4 |
2 files changed, 2 insertions, 14 deletions
diff --git a/server/tools/sss_usermod.c b/server/tools/sss_usermod.c index cc94be3a..ca6463fa 100644 --- a/server/tools/sss_usermod.c +++ b/server/tools/sss_usermod.c @@ -553,18 +553,6 @@ int main(int argc, const char **argv) "Could not add attribute to changeset\n"); } - - /* arguments processed, go on to actual work */ - for (dom = ctx->domains; dom; dom = dom->next) { - if (strcasecmp(dom->name, "LOCAL") == 0) break; - } - if (dom == NULL) { - ERROR("Could not get LOCAL domain info\n"); - ret = EXIT_FAILURE; - goto fini; - } - data->domain = dom; - req = sysdb_transaction_send(ctx, ctx->ev, ctx->sysdb); if (!req) { DEBUG(1, ("Could not start transaction (%d)[%s]\n", ret, strerror(ret))); diff --git a/server/tools/tools_util.c b/server/tools/tools_util.c index 0d3220ee..b580300b 100644 --- a/server/tools/tools_util.c +++ b/server/tools/tools_util.c @@ -81,7 +81,7 @@ enum id_domain find_domain_for_id(struct tools_ctx *ctx, if (id < dom->id_min || id > dom->id_max) { continue; } else { - if (strcasecmp(dom->name, "LOCAL") == 0) { + if (strcasecmp(dom->provider, "local") == 0) { *dom_ret = dom; return ID_IN_LOCAL; } else if (is_domain_local_legacy(ctx, dom) == 0) { @@ -100,7 +100,7 @@ enum id_domain find_domain_for_id(struct tools_ctx *ctx, } else { /* No ID specified, find LOCAL */ for (dom = ctx->domains; dom; dom = dom->next) { - if (strcasecmp(dom->name, "LOCAL") == 0) { + if (strcasecmp(dom->provider, "local") == 0) { *dom_ret = dom; return ID_IN_LOCAL; } |