summaryrefslogtreecommitdiffstats
path: root/server/tools/sss_groupadd.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2009-05-13 19:27:02 +0200
committerSimo Sorce <ssorce@redhat.com>2009-05-14 11:33:35 -0400
commite50fd095630c6bc8d575c575e74027d8c9c102ab (patch)
tree0412fd51d3ac90408d4ed838688e8f4eb9281a6a /server/tools/sss_groupadd.c
parentb39e818e616a773ea7c2098b9077be97d2e06f91 (diff)
downloadsssd2-e50fd095630c6bc8d575c575e74027d8c9c102ab.tar.gz
sssd2-e50fd095630c6bc8d575c575e74027d8c9c102ab.tar.xz
sssd2-e50fd095630c6bc8d575c575e74027d8c9c102ab.zip
More useful error message when adding user/group that already exists
Fixes: RHBZ #498462
Diffstat (limited to 'server/tools/sss_groupadd.c')
-rw-r--r--server/tools/sss_groupadd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/tools/sss_groupadd.c b/server/tools/sss_groupadd.c
index 431e34b6..5e1aeb9b 100644
--- a/server/tools/sss_groupadd.c
+++ b/server/tools/sss_groupadd.c
@@ -208,7 +208,15 @@ int main(int argc, const char **argv)
if (group_ctx->error) {
ret = group_ctx->error;
- DEBUG(0, ("Operation failed (%d)[%s]\n", ret, strerror(ret)));
+ switch (ret) {
+ case EEXIST:
+ DEBUG(0, ("The group %s already exists\n", group_ctx->groupname));
+ break;
+
+ default:
+ DEBUG(0, ("Operation failed (%d)[%s]\n", ret, strerror(ret)));
+ break;
+ }
ret = EXIT_FAILURE;
goto fini;
}