diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2009-09-10 22:34:56 +0200 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-09-23 07:33:45 -0400 |
commit | 716a203f171fda4bcb3e2bf9f2564b331ac1f85a (patch) | |
tree | 75514074d7d9e850ff5cd74f625b0e2930c6b367 /server/tools/sss_groupmod.c | |
parent | 87b8670b2749d02ffdc6c06506ac692b09db5be2 (diff) | |
download | sssd-716a203f171fda4bcb3e2bf9f2564b331ac1f85a.tar.gz sssd-716a203f171fda4bcb3e2bf9f2564b331ac1f85a.tar.xz sssd-716a203f171fda4bcb3e2bf9f2564b331ac1f85a.zip |
Allow entering parent groups as FQDN
Allow entering parent groups for groupadd,useradd,usermod as FQDN. Since
members and parents must be from the same domain, error out if we can't
determine the domain of member.
Fixes: #121
Diffstat (limited to 'server/tools/sss_groupmod.c')
-rw-r--r-- | server/tools/sss_groupmod.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/server/tools/sss_groupmod.c b/server/tools/sss_groupmod.c index caf446615..1ecf076c1 100644 --- a/server/tools/sss_groupmod.c +++ b/server/tools/sss_groupmod.c @@ -149,7 +149,7 @@ int main(int argc, const char **argv) ret = parse_name_domain(tctx, pc_groupname); if (ret != EOK) { - ERROR("Cannot get domain information\n"); + ERROR("Invalid domain specified in FQDN\n"); ret = EXIT_FAILURE; goto fini; } @@ -163,6 +163,13 @@ int main(int argc, const char **argv) ERROR("Internal error while parsing parameters\n"); goto fini; } + + ret = parse_group_name_domain(tctx, tctx->octx->addgroups); + if (ret != EOK) { + DEBUG(1, ("Cannot parse FQDN groups to add the group to\n")); + ERROR("Member groups must be in the same domain as parent group\n"); + goto fini; + } } if (rmgroups) { @@ -172,6 +179,13 @@ int main(int argc, const char **argv) ERROR("Internal error while parsing parameters\n"); goto fini; } + + ret = parse_group_name_domain(tctx, tctx->octx->rmgroups); + if (ret != EOK) { + DEBUG(1, ("Cannot parse FQDN groups to remove the group from\n")); + ERROR("Member groups must be in the same domain as parent group\n"); + goto fini; + } } if (id_in_range(tctx->octx->gid, tctx->octx->domain) != EOK) { |