summaryrefslogtreecommitdiffstats
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
parentb39e818e616a773ea7c2098b9077be97d2e06f91 (diff)
downloadsssd-e50fd095630c6bc8d575c575e74027d8c9c102ab.tar.gz
sssd-e50fd095630c6bc8d575c575e74027d8c9c102ab.tar.xz
sssd-e50fd095630c6bc8d575c575e74027d8c9c102ab.zip
More useful error message when adding user/group that already exists
Fixes: RHBZ #498462
-rw-r--r--server/tools/sss_groupadd.c10
-rw-r--r--server/tools/sss_useradd.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/server/tools/sss_groupadd.c b/server/tools/sss_groupadd.c
index 431e34b67..5e1aeb9b2 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;
}
diff --git a/server/tools/sss_useradd.c b/server/tools/sss_useradd.c
index 78ded2eee..f573877f8 100644
--- a/server/tools/sss_useradd.c
+++ b/server/tools/sss_useradd.c
@@ -456,7 +456,15 @@ int main(int argc, const char **argv)
if (user_ctx->error) {
ret = user_ctx->error;
- DEBUG(0, ("Operation failed (%d)[%s]\n", ret, strerror(ret)));
+ switch (ret) {
+ case EEXIST:
+ DEBUG(0, ("The user %s already exists\n", user_ctx->username));
+ break;
+
+ default:
+ DEBUG(0, ("Operation failed (%d)[%s]\n", ret, strerror(ret)));
+ break;
+ }
ret = EXIT_FAILURE;
goto fini;
}