Bug 808058 - Inspect usage of sysdb_search_user_by_name() ba various parts of code
Summary: Inspect usage of sysdb_search_user_by_name() ba various parts of code
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sssd
Version: 6.3
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Stephen Gallagher
Depends On:
TreeView+ depends on / blocked
Reported: 2012-03-29 13:07 UTC by Dmitri Pal
Modified: 2020-05-02 16:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2012-06-14 17:35:44 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 2317 0 None None None 2020-05-02 16:49:52 UTC

Description Dmitri Pal 2012-03-29 13:07:38 UTC
This bug is created as a clone of upstream ticket:

I stumbled upon this when inspecting usage of sysdb_search_user_by_name(). This routine only fetches user by his primary name. The problem is that some parts of the code don't need to fetch user just by his primary name, but also by any of his aliases.

Some parts of the code work ok with this. For example sdap_process_group_members_2307() calls first sysdb_search_user_by_name() and if it doesn't find anything, it calls sdap_process_missing_member_2307() which then searches for all users with that name as alias.

In particular I found three occurrences of sysdb_search_user_by_name() which I'm a bit concerned about and I think they need closer inspection:
* '''MPG domains''': sysdb_ops.c:1149 (group should not have the same name as any user's alias)
* '''sysdb_store_user''' - although it might a valid solution to check for aliases on all places where this routine is called, I'd prefer the check to be performed in it. Otherwise we might ending up with two users with the same name in the database (one as alias and one as the primary name). It is questionable what should be the right behaviour (update user with that alias, drop the alias or stop adding the user?).
* '''sysdb_delete_user''' - this is called on two places which I'm particularly concerned about: users_get_done() and groups_by_user_done()

Comment 1 Jenny Severance 2012-03-29 17:53:22 UTC
Please add steps to reproduce this issue

Note You need to log in before you can comment on or make changes to this bug.