Bug 808058 - Inspect usage of sysdb_search_user_by_name() ba various parts of code
Inspect usage of sysdb_search_user_by_name() ba various parts of code
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sssd (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Stephen Gallagher
IDM QE LIST
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-29 09:07 EDT by Dmitri Pal
Modified: 2012-06-14 13:35 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-14 13:35:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dmitri Pal 2012-03-29 09:07:38 EDT
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/sssd/ticket/1275

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 Galipeau 2012-03-29 13:53:22 EDT
Please add steps to reproduce this issue

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