summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2011-11-02 11:38:19 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-11-02 14:10:31 -0400
commit583f7e8c7178f2019df0f00d9dafe973e88ed707 (patch)
tree65dcb8c4a02a0838b8c9f868cce7905243e52df6
parented80a7f8ff76089bdcfae7007dbdef42d05e2cc8 (diff)
downloadsssd-583f7e8c7178f2019df0f00d9dafe973e88ed707.tar.gz
sssd-583f7e8c7178f2019df0f00d9dafe973e88ed707.tar.bz2
sssd-583f7e8c7178f2019df0f00d9dafe973e88ed707.zip
Handle group renaming correctly
https://fedorahosted.org/sssd/ticket/1040
-rw-r--r--src/db/sysdb_ops.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 9aaea586..3734bb18 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -1139,8 +1139,13 @@ int sysdb_add_group(struct sysdb_ctx *sysdb,
ret = sysdb_search_group_by_gid(tmp_ctx, sysdb,
gid, NULL, &msg);
if (ret != ENOENT) {
- if (ret == EOK) ret = EEXIST;
- goto done;
+ if (ret == EOK) {
+ ret = sysdb_delete_group(sysdb, NULL, gid);
+ }
+
+ if (ret != EOK) {
+ goto done;
+ }
}
}