Skip to content

[autobackport: sssd-2-9-4] KRB5: fix mem leak in authenticate_stored_users()#8538

Closed
sssd-bot wants to merge 2 commits intoSSSD:sssd-2-9-4from
sssd-bot:SSSD-sssd-backport-pr8517-to-sssd-2-9-4
Closed

[autobackport: sssd-2-9-4] KRB5: fix mem leak in authenticate_stored_users()#8538
sssd-bot wants to merge 2 commits intoSSSD:sssd-2-9-4from
sssd-bot:SSSD-sssd-backport-pr8517-to-sssd-2-9-4

Conversation

@sssd-bot
Copy link
Contributor

This is an automatic backport of PR#8517 KRB5: fix mem leak in authenticate_stored_users() to branch sssd-2-9-4, created by @alexey-tikhonov.

Caution

@alexey-tikhonov The patches did not apply cleanly. It is necessary to resolve conflicts before merging this pull request. Commits that introduced conflict are marked with CONFLICT!.

You can push changes to this pull request

git remote add sssd-bot git@github.com:sssd-bot/sssd.git
git fetch sssd-bot refs/heads/SSSD-sssd-backport-pr8517-to-sssd-2-9-4
git checkout SSSD-sssd-backport-pr8517-to-sssd-2-9-4
git push sssd-bot SSSD-sssd-backport-pr8517-to-sssd-2-9-4 --force

Original commits
74e7bc6 - KRB5: fix mem leak in authenticate_stored_users()
5b85b64 - UTIL: fix mem leak if get_active_uid() fails

Backported commits

  • 06dd4a4 - KRB5: fix mem leak in authenticate_stored_users()
  • c8a98c6 - CONFLICT! UTIL: fix mem leak if get_active_uid() fails

Conflicting Files Information (check for deleted and re-added files)

  • CONFLICT! UTIL: fix mem leak if get_active_uid() fails
On branch SSSD-sssd-backport-pr8517-to-sssd-2-9-4
You are currently cherry-picking commit 5b85b647e.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   src/util/find_uid.c

no changes added to commit (use "git add" and/or "git commit -a")

Original Pull Request Body

Reviewed-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
(cherry picked from commit 74e7bc6)
Reviewed-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Sumit Bose <sbose@redhat.com>
(cherry picked from commit 5b85b64)
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is an automatic backport to fix two memory leaks. The changes in src/providers/krb5/krb5_delayed_online_authentication.c correctly fix a leak by ensuring a hash table is always destroyed. However, the changes for src/util/find_uid.c have introduced a merge conflict. This is a critical issue that prevents compilation and must be resolved before merging. My review provides a specific suggestion to fix the conflict.

Comment on lines +342 to +355
<<<<<<< HEAD
return get_active_uid_linux(*table, 0);
#else
return ENOSYS;
#endif
=======
ret = get_active_uid(*table, 0);
if (ret != EOK) {
hash_destroy(*table);
*table = NULL;
}

return ret;
>>>>>>> 5b85b647e (UTIL: fix mem leak if `get_active_uid()` fails)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This file contains merge conflict markers which must be resolved before this pull request can be merged. The code in its current state will not compile.

The conflict appears to be between a call to get_active_uid_linux in the target branch and a backported change that adds error handling for a call to get_active_uid. You should resolve this by applying the error handling logic to the get_active_uid_linux call.

    ret = get_active_uid_linux(*table, 0);
    if (ret != EOK) {
        hash_destroy(*table);
        *table = NULL;
    }

    return ret;
#else
    return ENOSYS;
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants