From 583f7e8c7178f2019df0f00d9dafe973e88ed707 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Wed, 2 Nov 2011 11:38:19 -0400 Subject: Handle group renaming correctly https://fedorahosted.org/sssd/ticket/1040 --- src/db/sysdb_ops.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/db') 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; + } } } -- cgit