summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2015-02-10 17:30:00 +0100
committerJakub Hrozek <jhrozek@redhat.com>2016-01-13 11:28:45 +0100
commit23674dfef4225b90d45c27b88fe72dc37b22e32d (patch)
treef3f2814e564511fef79db03b909cc86d10208999 /src/tools
parent867c5d7d51327464a21f48fd6dc2a6f4f107bd36 (diff)
downloadsssd-23674dfef4225b90d45c27b88fe72dc37b22e32d.tar.gz
sssd-23674dfef4225b90d45c27b88fe72dc37b22e32d.tar.xz
sssd-23674dfef4225b90d45c27b88fe72dc37b22e32d.zip
sysdb: Unify name format for groups and users
This is WIP patch to unify format of usernames and groupnames in sssd internals. In current form it breaks just about everything. The sysdb update function is just placeholder and it's contents are irelevant. Currently I am working on fqname attribute removal because it seems to just add confusion. If you decide to look into the code, please use sunglasses or other other protective gear and play some calm music in your backgroun to prevent eye or brain injury.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/sss_groupshow.c9
-rw-r--r--src/tools/sss_seed.c14
2 files changed, 19 insertions, 4 deletions
diff --git a/src/tools/sss_groupshow.c b/src/tools/sss_groupshow.c
index 41d7475ce..3743a568f 100644
--- a/src/tools/sss_groupshow.c
+++ b/src/tools/sss_groupshow.c
@@ -318,7 +318,7 @@ int group_show(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
struct sss_domain_info *domain,
bool recursive,
- const char *name,
+ const char *internal_fqname,
struct group_info **res)
{
struct group_info *root;
@@ -330,7 +330,8 @@ int group_show(TALLOC_CTX *mem_ctx,
int i;
/* First, search for the root group */
- ret = sysdb_search_group_by_name(mem_ctx, domain, name, attrs, &msg);
+ ret = sysdb_search_group_by_name(mem_ctx, domain, internal_fqname,
+ attrs, &msg);
if (ret) {
DEBUG(SSSDBG_OP_FAILURE,
"Search failed: %s (%d)\n", strerror(ret), ret);
@@ -408,7 +409,7 @@ done:
static int group_show_trim_memberof(TALLOC_CTX *mem_ctx,
struct sss_domain_info *domain,
- const char *name,
+ const char *name, /* internal fqname */
const char **memberofs,
const char ***_direct)
{
@@ -478,7 +479,7 @@ int group_show_recurse(TALLOC_CTX *mem_ctx,
struct sss_domain_info *domain,
struct group_info *root,
struct group_info *parent,
- const char **group_members,
+ const char **group_members, /* internal fq format */
const int nmembers,
struct group_info ***up_members)
{
diff --git a/src/tools/sss_seed.c b/src/tools/sss_seed.c
index 2cd6a57aa..e45bbcc6e 100644
--- a/src/tools/sss_seed.c
+++ b/src/tools/sss_seed.c
@@ -729,6 +729,19 @@ static int seed_cache_user(struct seed_ctx *sctx)
bool in_transaction = false;
int ret = EOK;
errno_t sret;
+ char *name;
+ TALLOC_CTX *tmp_ctx;
+
+ tmp_ctx = talloc_new(NULL);
+ if (tmp_ctx == NULL) {
+ return ENOMEM;
+ }
+
+ name = sss_ioname2internal(tmp_ctx, sctx->domain, sctx->uctx->name);
+ if (name == NULL) {
+ ret = ENOMEM;
+ goto done;
+ }
ret = sysdb_transaction_start(sctx->sysdb);
if (ret != EOK) {
@@ -777,6 +790,7 @@ done:
}
}
+ talloc_free(tmp_ctx);
return ret;
}