On 14/12/12 17:32, Jakub Hrozek wrote:
On Fri, Dec 14, 2012 at 11:36:27AM +0100, Ondrej Kos wrote:
> Propperly react on deleting group which was not found in sysdb.
^^
Typo, it should be spelled out "Properly".
> ---
> src/providers/proxy/proxy_id.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c
> index
060c4723bdb4c2ad6e671957b90b3e3af0551878..69b8d4b007b56d12e310355f3d16b7bc036dde5a 100644
> --- a/src/providers/proxy/proxy_id.c
> +++ b/src/providers/proxy/proxy_id.c
> @@ -866,7 +866,10 @@ static int get_gr_name(TALLOC_CTX *mem_ctx,
> ("Group %s does not exist (or is invalid) on remote
server,"
> " deleting!\n", name));
>
> - ret = sysdb_delete_group(sysdb, NULL, gid);
> + ret = sysdb_delete_group(sysdb, name, NULL);
nack, please keep using gid here. Because of aliases, there's no
guarantee that name is the real user name or an alias. We canonicalize
the name a couple of lines above, but I think it's just simpler to keep
using gid.
> + if (ret == ENOENT) {
> + ret = EOK;
> + }
> goto done;
> }
>
> @@ -936,6 +939,9 @@ static int get_gr_gid(TALLOC_CTX *mem_ctx,
> " deleting!\n", gid));
>
> ret = sysdb_delete_group(sysdb, NULL, gid);
> + if (ret == ENOENT) {
> + ret = EOK;
> + }
> goto done;
> }
>
> --
> 1.7.11.7
>
New patch attached
O.
--
Ondrej Kos
Associate Software Engineer
Identity Management
Red Hat Czech
phone: +420-532-294-558
cell: +420-736-417-909
ext: 82-62558
loc: 1013 Brno 1 office
irc: okos @ #brno