On Fri, Dec 07, 2012 at 08:59:40PM +0100, Ondrej Kos wrote:
https://fedorahosted.org/sssd/ticket/1685
when trying to delete credentials not present in cache, the return
value was misread, taking ENOENT as a failed part of code.
Fixing patch is attached
Ondra
Looks good, just one question:
+static int
+delete_user(struct sysdb_ctx *sysdb, const char *name, uid_t uid)
+{
+ int ret = EOK;
+
+ DEBUG(SSSDBG_TRACE_FUNC,
+ ("User %s does not exist (or is invalid) on remote server,"
+ " deleting!\n", name));
+ ret = sysdb_delete_user(sysdb, name, uid);
+ if (ret == ENOENT) {
+ ret = EOK;
+ errno = EOK;
Why set errno? We don't use it (I hope) to check the results of delete
user..
+ }
+
+ return ret;
+}
+
The rest looks good. I haven't tested the patch yet.